Class 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.Empty
      • Nested classes/interfaces inherited from interface org.opensearch.action.IndicesRequest

        org.opensearch.action.IndicesRequest.Replaceable
      • Nested classes/interfaces inherited from interface org.opensearch.common.xcontent.ToXContent

        org.opensearch.common.xcontent.ToXContent.DelegatingMapParams, org.opensearch.common.xcontent.ToXContent.MapParams, org.opensearch.common.xcontent.ToXContent.Params
      • Nested classes/interfaces inherited from interface org.opensearch.common.io.stream.Writeable

        org.opensearch.common.io.stream.Writeable.Reader<V extends java.lang.Object>, org.opensearch.common.io.stream.Writeable.Writer<V extends java.lang.Object>
    • Field Summary

      • Fields inherited from class org.opensearch.action.support.master.MasterNodeRequest

        DEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeout
      • Fields inherited from interface org.opensearch.common.xcontent.ToXContent

        EMPTY_PARAMS
    • Constructor Summary

      Constructors 
      Constructor Description
      PutIndexTemplateRequest​(java.lang.String name)
      Constructs a new put index template request with the provided name.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      PutIndexTemplateRequest alias​(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()  
      PutIndexTemplateRequest aliases​(java.lang.String source)
      Sets the aliases that will be associated with the index when it gets created
      PutIndexTemplateRequest aliases​(java.util.Map<java.lang.String,​?> source)
      Sets the aliases that will be associated with the index when it gets created
      PutIndexTemplateRequest aliases​(org.opensearch.common.bytes.BytesReference source)
      Sets the aliases that will be associated with the index when it gets created
      PutIndexTemplateRequest aliases​(org.opensearch.common.xcontent.XContentBuilder source)
      Sets the aliases that will be associated with the index when it gets created
      java.lang.String cause()  
      PutIndexTemplateRequest cause​(java.lang.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.
      java.lang.String[] indices()  
      org.opensearch.action.support.IndicesOptions indicesOptions()  
      PutIndexTemplateRequest mapping​(java.lang.String source, org.opensearch.common.xcontent.XContentType xContentType)
      Adds mapping that will be added when the index gets created.
      PutIndexTemplateRequest mapping​(java.util.Map<java.lang.String,​java.lang.Object> source)
      Adds mapping that will be added when the index gets created.
      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.
      PutIndexTemplateRequest mapping​(org.opensearch.common.xcontent.XContentBuilder source)
      Adds mapping that will be added when the index gets created.
      org.opensearch.common.bytes.BytesReference mappings()  
      java.lang.String name()
      The name of the index template.
      PutIndexTemplateRequest name​(java.lang.String name)
      Sets the name of the index template.
      int order()  
      PutIndexTemplateRequest order​(int order)  
      java.util.List<java.lang.String> patterns()  
      PutIndexTemplateRequest patterns​(java.util.List<java.lang.String> indexPatterns)  
      org.opensearch.common.settings.Settings settings()  
      PutIndexTemplateRequest settings​(java.lang.String source, org.opensearch.common.xcontent.XContentType xContentType)
      The settings to create the index template with (either json/yaml format).
      PutIndexTemplateRequest settings​(java.util.Map<java.lang.String,​java.lang.Object> source)
      The settings to create the index template with (either json or yaml format).
      PutIndexTemplateRequest settings​(org.opensearch.common.settings.Settings settings)
      The settings to create the index template with.
      PutIndexTemplateRequest settings​(org.opensearch.common.settings.Settings.Builder settings)
      The settings to create the index template with.
      PutIndexTemplateRequest source​(byte[] source, int offset, int length, org.opensearch.common.xcontent.XContentType xContentType)
      The template source definition.
      PutIndexTemplateRequest source​(byte[] source, org.opensearch.common.xcontent.XContentType xContentType)
      The template source definition.
      PutIndexTemplateRequest source​(java.lang.String templateSource, org.opensearch.common.xcontent.XContentType xContentType)
      The template source definition.
      PutIndexTemplateRequest source​(java.util.Map<java.lang.String,​java.lang.Object> templateSource)
      The template source definition.
      PutIndexTemplateRequest source​(org.opensearch.common.bytes.BytesReference source, org.opensearch.common.xcontent.XContentType xContentType)
      The template source definition.
      PutIndexTemplateRequest source​(org.opensearch.common.xcontent.XContentBuilder templateBuilder)
      The template source definition.
      org.opensearch.common.xcontent.XContentBuilder toXContent​(org.opensearch.common.xcontent.XContentBuilder builder, org.opensearch.common.xcontent.ToXContent.Params params)  
      org.opensearch.action.ActionRequestValidationException validate()  
      java.lang.Integer version()  
      PutIndexTemplateRequest version​(java.lang.Integer version)  
      • Methods inherited from class org.opensearch.action.support.master.MasterNodeRequest

        masterNodeTimeout, masterNodeTimeout, masterNodeTimeout, writeTo
      • Methods inherited from class org.opensearch.action.ActionRequest

        getShouldStoreResult
      • Methods inherited from class org.opensearch.transport.TransportRequest

        getParentTask, setParentTask
      • Methods inherited from class org.opensearch.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.opensearch.action.IndicesRequest

        includeDataStreams
      • Methods inherited from interface org.opensearch.tasks.TaskAwareRequest

        createTask, getDescription, setParentTask
      • Methods inherited from interface org.opensearch.common.xcontent.ToXContentFragment

        isFragment
    • Constructor Detail

      • PutIndexTemplateRequest

        public PutIndexTemplateRequest​(java.lang.String name)
        Constructs a new put index template request with the provided name.
    • Method Detail

      • validate

        public org.opensearch.action.ActionRequestValidationException validate()
        Specified by:
        validate in class org.opensearch.action.ActionRequest
      • name

        public java.lang.String name()
        The name of the index template.
      • patterns

        public java.util.List<java.lang.String> patterns()
      • order

        public int order()
      • version

        public java.lang.Integer version()
      • 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 IllegalArgumentException.
      • create

        public boolean create()
      • settings

        public PutIndexTemplateRequest settings​(org.opensearch.common.settings.Settings settings)
        The settings to create the index template with.
      • settings

        public PutIndexTemplateRequest settings​(org.opensearch.common.settings.Settings.Builder 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

        public PutIndexTemplateRequest settings​(java.util.Map<java.lang.String,​java.lang.Object> source)
        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 source
        xContentType - The type of content contained within the source
      • cause

        public PutIndexTemplateRequest cause​(java.lang.String cause)
        The cause for this index template creation.
      • cause

        public java.lang.String cause()
      • mapping

        public PutIndexTemplateRequest mapping​(org.opensearch.common.xcontent.XContentBuilder source)
        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 source
        xContentType - the source content type
      • mapping

        public PutIndexTemplateRequest mapping​(java.util.Map<java.lang.String,​java.lang.Object> source)
        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

        public PutIndexTemplateRequest aliases​(java.util.Map<java.lang.String,​?> source)
        Sets the aliases that will be associated with the index when it gets created
      • aliases

        public PutIndexTemplateRequest aliases​(org.opensearch.common.xcontent.XContentBuilder source)
        Sets the aliases that will be associated with the index when it gets created
      • aliases

        public PutIndexTemplateRequest aliases​(java.lang.String source)
        Sets the aliases that will be associated with the index when it gets created
      • aliases

        public PutIndexTemplateRequest aliases​(org.opensearch.common.bytes.BytesReference source)
        Sets the aliases that will be associated with the index when it gets created
      • alias

        public PutIndexTemplateRequest alias​(org.opensearch.action.admin.indices.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 java.lang.String[] indices()
        Specified by:
        indices in interface org.opensearch.action.IndicesRequest
      • indicesOptions

        public org.opensearch.action.support.IndicesOptions indicesOptions()
        Specified by:
        indicesOptions in interface org.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:
        toXContent in interface org.opensearch.common.xcontent.ToXContent
        Throws:
        java.io.IOException