Class PutIndexTemplateRequestBuilder
java.lang.Object
org.opensearch.action.ActionRequestBuilder<PutIndexTemplateRequest,AcknowledgedResponse>
org.opensearch.action.support.clustermanager.ClusterManagerNodeOperationRequestBuilder<PutIndexTemplateRequest,AcknowledgedResponse,PutIndexTemplateRequestBuilder>
org.opensearch.action.admin.indices.template.put.PutIndexTemplateRequestBuilder
@PublicApi(since="1.0.0")
public class PutIndexTemplateRequestBuilder
extends ClusterManagerNodeOperationRequestBuilder<PutIndexTemplateRequest,AcknowledgedResponse,PutIndexTemplateRequestBuilder>
A request builder for putting an index template into the cluster state
- Opensearch.api:
-
Field Summary
Fields inherited from class org.opensearch.action.ActionRequestBuilder
action, client, request
-
Constructor Summary
ConstructorDescriptionPutIndexTemplateRequestBuilder
(OpenSearchClient client, PutIndexTemplateAction action) PutIndexTemplateRequestBuilder
(OpenSearchClient client, PutIndexTemplateAction action, String name) -
Method Summary
Modifier and TypeMethodDescriptionAdds an alias that will be added when the index template gets created.The cause for this index template creation.setAliases
(String source) Sets the aliases that will be associated with the index when it gets createdsetAliases
(Map<String, Object> source) Sets the aliases that will be associated with the index when it gets createdsetAliases
(org.opensearch.core.common.bytes.BytesReference source) Sets the aliases that will be associated with the index when it gets createdsetAliases
(org.opensearch.core.xcontent.XContentBuilder source) Sets the aliases that will be associated with the index when it gets createdsetCreate
(boolean create) Set totrue
to force only creation, not an update of an index template.setMapping
(String... source) A specialized simplified mapping source method, takes the form of simple properties definition: ("field1", "type=string,store=true").setMapping
(String source, org.opensearch.core.xcontent.MediaType mediaType) Adds mapping that will be added when the index template gets created.setMapping
(org.opensearch.core.xcontent.XContentBuilder source) Adds mapping that will be added when the index template gets created.setOrder
(int order) Sets the order of this template if more than one template matches.setPatterns
(List<String> indexPatterns) Sets the match expression that will be used to match on indices created.setSettings
(String source, org.opensearch.core.xcontent.MediaType mediaType) The settings to crete the index template with (either json or yaml format)setSettings
(Map<String, Object> source) The settings to crete the index template with (either json or yaml format)setSettings
(Settings settings) The settings to created the index template with.setSettings
(Settings.Builder settings) The settings to created the index template with.setSource
(byte[] templateSource, int offset, int length, org.opensearch.common.xcontent.XContentType xContentType) The template source definition.setSource
(byte[] templateSource, org.opensearch.core.xcontent.MediaType mediaType) The template source definition.The template source definition.setSource
(org.opensearch.core.common.bytes.BytesReference templateSource, org.opensearch.core.xcontent.MediaType mediaType) The template source definition.setSource
(org.opensearch.core.xcontent.XContentBuilder templateBuilder) The template source definition.setVersion
(Integer version) Sets the optional version of this template.Methods inherited from class org.opensearch.action.support.clustermanager.ClusterManagerNodeOperationRequestBuilder
setClusterManagerNodeTimeout, setClusterManagerNodeTimeout, setMasterNodeTimeout, setMasterNodeTimeout
-
Constructor Details
-
PutIndexTemplateRequestBuilder
-
PutIndexTemplateRequestBuilder
public PutIndexTemplateRequestBuilder(OpenSearchClient client, PutIndexTemplateAction action, String name)
-
-
Method Details
-
setPatterns
Sets the match expression that will be used to match on indices created. -
setOrder
Sets the order of this template if more than one template matches. -
setVersion
Sets the optional version of this template. -
setCreate
Set totrue
to force only creation, not an update of an index template. If it already exists, it will fail with anIllegalArgumentException
. -
setSettings
The settings to created the index template with. -
setSettings
The settings to created the index template with. -
setSettings
public PutIndexTemplateRequestBuilder setSettings(String source, org.opensearch.core.xcontent.MediaType mediaType) The settings to crete the index template with (either json or yaml format) -
setSettings
The settings to crete the index template with (either json or yaml format) -
setMapping
public PutIndexTemplateRequestBuilder setMapping(String source, org.opensearch.core.xcontent.MediaType mediaType) Adds mapping that will be added when the index template gets created.- Parameters:
source
- The mapping sourcemediaType
- The type/format of the source
-
setMapping
A specialized simplified mapping source method, takes the form of simple properties definition: ("field1", "type=string,store=true"). -
setAliases
Sets the aliases that will be associated with the index when it gets created -
setAliases
Sets the aliases that will be associated with the index when it gets created -
setAliases
public PutIndexTemplateRequestBuilder setAliases(org.opensearch.core.xcontent.XContentBuilder source) Sets the aliases that will be associated with the index when it gets created -
setAliases
public PutIndexTemplateRequestBuilder setAliases(org.opensearch.core.common.bytes.BytesReference source) Sets the aliases that will be associated with the index when it gets created -
addAlias
Adds an alias that will be added when the index template gets created.- Parameters:
alias
- The alias- Returns:
- the request builder
-
cause
The cause for this index template creation. -
setMapping
public PutIndexTemplateRequestBuilder setMapping(org.opensearch.core.xcontent.XContentBuilder source) Adds mapping that will be added when the index template gets created.- Parameters:
source
- The mapping source
-
setSource
public PutIndexTemplateRequestBuilder setSource(org.opensearch.core.xcontent.XContentBuilder templateBuilder) The template source definition. -
setSource
The template source definition. -
setSource
public PutIndexTemplateRequestBuilder setSource(org.opensearch.core.common.bytes.BytesReference templateSource, org.opensearch.core.xcontent.MediaType mediaType) The template source definition. -
setSource
public PutIndexTemplateRequestBuilder setSource(byte[] templateSource, org.opensearch.core.xcontent.MediaType mediaType) The template source definition. -
setSource
public PutIndexTemplateRequestBuilder setSource(byte[] templateSource, int offset, int length, org.opensearch.common.xcontent.XContentType xContentType) The template source definition.
-