summaryrefslogtreecommitdiff
path: root/core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestBuilder.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestBuilder.java')
-rw-r--r--core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestBuilder.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestBuilder.java b/core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestBuilder.java
index ebdd206b5c..d3b5e12351 100644
--- a/core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestBuilder.java
+++ b/core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestBuilder.java
@@ -23,6 +23,7 @@ import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.action.support.master.MasterNodeOperationRequestBuilder;
import org.elasticsearch.client.ElasticsearchClient;
import org.elasticsearch.common.settings.Settings;
+import org.elasticsearch.common.xcontent.XContentType;
import java.util.Map;
@@ -147,13 +148,29 @@ public class CreateSnapshotRequestBuilder extends MasterNodeOperationRequestBuil
*
* @param source repository-specific snapshot settings
* @return this builder
+ * @deprecated use {@link #setSettings(String, XContentType)} to avoid content type detection
*/
+ @Deprecated
public CreateSnapshotRequestBuilder setSettings(String source) {
request.settings(source);
return this;
}
/**
+ * Sets repository-specific snapshot settings in YAML or JSON format
+ * <p>
+ * See repository documentation for more information.
+ *
+ * @param source repository-specific snapshot settings
+ * @param xContentType the content type of the source
+ * @return this builder
+ */
+ public CreateSnapshotRequestBuilder setSettings(String source, XContentType xContentType) {
+ request.settings(source, xContentType);
+ return this;
+ }
+
+ /**
* Sets repository-specific snapshot settings.
* <p>
* See repository documentation for more information.