Package org.elasticsearch.client.indices
Class PutIndexTemplateRequest
java.lang.Object
org.elasticsearch.client.TimedRequest
org.elasticsearch.client.indices.PutIndexTemplateRequest
- All Implemented Interfaces:
Validatable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentFragment
public class PutIndexTemplateRequest
extends TimedRequest
implements org.elasticsearch.common.xcontent.ToXContentFragment
A request to create an index template.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
-
Field Summary
Fields inherited from class org.elasticsearch.client.TimedRequest
DEFAULT_ACK_TIMEOUT, DEFAULT_MASTER_NODE_TIMEOUT
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
Fields inherited from interface org.elasticsearch.client.Validatable
EMPTY
-
Constructor Summary
ConstructorDescriptionPutIndexTemplateRequest(String name, List<String> indexPatterns)
Constructs a new put index template request with the provided name and patterns. -
Method Summary
Modifier and TypeMethodDescriptionalias(org.elasticsearch.action.admin.indices.alias.Alias alias)
Adds an alias that will be added when the index gets created.Set<org.elasticsearch.action.admin.indices.alias.Alias>
aliases()
Sets the aliases that will be associated with the index when it gets createdSets the aliases that will be associated with the index when it gets createdaliases(org.elasticsearch.common.bytes.BytesReference source)
Sets the aliases that will be associated with the index when it gets createdaliases(org.elasticsearch.common.xcontent.XContentBuilder source)
Sets the aliases that will be associated with the index when it gets createdcause()
The cause for this index template creation.boolean
create()
create(boolean create)
Set totrue
to force only creation, not an update of an index template.Adds mapping that will be added when the index gets created.Adds mapping that will be added when the index gets created.mapping(org.elasticsearch.common.bytes.BytesReference source, org.elasticsearch.common.xcontent.XContentType xContentType)
Adds mapping that will be added when the index gets created.mapping(org.elasticsearch.common.xcontent.XContentBuilder source)
Adds mapping that will be added when the index gets created.org.elasticsearch.common.bytes.BytesReference
mappings()
masterNodeTimeout(String timeout)
Deprecated.masterNodeTimeout(org.elasticsearch.core.TimeValue timeout)
Deprecated.UseTimedRequest.setMasterTimeout(TimeValue)
insteadname()
The name of the index template.Sets the name of the index template.int
order()
order(int order)
patterns()
org.elasticsearch.common.settings.Settings
settings()
The settings to create the index template with (either json/yaml format).The settings to create the index template with (either json or yaml format).settings(org.elasticsearch.common.settings.Settings settings)
The settings to create the index template with.settings(org.elasticsearch.common.settings.Settings.Builder settings)
The settings to create the index template with.source(byte[] source, int offset, int length, org.elasticsearch.common.xcontent.XContentType xContentType)
The template source definition.source(byte[] source, org.elasticsearch.common.xcontent.XContentType xContentType)
The template source definition.The template source definition.The template source definition.source(org.elasticsearch.common.bytes.BytesReference source, org.elasticsearch.common.xcontent.XContentType xContentType)
The template source definition.source(org.elasticsearch.common.xcontent.XContentBuilder templateBuilder)
The template source definition.org.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
version()
Methods inherited from class org.elasticsearch.client.TimedRequest
masterNodeTimeout, setMasterTimeout, setTimeout, timeout
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
Methods inherited from interface org.elasticsearch.client.Validatable
validate
-
Constructor Details
-
PutIndexTemplateRequest
Constructs a new put index template request with the provided name and patterns.
-
-
Method Details
-
name
Sets the name of the index template. -
name
The name of the index template. -
patterns
-
patterns
-
order
-
order
public int order() -
version
-
version
-
create
Set totrue
to 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
public PutIndexTemplateRequest settings(org.elasticsearch.common.settings.Settings.Builder settings)The settings to create the index template with. -
settings
public PutIndexTemplateRequest settings(String source, org.elasticsearch.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.elasticsearch.common.settings.Settings settings() -
mapping
public PutIndexTemplateRequest mapping(String source, org.elasticsearch.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
-
mapping
Adds mapping that will be added when the index gets created.- Parameters:
source
- The mapping source
-
mapping
public PutIndexTemplateRequest mapping(org.elasticsearch.common.bytes.BytesReference source, org.elasticsearch.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.elasticsearch.common.bytes.BytesReference mappings() -
source
public PutIndexTemplateRequest source(org.elasticsearch.common.xcontent.XContentBuilder templateBuilder)The template source definition. -
source
The template source definition. -
source
public PutIndexTemplateRequest source(String templateSource, org.elasticsearch.common.xcontent.XContentType xContentType)The template source definition. -
source
public PutIndexTemplateRequest source(byte[] source, org.elasticsearch.common.xcontent.XContentType xContentType)The template source definition. -
source
public PutIndexTemplateRequest source(byte[] source, int offset, int length, org.elasticsearch.common.xcontent.XContentType xContentType)The template source definition. -
source
public PutIndexTemplateRequest source(org.elasticsearch.common.bytes.BytesReference source, org.elasticsearch.common.xcontent.XContentType xContentType)The template source definition. -
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
-
masterNodeTimeout
@Deprecated public final PutIndexTemplateRequest masterNodeTimeout(org.elasticsearch.core.TimeValue timeout)Deprecated.UseTimedRequest.setMasterTimeout(TimeValue)
instead -
masterNodeTimeout
Deprecated.UseTimedRequest.setMasterTimeout(TimeValue)
instead -
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Specified by:
toXContent
in interfaceorg.elasticsearch.common.xcontent.ToXContent
- Throws:
IOException
-
TimedRequest.setMasterTimeout(TimeValue)
instead