Package org.opensearch.cluster.metadata
Class IndexTemplateMetadata.Builder
java.lang.Object
org.opensearch.cluster.metadata.IndexTemplateMetadata.Builder
- Enclosing class:
IndexTemplateMetadata
Builder of index template metadata.
- Opensearch.api:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
static IndexTemplateMetadata
fromXContent
(org.opensearch.core.xcontent.XContentParser parser, String templateName) order
(int order) putAlias
(AliasMetadata aliasMetadata) putAlias
(AliasMetadata.Builder aliasMetadata) putMapping
(String mappingType, String mappingSource) putMapping
(String mappingType, CompressedXContent mappingSource) settings
(Settings.Builder settings) static void
toXContent
(IndexTemplateMetadata indexTemplateMetadata, org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params) Serializes the template to xContent, making sure not to nest mappings under the type name.static void
toXContentWithTypes
(IndexTemplateMetadata indexTemplateMetadata, org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params) Serializes the template to xContent, using the legacy format where the mappings are nested under the type name.
-
Constructor Details
-
Builder
-
Builder
-
-
Method Details
-
order
-
version
-
patterns
-
settings
-
settings
-
putMapping
public IndexTemplateMetadata.Builder putMapping(String mappingType, CompressedXContent mappingSource) -
putMapping
public IndexTemplateMetadata.Builder putMapping(String mappingType, String mappingSource) throws IOException - Throws:
IOException
-
putAlias
-
putAlias
-
build
-
toXContentWithTypes
public static void toXContentWithTypes(IndexTemplateMetadata indexTemplateMetadata, org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params) throws IOException Serializes the template to xContent, using the legacy format where the mappings are nested under the type name.This method is used for serializing templates before storing them in the cluster metadata, and also in the REST layer when returning a deprecated typed response.
- Throws:
IOException
-
toXContent
public static void toXContent(IndexTemplateMetadata indexTemplateMetadata, org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params) throws IOException Serializes the template to xContent, making sure not to nest mappings under the type name.Note that this method should currently only be used for creating REST responses, and not when directly updating stored templates. Index templates are still stored in the old, typed format, and have yet to be migrated to be typeless.
- Throws:
IOException
-
fromXContent
public static IndexTemplateMetadata fromXContent(org.opensearch.core.xcontent.XContentParser parser, String templateName) throws IOException - Throws:
IOException
-