java.lang.Object
org.elasticsearch.cluster.metadata.Template
- All Implemented Interfaces:
Diffable<Template>,SimpleDiffable<Template>,Writeable,ToXContent,ToXContentObject
A template consists of optional settings, mappings, alias or lifecycle configuration for an index or data stream, however,
it is entirely independent of an index or data stream. It's a building block forming part of a regular index
template and a
ComponentTemplate.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.elasticsearch.cluster.SimpleDiffable
SimpleDiffable.CompleteDiff<T extends Diffable<T>>Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DataStreamLifecycle.Templatestatic final ConstructingObjectParser<Template, Void> Fields inherited from interface org.elasticsearch.cluster.SimpleDiffable
EMPTYFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionTemplate(StreamInput in) Template(Settings settings, CompressedXContent mappings, Map<String, AliasMetadata> aliases) Template(Settings settings, CompressedXContent mappings, Map<String, AliasMetadata> aliases, DataStreamLifecycle.Template lifecycle, DataStreamOptions.Template dataStreamOptions) Template(Settings settings, CompressedXContent mappings, Map<String, AliasMetadata> aliases, DataStreamLifecycle.Template lifecycle, ResettableValue<DataStreamOptions.Template> dataStreamOptions) -
Method Summary
Modifier and TypeMethodDescriptionaliases()static Template.Builderbuilder()static Template.BuilderbooleaninthashCode()mappings()static CompressedXContentparseMappings(XContentParser parser) settings()toString()toXContent(XContentBuilder builder, ToXContent.Params params) toXContent(XContentBuilder builder, ToXContent.Params params, RolloverConfiguration rolloverConfiguration) Converts the template to XContent and passes the RolloverConditions, when provided, to the lifecycle.voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.cluster.SimpleDiffable
diffMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
PARSER
-
DISABLED_LIFECYCLE
-
-
Constructor Details
-
Template
public Template(@Nullable Settings settings, @Nullable CompressedXContent mappings, @Nullable Map<String, AliasMetadata> aliases, @Nullable DataStreamLifecycle.Template lifecycle, ResettableValue<DataStreamOptions.Template> dataStreamOptions) -
Template
public Template(@Nullable Settings settings, @Nullable CompressedXContent mappings, @Nullable Map<String, AliasMetadata> aliases, @Nullable DataStreamLifecycle.Template lifecycle, @Nullable DataStreamOptions.Template dataStreamOptions) -
Template
public Template(@Nullable Settings settings, @Nullable CompressedXContent mappings, @Nullable Map<String, AliasMetadata> aliases) -
Template
- Throws:
IOException
-
-
Method Details
-
parseMappings
- Throws:
IOException
-
settings
-
mappings
-
aliases
-
lifecycle
-
dataStreamOptions
-
resettableDataStreamOptions
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
hashCode
public int hashCode() -
equals
-
toString
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params, @Nullable RolloverConfiguration rolloverConfiguration) throws IOException Converts the template to XContent and passes the RolloverConditions, when provided, to the lifecycle. Depending on the set byResettableValue.hideResetValues(Params)it may or may not displaynullwhen the value is to be reset.- Throws:
IOException
-
builder
-
builder
-