Class PutIndexTemplateRequest
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.TransportRequest
org.elasticsearch.action.ActionRequest
org.elasticsearch.action.support.master.MasterNodeRequest<PutIndexTemplateRequest>
org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest
- All Implemented Interfaces:
IndicesRequest
,Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentObject
,org.elasticsearch.core.RefCounted
,TaskAwareRequest
public class PutIndexTemplateRequest
extends MasterNodeRequest<PutIndexTemplateRequest>
implements IndicesRequest, org.elasticsearch.common.xcontent.ToXContentObject
A request to create an index template.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.transport.TransportRequest
TransportRequest.Empty
Nested classes/interfaces inherited from interface org.elasticsearch.action.IndicesRequest
IndicesRequest.Replaceable
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
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Fields inherited from class org.elasticsearch.action.support.master.MasterNodeRequest
DEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeout
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ConstructorDescriptionname)
Constructs a new put index template request with the provided name. -
Method Summary
Modifier and TypeMethodDescriptionAdds an alias that will be added when the index gets created.<Alias>
aliases()
source)
Sets the aliases that will be associated with the index when it gets created<,?> source)
Sets the aliases that will be associated with the index when it gets createdaliases(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()
cause)
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.[]
indices()
Returns the array of indices that the action relates toReturns the indices options used to resolve indices.type, ... source)
A specialized simplified mapping source method, takes the form of simple properties definition: ("field1", "type=string,store=true").type, source, org.elasticsearch.common.xcontent.XContentType xContentType)
Adds mapping that will be added when the index gets created.type, <,> source)
Adds mapping that will be added when the index gets created.type, BytesReference source, org.elasticsearch.common.xcontent.XContentType xContentType)
Adds mapping that will be added when the index gets created.type, org.elasticsearch.common.xcontent.XContentBuilder source)
Adds mapping that will be added when the index gets created.<,>
mappings()
name()
The name of the index template.name)
Sets the name of the index template.int
order()
order(int order)
<>
patterns()
<> indexPatterns)
settings()
source, org.elasticsearch.common.xcontent.XContentType xContentType)
The settings to create the index template with (either json/yaml format).<,> source)
The settings to create the index template with (either json or yaml format).The settings to create the index template with.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.templateSource, org.elasticsearch.common.xcontent.XContentType xContentType)
The template source definition.<,> templateSource)
The template source definition.source(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)
validate()
version()
version)
void
writeTo(StreamOutput out)
Write this into the StreamOutput.Methods inherited from class org.elasticsearch.action.support.master.MasterNodeRequest
masterNodeTimeout, masterNodeTimeout, masterNodeTimeout
Methods inherited from class org.elasticsearch.action.ActionRequest
getShouldStoreResult
Methods inherited from class org.elasticsearch.transport.TransportRequest
getParentTask, setParentTask, toString
Methods inherited from class org.elasticsearch.transport.TransportMessage
decRef, incRef, remoteAddress, remoteAddress, tryIncRef
Methods inherited from class java.lang.
, , , , , , , , ,
Methods inherited from interface org.elasticsearch.action.IndicesRequest
allowsRemoteIndices, includeDataStreams
Methods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
createTask, getDescription, setParentTask
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
Constructor Details
-
PutIndexTemplateRequest
- Throws:
-
PutIndexTemplateRequest
public PutIndexTemplateRequest() -
PutIndexTemplateRequest
public PutIndexTemplateRequest( name)Constructs a new put index template request with the provided name.
-
-
Method Details
-
validate
- Specified by:
validate
in classActionRequest
-
name
public name)Sets the name of the index template. -
name
public name()The name of the index template. -
patterns
public <> indexPatterns) -
patterns
public <> patterns() -
order
-
order
public int order() -
version
public version) -
version
public version() -
create
Set totrue
to force only creation, not an update of an index template. If it already exists, it will fail with an . -
create
public boolean create() -
settings
The settings to create the index template with. -
settings
The settings to create the index template with. -
settings
public source, org.elasticsearch.common.xcontent.XContentType xContentType)The settings to create the index template with (either json/yaml format). -
settings
public <,> source)The settings to create the index template with (either json or yaml format). -
settings
-
mapping
public type, source, org.elasticsearch.common.xcontent.XContentType xContentType)Adds mapping that will be added when the index gets created.- Parameters:
type
- The mapping typesource
- The mapping sourcexContentType
- The type of content contained within the source
-
cause
public cause)The cause for this index template creation. -
cause
public cause() -
mapping
public type, org.elasticsearch.common.xcontent.XContentBuilder source)Adds mapping that will be added when the index gets created.- Parameters:
type
- The mapping typesource
- The mapping source
-
mapping
public type, BytesReference source, org.elasticsearch.common.xcontent.XContentType xContentType)Adds mapping that will be added when the index gets created.- Parameters:
type
- The mapping typesource
- The mapping sourcexContentType
- the source content type
-
mapping
public type, <,> source)Adds mapping that will be added when the index gets created.- Parameters:
type
- The mapping typesource
- The mapping source
-
mapping
public type, ... source)A specialized simplified mapping source method, takes the form of simple properties definition: ("field1", "type=string,store=true"). -
mappings
public <,> mappings() -
source
public PutIndexTemplateRequest source(org.elasticsearch.common.xcontent.XContentBuilder templateBuilder)The template source definition. -
source
public <,> templateSource)The template source definition. -
source
public 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(BytesReference source, org.elasticsearch.common.xcontent.XContentType xContentType)The template source definition. -
aliases
-
aliases
public <,?> source)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
public source)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 [] indices()Description copied from interface:IndicesRequest
Returns the array of indices that the action relates to- Specified by:
indices
in interfaceIndicesRequest
-
indicesOptions
Description copied from interface:IndicesRequest
Returns the indices options used to resolve indices. They tell for instance whether a single index is accepted, whether an empty array will be converted to _all, and how wildcards will be expanded if needed.- Specified by:
indicesOptions
in interfaceIndicesRequest
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Overrides:
writeTo
in classMasterNodeRequest<PutIndexTemplateRequest>
- Throws:
-
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws- Specified by:
toXContent
in interfaceorg.elasticsearch.common.xcontent.ToXContent
- Throws:
-