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.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DataStreamLifecycle.Template
static final ConstructingObjectParser
<Template, Void> Fields inherited from interface org.elasticsearch.cluster.SimpleDiffable
EMPTY
Fields 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.Builder
builder()
static Template.Builder
boolean
int
hashCode()
mappings()
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.void
writeTo
(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.cluster.SimpleDiffable
diff
Methods 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
-
settings
-
mappings
-
aliases
-
lifecycle
-
dataStreamOptions
-
resettableDataStreamOptions
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
hashCode
public int hashCode() -
equals
-
toString
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContent
in 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 displaynull
when the value is to be reset.- Throws:
IOException
-
builder
-
builder
-