/** * Creates new snapshot * * @param repository repository name * @param snapshot snapshot name * @return create snapshot request */ public static CreateSnapshotRequest createSnapshotRequest(String repository, String snapshot) { return new CreateSnapshotRequest(repository, snapshot); }
/** * If set to true the request should snapshot indices with unavailable shards * * @param partial true if request should snapshot indices with unavailable shards * @return this builder */ public CreateSnapshotRequestBuilder setPartial(boolean partial) { request.partial(partial); return this; }
/** * If set to true the request should wait for the snapshot completion before returning. * * @param waitForCompletion true if * @return this builder */ public CreateSnapshotRequestBuilder setWaitForCompletion(boolean waitForCompletion) { request.waitForCompletion(waitForCompletion); return this; }
tc.admin().cluster().createSnapshot(new CreateSnapshotRequest("vulcangov", "vulcangov_1").indices("vulcangov").includeGlobalState(true).waitForCompletion(true)).actionGet(); tc.admin().cluster().createSnapshot(new CreateSnapshotRequest("searchguard", "searchguard_1").indices("searchguard").includeGlobalState(false).waitForCompletion(true)).actionGet(); tc.admin().cluster().createSnapshot(new CreateSnapshotRequest("all", "all_1").indices("*").includeGlobalState(false).waitForCompletion(true)).actionGet();
/** * Sets the snapshot name * * @param snapshot snapshot name * @return this builder */ public CreateSnapshotRequestBuilder setSnapshot(String snapshot) { request.snapshot(snapshot); return this; }
/** * Sets the repository name * * @param repository repository name * @return this builder */ public CreateSnapshotRequestBuilder setRepository(String repository) { request.repository(repository); return this; }
/** * Set to true if snapshot should include global cluster state * * @param includeGlobalState true if snapshot should include global cluster state * @return this builder */ public CreateSnapshotRequestBuilder setIncludeGlobalState(boolean includeGlobalState) { request.includeGlobalState(includeGlobalState); return this; } }
/** * Sets a list of indices that should be included into the snapshot * <p> * The list of indices supports multi-index syntax. For example: "+test*" ,"-test42" will index all indices with * prefix "test" except index "test42". Aliases are supported. An empty list or {"_all"} will snapshot all open * indices in the cluster. * * @return this builder */ public CreateSnapshotRequestBuilder setIndices(String... indices) { request.indices(indices); return this; }
/** * Sets repository-specific snapshot settings. * <p> * See repository documentation for more information. * * @param settings repository-specific snapshot settings * @return this builder */ public CreateSnapshotRequestBuilder setSettings(Settings settings) { request.settings(settings); return this; }
@Override public CreateSnapshotRequestBuilder newRequestBuilder(ElasticsearchClient client) { return new CreateSnapshotRequestBuilder(client, this); } }
@Override public CreateSnapshotResponse newResponse() { return new CreateSnapshotResponse(); }
/** * Specifies the indices options. Like what type of requested indices to ignore. For example indices that don't exist. * * @param indicesOptions the desired behaviour regarding indices options * @return this request */ public CreateSnapshotRequestBuilder setIndicesOptions(IndicesOptions indicesOptions) { request.indicesOptions(indicesOptions); return this; }
tc.admin().cluster().createSnapshot(new CreateSnapshotRequest("vulcangov", "vulcangov_1").indices("vulcangov").includeGlobalState(true).waitForCompletion(true)).actionGet(); tc.admin().cluster().createSnapshot(new CreateSnapshotRequest("searchguard", "searchguard_1").indices("searchguard").includeGlobalState(false).waitForCompletion(true)).actionGet(); tc.admin().cluster().createSnapshot(new CreateSnapshotRequest("all", "all_1").indices("*").includeGlobalState(false).waitForCompletion(true)).actionGet();
/** * Constructs a new create snapshot request builder with specified repository and snapshot names */ public CreateSnapshotRequestBuilder(ElasticsearchClient client, CreateSnapshotAction action, String repository, String snapshot) { super(client, action, new CreateSnapshotRequest(repository, snapshot)); }
/** * Sets repository-specific snapshot settings. * <p> * See repository documentation for more information. * * @param settings repository-specific snapshot settings * @return this builder */ public CreateSnapshotRequestBuilder setSettings(Settings.Builder settings) { request.settings(settings); return this; }
@Override public CreateSnapshotRequestBuilder prepareCreateSnapshot(String repository, String name) { return new CreateSnapshotRequestBuilder(this, CreateSnapshotAction.INSTANCE, repository, name); }
@Override protected CreateSnapshotResponse newResponse() { return new CreateSnapshotResponse(); }
tc.admin().cluster().createSnapshot(new CreateSnapshotRequest("vulcangov", "vulcangov_1").indices("vulcangov").includeGlobalState(true).waitForCompletion(true)).actionGet(); tc.admin().cluster().createSnapshot(new CreateSnapshotRequest("searchguard", "searchguard_1").indices("searchguard").includeGlobalState(false).waitForCompletion(true)).actionGet(); tc.admin().cluster().createSnapshot(new CreateSnapshotRequest("all", "all_1").indices("*").includeGlobalState(false).waitForCompletion(true)).actionGet();
/** * Constructs a new create snapshot request builder */ public CreateSnapshotRequestBuilder(ElasticsearchClient client, CreateSnapshotAction action) { super(client, action, new CreateSnapshotRequest()); }
/** * Sets repository-specific snapshot settings. * <p> * See repository documentation for more information. * * @param settings repository-specific snapshot settings * @return this builder */ public CreateSnapshotRequestBuilder setSettings(Map<String, Object> settings) { request.settings(settings); return this; }