Class PutIndexTemplateRequest
- java.lang.Object
-
- 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,ToXContent,ToXContentObject,TaskAwareRequest
public class PutIndexTemplateRequest extends MasterNodeRequest<PutIndexTemplateRequest> implements IndicesRequest, 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
ToXContent.DelegatingMapParams, ToXContent.MapParams, 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
Constructors Constructor Description PutIndexTemplateRequest()PutIndexTemplateRequest(String name)Constructs a new put index template request with the provided name.PutIndexTemplateRequest(StreamInput in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PutIndexTemplateRequestalias(Alias alias)Adds an alias that will be added when the index gets created.Set<Alias>aliases()PutIndexTemplateRequestaliases(String source)Sets the aliases that will be associated with the index when it gets createdPutIndexTemplateRequestaliases(Map<String,?> source)Sets the aliases that will be associated with the index when it gets createdPutIndexTemplateRequestaliases(BytesReference source)Sets the aliases that will be associated with the index when it gets createdPutIndexTemplateRequestaliases(XContentBuilder source)Sets the aliases that will be associated with the index when it gets createdStringcause()PutIndexTemplateRequestcause(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.String[]indices()Returns the array of indices that the action relates toIndicesOptionsindicesOptions()Returns the indices options used to resolve indices.PutIndexTemplateRequestmapping(String type, Object... source)A specialized simplified mapping source method, takes the form of simple properties definition: ("field1", "type=string,store=true").PutIndexTemplateRequestmapping(String type, String source, XContentType xContentType)Adds mapping that will be added when the index gets created.PutIndexTemplateRequestmapping(String type, Map<String,Object> source)Adds mapping that will be added when the index gets created.PutIndexTemplateRequestmapping(String type, BytesReference source, XContentType xContentType)Adds mapping that will be added when the index gets created.PutIndexTemplateRequestmapping(String type, XContentBuilder source)Adds mapping that will be added when the index gets created.Map<String,String>mappings()Stringname()The name of the index template.PutIndexTemplateRequestname(String name)Sets the name of the index template.intorder()PutIndexTemplateRequestorder(int order)List<String>patterns()PutIndexTemplateRequestpatterns(List<String> indexPatterns)Settingssettings()PutIndexTemplateRequestsettings(String source, XContentType xContentType)The settings to create the index template with (either json/yaml format).PutIndexTemplateRequestsettings(Map<String,Object> source)The settings to create the index template with (either json or yaml format).PutIndexTemplateRequestsettings(Settings settings)The settings to create the index template with.PutIndexTemplateRequestsettings(Settings.Builder settings)The settings to create the index template with.PutIndexTemplateRequestsource(byte[] source, int offset, int length, XContentType xContentType)The template source definition.PutIndexTemplateRequestsource(byte[] source, XContentType xContentType)The template source definition.PutIndexTemplateRequestsource(String templateSource, XContentType xContentType)The template source definition.PutIndexTemplateRequestsource(Map<String,Object> templateSource)The template source definition.PutIndexTemplateRequestsource(BytesReference source, XContentType xContentType)The template source definition.PutIndexTemplateRequestsource(XContentBuilder templateBuilder)The template source definition.XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params)ActionRequestValidationExceptionvalidate()Integerversion()PutIndexTemplateRequestversion(Integer version)voidwriteTo(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
-
Methods inherited from class org.elasticsearch.transport.TransportMessage
remoteAddress, remoteAddress
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
createTask, getDescription, setParentTask
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
-
-
-
Constructor Detail
-
PutIndexTemplateRequest
public PutIndexTemplateRequest(StreamInput in) throws IOException
- Throws:
IOException
-
PutIndexTemplateRequest
public PutIndexTemplateRequest()
-
PutIndexTemplateRequest
public PutIndexTemplateRequest(String name)
Constructs a new put index template request with the provided name.
-
-
Method Detail
-
validate
public ActionRequestValidationException validate()
- Specified by:
validatein classActionRequest
-
name
public PutIndexTemplateRequest name(String name)
Sets the name of the index template.
-
name
public String name()
The name of the index template.
-
patterns
public PutIndexTemplateRequest patterns(List<String> indexPatterns)
-
order
public PutIndexTemplateRequest order(int order)
-
order
public int order()
-
version
public PutIndexTemplateRequest version(Integer version)
-
version
public Integer version()
-
create
public PutIndexTemplateRequest create(boolean 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
public PutIndexTemplateRequest settings(Settings settings)
The settings to create the index template with.
-
settings
public PutIndexTemplateRequest settings(Settings.Builder settings)
The settings to create the index template with.
-
settings
public PutIndexTemplateRequest settings(String source, XContentType xContentType)
The settings to create the index template with (either json/yaml format).
-
settings
public PutIndexTemplateRequest settings(Map<String,Object> source)
The settings to create the index template with (either json or yaml format).
-
settings
public Settings settings()
-
mapping
public PutIndexTemplateRequest mapping(String type, String source, 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 PutIndexTemplateRequest cause(String cause)
The cause for this index template creation.
-
cause
public String cause()
-
mapping
public PutIndexTemplateRequest mapping(String type, XContentBuilder source)
Adds mapping that will be added when the index gets created.- Parameters:
type- The mapping typesource- The mapping source
-
mapping
public PutIndexTemplateRequest mapping(String type, BytesReference source, 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 PutIndexTemplateRequest mapping(String type, Map<String,Object> source)
Adds mapping that will be added when the index gets created.- Parameters:
type- The mapping typesource- The mapping source
-
mapping
public PutIndexTemplateRequest mapping(String type, Object... source)
A specialized simplified mapping source method, takes the form of simple properties definition: ("field1", "type=string,store=true").
-
source
public PutIndexTemplateRequest source(XContentBuilder templateBuilder)
The template source definition.
-
source
public PutIndexTemplateRequest source(Map<String,Object> templateSource)
The template source definition.
-
source
public PutIndexTemplateRequest source(String templateSource, XContentType xContentType)
The template source definition.
-
source
public PutIndexTemplateRequest source(byte[] source, XContentType xContentType)
The template source definition.
-
source
public PutIndexTemplateRequest source(byte[] source, int offset, int length, XContentType xContentType)
The template source definition.
-
source
public PutIndexTemplateRequest source(BytesReference source, XContentType xContentType)
The template source definition.
-
aliases
public PutIndexTemplateRequest aliases(Map<String,?> source)
Sets the aliases that will be associated with the index when it gets created
-
aliases
public PutIndexTemplateRequest aliases(XContentBuilder source)
Sets the aliases that will be associated with the index when it gets created
-
aliases
public PutIndexTemplateRequest aliases(String source)
Sets the aliases that will be associated with the index when it gets created
-
aliases
public PutIndexTemplateRequest aliases(BytesReference source)
Sets the aliases that will be associated with the index when it gets created
-
alias
public PutIndexTemplateRequest alias(Alias 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 String[] indices()
Description copied from interface:IndicesRequestReturns the array of indices that the action relates to- Specified by:
indicesin interfaceIndicesRequest
-
indicesOptions
public IndicesOptions indicesOptions()
Description copied from interface:IndicesRequestReturns 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:
indicesOptionsin interfaceIndicesRequest
-
writeTo
public void writeTo(StreamOutput out) throws IOException
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classMasterNodeRequest<PutIndexTemplateRequest>- Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
- Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
-