Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1518,9 +1518,9 @@
'indices._types.DataStreamFailureStore': 'indices/_types/DataStreamFailureStore.ts#L22-L37',
'indices._types.DataStreamFailureStoreTemplate': 'indices/_types/DataStreamFailureStore.ts#L39-L54',
'indices._types.DataStreamIndex': 'indices/_types/DataStream.ts#L142-L163',
'indices._types.DataStreamLifecycle': 'indices/_types/DataStreamLifecycle.ts#L25-L45',
'indices._types.DataStreamLifecycleRolloverConditions': 'indices/_types/DataStreamLifecycle.ts#L60-L72',
'indices._types.DataStreamLifecycleWithRollover': 'indices/_types/DataStreamLifecycle.ts#L47-L58',
'indices._types.DataStreamLifecycle': 'indices/_types/DataStreamLifecycle.ts#L25-L55',
'indices._types.DataStreamLifecycleRolloverConditions': 'indices/_types/DataStreamLifecycle.ts#L77-L89',
'indices._types.DataStreamLifecycleWithRollover': 'indices/_types/DataStreamLifecycle.ts#L64-L75',
'indices._types.DataStreamOptions': 'indices/_types/DataStreamOptions.ts#L25-L34',
'indices._types.DataStreamOptionsTemplate': 'indices/_types/DataStreamOptions.ts#L36-L41',
'indices._types.DataStreamTimestampField': 'indices/_types/DataStream.ts#L135-L140',
Expand Down Expand Up @@ -1571,6 +1571,7 @@
'indices._types.NumericFielddataFormat': 'indices/_types/NumericFielddataFormat.ts#L20-L23',
'indices._types.Queries': 'indices/_types/IndexSettings.ts#L417-L419',
'indices._types.RetentionLease': 'indices/_types/IndexSettings.ts#L66-L68',
'indices._types.RetentionSource': 'indices/_types/DataStreamLifecycle.ts#L57-L62',
'indices._types.SearchIdle': 'indices/_types/IndexSettings.ts#L253-L256',
'indices._types.SegmentSortMissing': 'indices/_types/IndexSegmentSort.ts#L43-L46',
'indices._types.SegmentSortMode': 'indices/_types/IndexSegmentSort.ts#L36-L41',
Expand Down Expand Up @@ -1676,9 +1677,10 @@
'indices.get_alias.Request': 'indices/get_alias/IndicesGetAliasRequest.ts#L23-L92',
'indices.get_alias.Response': 'indices/get_alias/IndicesGetAliasResponse.ts#L28-L37',
'indices.get_alias._types.IndexAliases': 'indices/get_alias/_types/response.ts#L24-L26',
'indices.get_data_lifecycle.DataStreamWithLifecycle': 'indices/get_data_lifecycle/IndicesGetDataLifecycleResponse.ts#L27-L30',
'indices.get_data_lifecycle.DataStreamWithLifecycle': 'indices/get_data_lifecycle/IndicesGetDataLifecycleResponse.ts#L31-L34',
'indices.get_data_lifecycle.Request': 'indices/get_data_lifecycle/IndicesGetDataLifecycleRequest.ts#L24-L69',
'indices.get_data_lifecycle.Response': 'indices/get_data_lifecycle/IndicesGetDataLifecycleResponse.ts#L23-L25',
'indices.get_data_lifecycle.Response': 'indices/get_data_lifecycle/IndicesGetDataLifecycleResponse.ts#L24-L29',
'indices.get_data_lifecycle._types.GlobalRetention': 'indices/get_data_lifecycle/_types/response.ts#L22-L25',
'indices.get_data_lifecycle_stats.DataStreamStats': 'indices/get_data_lifecycle_stats/IndicesGetDataLifecycleStatsResponse.ts#L46-L59',
'indices.get_data_lifecycle_stats.Request': 'indices/get_data_lifecycle_stats/IndicesGetDataLifecycleStatsRequest.ts#L23-L41',
'indices.get_data_lifecycle_stats.Response': 'indices/get_data_lifecycle_stats/IndicesGetDataLifecycleStatsResponse.ts#L24-L44',
Expand Down Expand Up @@ -2963,7 +2965,7 @@
'shutdown.get_node.ShardMigrationStatus': 'shutdown/get_node/ShutdownGetNodeResponse.ts#L52-L54',
'shutdown.get_node.ShutdownStatus': 'shutdown/get_node/ShutdownGetNodeResponse.ts#L45-L50',
'shutdown.get_node.ShutdownType': 'shutdown/get_node/ShutdownGetNodeResponse.ts#L40-L43',
'shutdown.put_node.Request': 'shutdown/put_node/ShutdownPutNodeRequest.ts#L25-L110',
'shutdown.put_node.Request': 'shutdown/put_node/ShutdownPutNodeRequest.ts#L25-L112',
'shutdown.put_node.Response': 'shutdown/put_node/ShutdownPutNodeResponse.ts#L22-L24',
'simulate.ingest.IngestDocumentSimulation': 'simulate/ingest/SimulateIngestResponse.ts#L35-L78',
'simulate.ingest.Request': 'simulate/ingest/SimulateIngestRequest.ts#L29-L102',
Expand Down Expand Up @@ -3379,10 +3381,10 @@
if (hash.length > 1) {
hash = hash.substring(1);
}
window.location = "https://github.com/elastic/elasticsearch-specification/tree/fb6b5c55b2fdb0dd963d8902a0c7c427a2653371/specification/" + (paths[hash] || "");
window.location = "https://github.com/elastic/elasticsearch-specification/tree/a8838fac083a3243c20c519083dbe28c0dd1db87/specification/" + (paths[hash] || "");
</script>
</head>
<body>
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/fb6b5c55b2fdb0dd963d8902a0c7c427a2653371/specification/">Elasticsearch API specification</a>.
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/a8838fac083a3243c20c519083dbe28c0dd1db87/specification/">Elasticsearch API specification</a>.
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ public class DataStreamLifecycle implements JsonpSerializable {
@Nullable
private final Time dataRetention;

@Nullable
private final Time effectiveRetention;

@Nullable
private final RetentionSource retentionDeterminedBy;

private final List<DownsamplingRound> downsampling;

@Nullable
Expand All @@ -77,6 +83,8 @@ public class DataStreamLifecycle implements JsonpSerializable {
protected DataStreamLifecycle(AbstractBuilder<?> builder) {

this.dataRetention = builder.dataRetention;
this.effectiveRetention = builder.effectiveRetention;
this.retentionDeterminedBy = builder.retentionDeterminedBy;
this.downsampling = ApiTypeHelper.unmodifiable(builder.downsampling);
this.enabled = builder.enabled;

Expand All @@ -99,6 +107,26 @@ public final Time dataRetention() {
return this.dataRetention;
}

/**
* The least amount of time data should be kept by elasticsearch.
* <p>
* API name: {@code effective_retention}
*/
@Nullable
public final Time effectiveRetention() {
return this.effectiveRetention;
}

/**
* Configuration source that can influence the retention of a data stream.
* <p>
* API name: {@code retention_determined_by}
*/
@Nullable
public final RetentionSource retentionDeterminedBy() {
return this.retentionDeterminedBy;
}

/**
* The list of downsampling rounds to execute as part of this downsampling
* configuration
Expand Down Expand Up @@ -138,6 +166,15 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
this.dataRetention.serialize(generator, mapper);

}
if (this.effectiveRetention != null) {
generator.writeKey("effective_retention");
this.effectiveRetention.serialize(generator, mapper);

}
if (this.retentionDeterminedBy != null) {
generator.writeKey("retention_determined_by");
this.retentionDeterminedBy.serialize(generator, mapper);
}
if (ApiTypeHelper.isDefined(this.downsampling)) {
generator.writeKey("downsampling");
generator.writeStartArray();
Expand Down Expand Up @@ -194,6 +231,12 @@ public abstract static class AbstractBuilder<BuilderT extends AbstractBuilder<Bu
@Nullable
private Time dataRetention;

@Nullable
private Time effectiveRetention;

@Nullable
private RetentionSource retentionDeterminedBy;

@Nullable
private List<DownsamplingRound> downsampling;

Expand Down Expand Up @@ -225,6 +268,35 @@ public final BuilderT dataRetention(Function<Time.Builder, ObjectBuilder<Time>>
return this.dataRetention(fn.apply(new Time.Builder()).build());
}

/**
* The least amount of time data should be kept by elasticsearch.
* <p>
* API name: {@code effective_retention}
*/
public final BuilderT effectiveRetention(@Nullable Time value) {
this.effectiveRetention = value;
return self();
}

/**
* The least amount of time data should be kept by elasticsearch.
* <p>
* API name: {@code effective_retention}
*/
public final BuilderT effectiveRetention(Function<Time.Builder, ObjectBuilder<Time>> fn) {
return this.effectiveRetention(fn.apply(new Time.Builder()).build());
}

/**
* Configuration source that can influence the retention of a data stream.
* <p>
* API name: {@code retention_determined_by}
*/
public final BuilderT retentionDeterminedBy(@Nullable RetentionSource value) {
this.retentionDeterminedBy = value;
return self();
}

/**
* The list of downsampling rounds to execute as part of this downsampling
* configuration
Expand Down Expand Up @@ -292,6 +364,8 @@ protected static <BuilderT extends AbstractBuilder<BuilderT>> void setupDataStre
ObjectDeserializer<BuilderT> op) {

op.add(AbstractBuilder::dataRetention, Time._DESERIALIZER, "data_retention");
op.add(AbstractBuilder::effectiveRetention, Time._DESERIALIZER, "effective_retention");
op.add(AbstractBuilder::retentionDeterminedBy, RetentionSource._DESERIALIZER, "retention_determined_by");
op.add(AbstractBuilder::downsampling, JsonpDeserializer.arrayDeserializer(DownsamplingRound._DESERIALIZER),
"downsampling");
op.add(AbstractBuilder::enabled, JsonpDeserializer.booleanDeserializer(), "enabled");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package co.elastic.clients.elasticsearch.indices;

import co.elastic.clients.elasticsearch.indices.get_data_lifecycle.DataStreamWithLifecycle;
import co.elastic.clients.elasticsearch.indices.get_data_lifecycle.GlobalRetention;
import co.elastic.clients.json.JsonpDeserializable;
import co.elastic.clients.json.JsonpDeserializer;
import co.elastic.clients.json.JsonpMapper;
Expand Down Expand Up @@ -63,11 +64,14 @@
public class GetDataLifecycleResponse implements JsonpSerializable {
private final List<DataStreamWithLifecycle> dataStreams;

private final GlobalRetention globalRetention;

// ---------------------------------------------------------------------------------------------

private GetDataLifecycleResponse(Builder builder) {

this.dataStreams = ApiTypeHelper.unmodifiableRequired(builder.dataStreams, this, "dataStreams");
this.globalRetention = ApiTypeHelper.requireNonNull(builder.globalRetention, this, "globalRetention");

}

Expand All @@ -82,6 +86,13 @@ public final List<DataStreamWithLifecycle> dataStreams() {
return this.dataStreams;
}

/**
* Required - API name: {@code global_retention}
*/
public final GlobalRetention globalRetention() {
return this.globalRetention;
}

/**
* Serialize this object to JSON.
*/
Expand All @@ -103,6 +114,8 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeEnd();

}
generator.writeKey("global_retention");
this.globalRetention.serialize(generator, mapper);

}

Expand All @@ -122,6 +135,8 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
ObjectBuilder<GetDataLifecycleResponse> {
private List<DataStreamWithLifecycle> dataStreams;

private GlobalRetention globalRetention;

/**
* Required - API name: {@code data_streams}
* <p>
Expand Down Expand Up @@ -152,6 +167,21 @@ public final Builder dataStreams(
return dataStreams(fn.apply(new DataStreamWithLifecycle.Builder()).build());
}

/**
* Required - API name: {@code global_retention}
*/
public final Builder globalRetention(GlobalRetention value) {
this.globalRetention = value;
return this;
}

/**
* Required - API name: {@code global_retention}
*/
public final Builder globalRetention(Function<GlobalRetention.Builder, ObjectBuilder<GlobalRetention>> fn) {
return this.globalRetention(fn.apply(new GlobalRetention.Builder()).build());
}

@Override
protected Builder self() {
return this;
Expand Down Expand Up @@ -183,6 +213,7 @@ protected static void setupGetDataLifecycleResponseDeserializer(

op.add(Builder::dataStreams, JsonpDeserializer.arrayDeserializer(DataStreamWithLifecycle._DESERIALIZER),
"data_streams");
op.add(Builder::globalRetention, GlobalRetention._DESERIALIZER, "global_retention");

}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package co.elastic.clients.elasticsearch.indices;

import co.elastic.clients.json.JsonEnum;
import co.elastic.clients.json.JsonpDeserializable;
import co.elastic.clients.json.JsonpDeserializer;

//----------------------------------------------------------------
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
//----------------------------------------------------------------
//
// This code is generated from the Elasticsearch API specification
// at https://github.com/elastic/elasticsearch-specification
//
// Manual updates to this file will be lost when the code is
// re-generated.
//
// If you find a property that is missing or wrongly typed, please
// open an issue or a PR on the API specification repository.
//
//----------------------------------------------------------------

/**
*
* @see <a href="../doc-files/api-spec.html#indices._types.RetentionSource">API
* specification</a>
*/
@JsonpDeserializable
public enum RetentionSource implements JsonEnum {
DataStreamConfiguration("data_stream_configuration"),

DefaultGlobalRetention("default_global_retention"),

MaxGlobalRetention("max_global_retention"),

DefaultFailuresRetention("default_failures_retention"),

;

private final String jsonValue;

RetentionSource(String jsonValue) {
this.jsonValue = jsonValue;
}

public String jsonValue() {
return this.jsonValue;
}

public static final JsonEnum.Deserializer<RetentionSource> _DESERIALIZER = new JsonEnum.Deserializer<>(
RetentionSource.values());
}
Loading
Loading