org.elasticsearch.action.admin.indices.template.put
Class PutIndexTemplateRequest

java.lang.Object
  extended by org.elasticsearch.action.support.master.MasterNodeOperationRequest
      extended by org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest
All Implemented Interfaces:
ActionRequest, Streamable

public class PutIndexTemplateRequest
extends MasterNodeOperationRequest

A request to create an index template.


Field Summary
 
Fields inherited from class org.elasticsearch.action.support.master.MasterNodeOperationRequest
DEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeout
 
Constructor Summary
PutIndexTemplateRequest(String name)
          Constructs a new put index template request with the provided name.
 
Method Summary
 String cause()
           
 PutIndexTemplateRequest cause(String cause)
          The cause for this index template creation.
 boolean create()
           
 PutIndexTemplateRequest create(boolean create)
          Set to true to force only creation, not an update of an index template.
 PutIndexTemplateRequest custom(IndexMetaData.Custom custom)
           
 PutIndexTemplateRequest mapping(String type, Map<String,Object> source)
          Adds mapping that will be added when the index gets created.
 PutIndexTemplateRequest mapping(String type, String source)
          Adds mapping that will be added when the index gets created.
 PutIndexTemplateRequest mapping(String type, XContentBuilder source)
          Adds mapping that will be added when the index gets created.
 String name()
          The name of the index template.
 PutIndexTemplateRequest name(String name)
          Sets the name of the index template.
 int order()
           
 PutIndexTemplateRequest order(int order)
           
 void readFrom(StreamInput in)
           
 PutIndexTemplateRequest settings(Map<String,Object> source)
          The settings to crete the index template with (either json/yaml/properties format).
 PutIndexTemplateRequest settings(Settings.Builder settings)
          The settings to create the index template with.
 PutIndexTemplateRequest settings(Settings settings)
          The settings to create the index template with.
 PutIndexTemplateRequest settings(String source)
          The settings to create the index template with (either json/yaml/properties format).
 PutIndexTemplateRequest source(byte[] source)
          The template source definition.
 PutIndexTemplateRequest source(byte[] source, int offset, int length)
          The template source definition.
 PutIndexTemplateRequest source(BytesReference source)
          The template source definition.
 PutIndexTemplateRequest source(Map templateSource)
          The template source definition.
 PutIndexTemplateRequest source(String templateSource)
          The template source definition.
 PutIndexTemplateRequest source(XContentBuilder templateBuilder)
          The template source definition.
 String template()
           
 PutIndexTemplateRequest template(String template)
           
 PutIndexTemplateRequest timeout(String timeout)
          Timeout to wait till the put mapping gets acknowledged of all current cluster nodes.
 PutIndexTemplateRequest timeout(TimeValue timeout)
          Timeout to wait till the put mapping gets acknowledged of all current cluster nodes.
 ActionRequestValidationException validate()
           
 void writeTo(StreamOutput out)
           
 
Methods inherited from class org.elasticsearch.action.support.master.MasterNodeOperationRequest
listenerThreaded, listenerThreaded, masterNodeTimeout, masterNodeTimeout, masterNodeTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PutIndexTemplateRequest

public PutIndexTemplateRequest(String name)
Constructs a new put index template request with the provided name.

Method Detail

validate

public ActionRequestValidationException validate()

name

public PutIndexTemplateRequest name(String name)
Sets the name of the index template.


name

public String name()
The name of the index template.


template

public PutIndexTemplateRequest template(String template)

template

public String template()

order

public PutIndexTemplateRequest order(int order)

order

public int order()

create

public PutIndexTemplateRequest create(boolean create)
Set to true to force only creation, not an update of an index template. If it already exists, it will fail with an IndexTemplateAlreadyExistsException.


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)
The settings to create the index template with (either json/yaml/properties format).


settings

public PutIndexTemplateRequest settings(Map<String,Object> source)
The settings to crete the index template with (either json/yaml/properties format).


mapping

public PutIndexTemplateRequest mapping(String type,
                                       String source)
Adds mapping that will be added when the index gets created.

Parameters:
type - The mapping type
source - The mapping 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 type
source - The mapping source

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 type
source - The mapping source

source

public PutIndexTemplateRequest source(XContentBuilder templateBuilder)
The template source definition.


source

public PutIndexTemplateRequest source(Map templateSource)
The template source definition.


source

public PutIndexTemplateRequest source(String templateSource)
The template source definition.


source

public PutIndexTemplateRequest source(byte[] source)
The template source definition.


source

public PutIndexTemplateRequest source(byte[] source,
                                      int offset,
                                      int length)
The template source definition.


source

public PutIndexTemplateRequest source(BytesReference source)
The template source definition.


custom

public PutIndexTemplateRequest custom(IndexMetaData.Custom custom)

timeout

public PutIndexTemplateRequest timeout(TimeValue timeout)
Timeout to wait till the put mapping gets acknowledged of all current cluster nodes. Defaults to 10s.


timeout

public PutIndexTemplateRequest timeout(String timeout)
Timeout to wait till the put mapping gets acknowledged of all current cluster nodes. Defaults to 10s.


readFrom

public void readFrom(StreamInput in)
              throws IOException
Specified by:
readFrom in interface Streamable
Overrides:
readFrom in class MasterNodeOperationRequest
Throws:
IOException

writeTo

public void writeTo(StreamOutput out)
             throws IOException
Specified by:
writeTo in interface Streamable
Overrides:
writeTo in class MasterNodeOperationRequest
Throws:
IOException


Copyright © 2009-2012. All Rights Reserved.