Class PutIndexTemplateRequest.Builder

All Implemented Interfaces:
WithJson<PutIndexTemplateRequest.Builder>, ObjectBuilder<PutIndexTemplateRequest>
Enclosing class:
PutIndexTemplateRequest

public static class PutIndexTemplateRequest.Builder extends RequestBase.AbstractBuilder<PutIndexTemplateRequest.Builder> implements ObjectBuilder<PutIndexTemplateRequest>
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • meta

      Optional user metadata about the index template. It may have any contents. It is not automatically generated or used by Elasticsearch. This user-defined object is stored in the cluster state, so keeping it short is preferable To unset the metadata, replace the template without specifying it.

      API name: _meta

      Adds all entries of map to meta.

    • meta

      public final PutIndexTemplateRequest.Builder meta(String key, JsonData value)
      Optional user metadata about the index template. It may have any contents. It is not automatically generated or used by Elasticsearch. This user-defined object is stored in the cluster state, so keeping it short is preferable To unset the metadata, replace the template without specifying it.

      API name: _meta

      Adds an entry to meta.

    • allowAutoCreate

      public final PutIndexTemplateRequest.Builder allowAutoCreate(@Nullable Boolean value)
      This setting overrides the value of the action.auto_create_index cluster setting. If set to true in a template, then indices can be automatically created using that template even if auto-creation of indices is disabled via actions.auto_create_index. If set to false, then indices or data streams matching the template must always be explicitly created, and may never be automatically created.

      API name: allow_auto_create

    • cause

      public final PutIndexTemplateRequest.Builder cause(@Nullable String value)
      User defined reason for creating/updating the index template

      API name: cause

    • composedOf

      public final PutIndexTemplateRequest.Builder composedOf(List<String> list)
      An ordered list of component template names. Component templates are merged in the order specified, meaning that the last component template specified has the highest precedence.

      API name: composed_of

      Adds all elements of list to composedOf.

    • composedOf

      public final PutIndexTemplateRequest.Builder composedOf(String value, String... values)
      An ordered list of component template names. Component templates are merged in the order specified, meaning that the last component template specified has the highest precedence.

      API name: composed_of

      Adds one or more values to composedOf.

    • create

      public final PutIndexTemplateRequest.Builder create(@Nullable Boolean value)
      If true, this request cannot replace or update existing index templates.

      API name: create

    • dataStream

      public final PutIndexTemplateRequest.Builder dataStream(@Nullable DataStreamVisibility value)
      If this object is included, the template is used to create data streams and their backing indices. Supports an empty object. Data streams require a matching index template with a data_stream object.

      API name: data_stream

    • dataStream

      If this object is included, the template is used to create data streams and their backing indices. Supports an empty object. Data streams require a matching index template with a data_stream object.

      API name: data_stream

    • deprecated

      public final PutIndexTemplateRequest.Builder deprecated(@Nullable Boolean value)
      Marks this index template as deprecated. When creating or updating a non-deprecated index template that uses deprecated components, Elasticsearch will emit a deprecation warning.

      API name: deprecated

    • ignoreMissingComponentTemplates

      public final PutIndexTemplateRequest.Builder ignoreMissingComponentTemplates(List<String> list)
      The configuration option ignore_missing_component_templates can be used when an index template references a component template that might not exist

      API name: ignore_missing_component_templates

      Adds all elements of list to ignoreMissingComponentTemplates.

    • ignoreMissingComponentTemplates

      public final PutIndexTemplateRequest.Builder ignoreMissingComponentTemplates(String value, String... values)
      The configuration option ignore_missing_component_templates can be used when an index template references a component template that might not exist

      API name: ignore_missing_component_templates

      Adds one or more values to ignoreMissingComponentTemplates.

    • indexPatterns

      public final PutIndexTemplateRequest.Builder indexPatterns(List<String> list)
      Name of the index template to create.

      API name: index_patterns

      Adds all elements of list to indexPatterns.

    • indexPatterns

      public final PutIndexTemplateRequest.Builder indexPatterns(String value, String... values)
      Name of the index template to create.

      API name: index_patterns

      Adds one or more values to indexPatterns.

    • masterTimeout

      public final PutIndexTemplateRequest.Builder masterTimeout(@Nullable Time value)
      Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

      API name: master_timeout

    • masterTimeout

      Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

      API name: master_timeout

    • name

      public final PutIndexTemplateRequest.Builder name(String value)
      Required - Index or template name

      API name: name

    • priority

      public final PutIndexTemplateRequest.Builder priority(@Nullable Long value)
      Priority to determine index template precedence when a new data stream or index is created. The index template with the highest priority is chosen. If no priority is specified the template is treated as though it is of priority 0 (lowest priority). This number is not automatically generated by Elasticsearch.

      API name: priority

    • template

      public final PutIndexTemplateRequest.Builder template(@Nullable IndexTemplateMapping value)
      Template to be applied. It may optionally include an aliases, mappings, or settings configuration.

      API name: template

    • template

      Template to be applied. It may optionally include an aliases, mappings, or settings configuration.

      API name: template

    • version

      public final PutIndexTemplateRequest.Builder version(@Nullable Long value)
      Version number used to manage index templates externally. This number is not automatically generated by Elasticsearch. External systems can use these version numbers to simplify template management. To unset a version, replace the template without specifying one.

      API name: version

    • self

      Specified by:
      self in class RequestBase.AbstractBuilder<PutIndexTemplateRequest.Builder>
    • build

      public PutIndexTemplateRequest build()
      Specified by:
      build in interface ObjectBuilder<PutIndexTemplateRequest>
      Throws:
      NullPointerException - if some of the required fields are null.