Package org.opensearch.client.indices
Class PutIndexTemplateRequest
java.lang.Object
org.opensearch.transport.TransportMessage
org.opensearch.transport.TransportRequest
org.opensearch.action.ActionRequest
org.opensearch.action.support.master.MasterNodeRequest<PutIndexTemplateRequest>
org.opensearch.client.indices.PutIndexTemplateRequest
- All Implemented Interfaces:
org.opensearch.action.IndicesRequest,org.opensearch.common.io.stream.Writeable,org.opensearch.common.xcontent.ToXContent,org.opensearch.common.xcontent.ToXContentFragment,org.opensearch.tasks.TaskAwareRequest
public class PutIndexTemplateRequest extends org.opensearch.action.support.master.MasterNodeRequest<PutIndexTemplateRequest> implements org.opensearch.action.IndicesRequest, org.opensearch.common.xcontent.ToXContentFragment
A request to create an index template.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opensearch.transport.TransportRequest
org.opensearch.transport.TransportRequest.EmptyNested classes/interfaces inherited from interface org.opensearch.action.IndicesRequest
org.opensearch.action.IndicesRequest.Replaceable -
Field Summary
-
Constructor Summary
Constructors Constructor Description PutIndexTemplateRequest(java.lang.String name)Constructs a new put index template request with the provided name. -
Method Summary
Modifier and Type Method Description PutIndexTemplateRequestalias(org.opensearch.action.admin.indices.alias.Alias alias)Adds an alias that will be added when the index gets created.java.util.Set<org.opensearch.action.admin.indices.alias.Alias>aliases()PutIndexTemplateRequestaliases(java.lang.String source)Sets the aliases that will be associated with the index when it gets createdPutIndexTemplateRequestaliases(java.util.Map<java.lang.String,?> source)Sets the aliases that will be associated with the index when it gets createdPutIndexTemplateRequestaliases(org.opensearch.common.bytes.BytesReference source)Sets the aliases that will be associated with the index when it gets createdPutIndexTemplateRequestaliases(org.opensearch.common.xcontent.XContentBuilder source)Sets the aliases that will be associated with the index when it gets createdjava.lang.Stringcause()PutIndexTemplateRequestcause(java.lang.String cause)The cause for this index template creation.booleancreate()PutIndexTemplateRequestcreate(boolean create)Set totrueto force only creation, not an update of an index template.java.lang.String[]indices()org.opensearch.action.support.IndicesOptionsindicesOptions()PutIndexTemplateRequestmapping(java.lang.String source, org.opensearch.common.xcontent.XContentType xContentType)Adds mapping that will be added when the index gets created.PutIndexTemplateRequestmapping(java.util.Map<java.lang.String,java.lang.Object> source)Adds mapping that will be added when the index gets created.PutIndexTemplateRequestmapping(org.opensearch.common.bytes.BytesReference source, org.opensearch.common.xcontent.XContentType xContentType)Adds mapping that will be added when the index gets created.PutIndexTemplateRequestmapping(org.opensearch.common.xcontent.XContentBuilder source)Adds mapping that will be added when the index gets created.org.opensearch.common.bytes.BytesReferencemappings()java.lang.Stringname()The name of the index template.PutIndexTemplateRequestname(java.lang.String name)Sets the name of the index template.intorder()PutIndexTemplateRequestorder(int order)java.util.List<java.lang.String>patterns()PutIndexTemplateRequestpatterns(java.util.List<java.lang.String> indexPatterns)org.opensearch.common.settings.Settingssettings()PutIndexTemplateRequestsettings(java.lang.String source, org.opensearch.common.xcontent.XContentType xContentType)The settings to create the index template with (either json/yaml format).PutIndexTemplateRequestsettings(java.util.Map<java.lang.String,java.lang.Object> source)The settings to create the index template with (either json or yaml format).PutIndexTemplateRequestsettings(org.opensearch.common.settings.Settings settings)The settings to create the index template with.PutIndexTemplateRequestsettings(org.opensearch.common.settings.Settings.Builder settings)The settings to create the index template with.PutIndexTemplateRequestsource(byte[] source, int offset, int length, org.opensearch.common.xcontent.XContentType xContentType)The template source definition.PutIndexTemplateRequestsource(byte[] source, org.opensearch.common.xcontent.XContentType xContentType)The template source definition.PutIndexTemplateRequestsource(java.lang.String templateSource, org.opensearch.common.xcontent.XContentType xContentType)The template source definition.PutIndexTemplateRequestsource(java.util.Map<java.lang.String,java.lang.Object> templateSource)The template source definition.PutIndexTemplateRequestsource(org.opensearch.common.bytes.BytesReference source, org.opensearch.common.xcontent.XContentType xContentType)The template source definition.PutIndexTemplateRequestsource(org.opensearch.common.xcontent.XContentBuilder templateBuilder)The template source definition.org.opensearch.common.xcontent.XContentBuildertoXContent(org.opensearch.common.xcontent.XContentBuilder builder, org.opensearch.common.xcontent.ToXContent.Params params)org.opensearch.action.ActionRequestValidationExceptionvalidate()java.lang.Integerversion()PutIndexTemplateRequestversion(java.lang.Integer version)Methods inherited from class org.opensearch.action.support.master.MasterNodeRequest
masterNodeTimeout, masterNodeTimeout, masterNodeTimeout, writeToMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
PutIndexTemplateRequest
public PutIndexTemplateRequest(java.lang.String name)Constructs a new put index template request with the provided name.
-
-
Method Details
-
validate
public org.opensearch.action.ActionRequestValidationException validate()- Specified by:
validatein classorg.opensearch.action.ActionRequest
-
name
Sets the name of the index template. -
name
public java.lang.String name()The name of the index template. -
patterns
-
patterns
public java.util.List<java.lang.String> patterns() -
order
-
order
public int order() -
version
-
version
public java.lang.Integer version() -
create
Set totrueto force only creation, not an update of an index template. If it already exists, it will fail with anIllegalArgumentException. -
create
public boolean create() -
settings
The settings to create the index template with. -
settings
The settings to create the index template with. -
settings
public PutIndexTemplateRequest settings(java.lang.String source, org.opensearch.common.xcontent.XContentType xContentType)The settings to create the index template with (either json/yaml format). -
settings
The settings to create the index template with (either json or yaml format). -
settings
public org.opensearch.common.settings.Settings settings() -
mapping
public PutIndexTemplateRequest mapping(java.lang.String source, org.opensearch.common.xcontent.XContentType xContentType)Adds mapping that will be added when the index gets created.- Parameters:
source- The mapping sourcexContentType- The type of content contained within the source
-
cause
The cause for this index template creation. -
cause
public java.lang.String cause() -
mapping
Adds mapping that will be added when the index gets created.- Parameters:
source- The mapping source
-
mapping
public PutIndexTemplateRequest mapping(org.opensearch.common.bytes.BytesReference source, org.opensearch.common.xcontent.XContentType xContentType)Adds mapping that will be added when the index gets created.- Parameters:
source- The mapping sourcexContentType- the source content type
-
mapping
Adds mapping that will be added when the index gets created.- Parameters:
source- The mapping source
-
mappings
public org.opensearch.common.bytes.BytesReference mappings() -
source
public PutIndexTemplateRequest source(org.opensearch.common.xcontent.XContentBuilder templateBuilder)The template source definition. -
source
public PutIndexTemplateRequest source(java.util.Map<java.lang.String,java.lang.Object> templateSource)The template source definition. -
source
public PutIndexTemplateRequest source(java.lang.String templateSource, org.opensearch.common.xcontent.XContentType xContentType)The template source definition. -
source
public PutIndexTemplateRequest source(byte[] source, org.opensearch.common.xcontent.XContentType xContentType)The template source definition. -
source
public PutIndexTemplateRequest source(byte[] source, int offset, int length, org.opensearch.common.xcontent.XContentType xContentType)The template source definition. -
source
public PutIndexTemplateRequest source(org.opensearch.common.bytes.BytesReference source, org.opensearch.common.xcontent.XContentType xContentType)The template source definition. -
aliases
public java.util.Set<org.opensearch.action.admin.indices.alias.Alias> aliases() -
aliases
Sets the aliases that will be associated with the index when it gets created -
aliases
Sets the aliases that will be associated with the index when it gets created -
aliases
Sets the aliases that will be associated with the index when it gets created -
aliases
Sets the aliases that will be associated with the index when it gets created -
alias
Adds an alias that will be added when the index gets created.- Parameters:
alias- The metadata for the new alias- Returns:
- the index template creation request
-
indices
public java.lang.String[] indices()- Specified by:
indicesin interfaceorg.opensearch.action.IndicesRequest
-
indicesOptions
public org.opensearch.action.support.IndicesOptions indicesOptions()- Specified by:
indicesOptionsin interfaceorg.opensearch.action.IndicesRequest
-
toXContent
public org.opensearch.common.xcontent.XContentBuilder toXContent(org.opensearch.common.xcontent.XContentBuilder builder, org.opensearch.common.xcontent.ToXContent.Params params) throws java.io.IOException- Specified by:
toXContentin interfaceorg.opensearch.common.xcontent.ToXContent- Throws:
java.io.IOException
-