diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/RuntimeField.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/RuntimeField.java index 0f3a7b1518..59508b445f 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/RuntimeField.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/RuntimeField.java @@ -81,6 +81,9 @@ public class RuntimeField implements DynamicTemplateVariant, JsonpSerializable { @Nullable private final Script script; + @Nullable + private final OnScriptError onScriptError; + private final RuntimeFieldType type; // --------------------------------------------------------------------------------------------- @@ -94,6 +97,7 @@ private RuntimeField(Builder builder) { this.targetField = builder.targetField; this.targetIndex = builder.targetIndex; this.script = builder.script; + this.onScriptError = builder.onScriptError; this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); } @@ -178,6 +182,14 @@ public final Script script() { return this.script; } + /** + * API name: {@code on_script_error} + */ + @Nullable + public final OnScriptError onScriptError() { + return this.onScriptError; + } + /** * Required - Field type, which can be: boolean, * composite, date, double, @@ -247,6 +259,10 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { this.script.serialize(generator, mapper); } + if (this.onScriptError != null) { + generator.writeKey("on_script_error"); + this.onScriptError.serialize(generator, mapper); + } generator.writeKey("type"); this.type.serialize(generator, mapper); @@ -285,6 +301,9 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private Script script; + @Nullable + private OnScriptError onScriptError; + private RuntimeFieldType type; public Builder() { @@ -297,6 +316,7 @@ private Builder(RuntimeField instance) { this.targetField = instance.targetField; this.targetIndex = instance.targetIndex; this.script = instance.script; + this.onScriptError = instance.onScriptError; this.type = instance.type; } @@ -431,6 +451,14 @@ public final Builder script(Function> fn) return this.script(fn.apply(new Script.Builder()).build()); } + /** + * API name: {@code on_script_error} + */ + public final Builder onScriptError(@Nullable OnScriptError value) { + this.onScriptError = value; + return this; + } + /** * Required - Field type, which can be: boolean, * composite, date, double, @@ -486,6 +514,7 @@ protected static void setupRuntimeFieldDeserializer(ObjectDeserializer 1) { hash = hash.substring(1); } - window.location = "https://github.com/elastic/elasticsearch-specification/tree/b5550652a718400bf19023a2a2a3166fec5c1802/specification/" + (paths[hash] || ""); + window.location = "https://github.com/elastic/elasticsearch-specification/tree/b30c4748d4e9a305eb5bf0cc352d8188c0824f2e/specification/" + (paths[hash] || ""); - Please see the Elasticsearch API specification. + Please see the Elasticsearch API specification. diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettings.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettings.java index cfa48e30d0..cc0b19929e 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettings.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettings.java @@ -167,6 +167,9 @@ public class IndexSettings implements JsonpSerializable { @Nullable private final IndexRouting routing; + @Nullable + private final IndexSettingsUnassigned unassigned; + @Nullable private final Time gcDeletes; @@ -279,6 +282,7 @@ private IndexSettings(Builder builder) { this.maxTermsCount = builder.maxTermsCount; this.maxRegexLength = builder.maxRegexLength; this.routing = builder.routing; + this.unassigned = builder.unassigned; this.gcDeletes = builder.gcDeletes; this.defaultPipeline = builder.defaultPipeline; this.finalPipeline = builder.finalPipeline; @@ -572,6 +576,14 @@ public final IndexRouting routing() { return this.routing; } + /** + * API name: {@code unassigned} + */ + @Nullable + public final IndexSettingsUnassigned unassigned() { + return this.unassigned; + } + /** * API name: {@code gc_deletes} */ @@ -962,6 +974,11 @@ else if (isExpNullAutoExpandReplicas) { generator.writeKey("routing"); this.routing.serialize(generator, mapper); + } + if (this.unassigned != null) { + generator.writeKey("unassigned"); + this.unassigned.serialize(generator, mapper); + } if (this.gcDeletes != null) { generator.writeKey("gc_deletes"); @@ -1232,6 +1249,9 @@ public final Builder otherSettings(String key, JsonData value) { @Nullable private IndexRouting routing; + @Nullable + private IndexSettingsUnassigned unassigned; + @Nullable private Time gcDeletes; @@ -1341,6 +1361,7 @@ private Builder(IndexSettings instance) { this.maxTermsCount = instance.maxTermsCount; this.maxRegexLength = instance.maxRegexLength; this.routing = instance.routing; + this.unassigned = instance.unassigned; this.gcDeletes = instance.gcDeletes; this.defaultPipeline = instance.defaultPipeline; this.finalPipeline = instance.finalPipeline; @@ -1717,6 +1738,22 @@ public final Builder routing(Function> fn) { + return this.unassigned(fn.apply(new IndexSettingsUnassigned.Builder()).build()); + } + /** * API name: {@code gc_deletes} */ @@ -2124,6 +2161,7 @@ protected static void setupIndexSettingsDeserializer(ObjectDeserializerAPI + * specification + */ +@JsonpDeserializable +public class IndexSettingsUnassigned implements JsonpSerializable { + @Nullable + private final IndexSettingsUnassignedNodeLeft nodeLeft; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsUnassigned(Builder builder) { + + this.nodeLeft = builder.nodeLeft; + + } + + public static IndexSettingsUnassigned of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code node_left} + */ + @Nullable + public final IndexSettingsUnassignedNodeLeft nodeLeft() { + return this.nodeLeft; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + if (this.nodeLeft != null) { + generator.writeKey("node_left"); + this.nodeLeft.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexSettingsUnassigned}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private IndexSettingsUnassignedNodeLeft nodeLeft; + + public Builder() { + } + private Builder(IndexSettingsUnassigned instance) { + this.nodeLeft = instance.nodeLeft; + + } + /** + * API name: {@code node_left} + */ + public final Builder nodeLeft(@Nullable IndexSettingsUnassignedNodeLeft value) { + this.nodeLeft = value; + return this; + } + + /** + * API name: {@code node_left} + */ + public final Builder nodeLeft( + Function> fn) { + return this.nodeLeft(fn.apply(new IndexSettingsUnassignedNodeLeft.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexSettingsUnassigned}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexSettingsUnassigned build() { + _checkSingleUse(); + + return new IndexSettingsUnassigned(this); + } + } + + /** + * @return New {@link Builder} initialized with field values of this instance + */ + public Builder rebuild() { + return new Builder(this); + } + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsUnassigned} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, IndexSettingsUnassigned::setupIndexSettingsUnassignedDeserializer); + + protected static void setupIndexSettingsUnassignedDeserializer( + ObjectDeserializer op) { + + op.add(Builder::nodeLeft, IndexSettingsUnassignedNodeLeft._DESERIALIZER, "node_left"); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsUnassignedNodeLeft.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsUnassignedNodeLeft.java new file mode 100644 index 0000000000..21de1ea8a1 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsUnassignedNodeLeft.java @@ -0,0 +1,191 @@ +/* + * 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.elasticsearch._types.Time; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// 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. +// +//---------------------------------------------------------------- + +// typedef: indices._types.IndexSettingsUnassignedNodeLeft + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexSettingsUnassignedNodeLeft implements JsonpSerializable { + @Nullable + private final Time delayedTimeout; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsUnassignedNodeLeft(Builder builder) { + + this.delayedTimeout = builder.delayedTimeout; + + } + + public static IndexSettingsUnassignedNodeLeft of( + Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The amount of time to wait for a node that has left before assuming its + * shards are permanently missing and starting to allocate replacement replicas. + *

+ * API name: {@code delayed_timeout} + */ + @Nullable + public final Time delayedTimeout() { + return this.delayedTimeout; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + if (this.delayedTimeout != null) { + generator.writeKey("delayed_timeout"); + this.delayedTimeout.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexSettingsUnassignedNodeLeft}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private Time delayedTimeout; + + public Builder() { + } + private Builder(IndexSettingsUnassignedNodeLeft instance) { + this.delayedTimeout = instance.delayedTimeout; + + } + /** + * The amount of time to wait for a node that has left before assuming its + * shards are permanently missing and starting to allocate replacement replicas. + *

+ * API name: {@code delayed_timeout} + */ + public final Builder delayedTimeout(@Nullable Time value) { + this.delayedTimeout = value; + return this; + } + + /** + * The amount of time to wait for a node that has left before assuming its + * shards are permanently missing and starting to allocate replacement replicas. + *

+ * API name: {@code delayed_timeout} + */ + public final Builder delayedTimeout(Function> fn) { + return this.delayedTimeout(fn.apply(new Time.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexSettingsUnassignedNodeLeft}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexSettingsUnassignedNodeLeft build() { + _checkSingleUse(); + + return new IndexSettingsUnassignedNodeLeft(this); + } + } + + /** + * @return New {@link Builder} initialized with field values of this instance + */ + public Builder rebuild() { + return new Builder(this); + } + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsUnassignedNodeLeft} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, IndexSettingsUnassignedNodeLeft::setupIndexSettingsUnassignedNodeLeftDeserializer); + + protected static void setupIndexSettingsUnassignedNodeLeftDeserializer( + ObjectDeserializer op) { + + op.add(Builder::delayedTimeout, Time._DESERIALIZER, "delayed_timeout"); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/CustomTaskSettings.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/CustomTaskSettings.java index f41a184ed2..3e15bb1f0d 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/CustomTaskSettings.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/CustomTaskSettings.java @@ -87,6 +87,14 @@ public static CustomTaskSettings of(Function * + * + *

+ *

+ * warn The task_settings.parameters cannot contain the same keys + * as secret_parameters. If they do, an error will be returned. + * This applies to PUT requests and POST requests. + *

+ *
*

* API name: {@code parameters} */ @@ -150,6 +158,14 @@ private Builder(CustomTaskSettings instance) { * } * * + * + *

+ *

+ * warn The task_settings.parameters cannot contain the same keys + * as secret_parameters. If they do, an error will be returned. + * This applies to PUT requests and POST requests. + *

+ *
*

* API name: {@code parameters} */ diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/nodes/Allocations.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/nodes/Allocations.java new file mode 100644 index 0000000000..43c9a863ff --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/nodes/Allocations.java @@ -0,0 +1,313 @@ +/* + * 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.nodes; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Double; +import java.lang.Integer; +import java.lang.Long; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// 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. +// +//---------------------------------------------------------------- + +// typedef: nodes._types.Allocations + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class Allocations implements JsonpSerializable { + @Nullable + private final Integer shards; + + @Nullable + private final Integer undesiredShards; + + @Nullable + private final Double forecastedIngestLoad; + + @Nullable + private final Long forecastedDiskUsageInBytes; + + @Nullable + private final Long currentDiskUsageInBytes; + + // --------------------------------------------------------------------------------------------- + + private Allocations(Builder builder) { + + this.shards = builder.shards; + this.undesiredShards = builder.undesiredShards; + this.forecastedIngestLoad = builder.forecastedIngestLoad; + this.forecastedDiskUsageInBytes = builder.forecastedDiskUsageInBytes; + this.currentDiskUsageInBytes = builder.currentDiskUsageInBytes; + + } + + public static Allocations of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Number of shards allocated to the node. + *

+ * API name: {@code shards} + */ + @Nullable + public final Integer shards() { + return this.shards; + } + + /** + * Number of shards allocated to the node that are currently undesired. + *

+ * API name: {@code undesired_shards} + */ + @Nullable + public final Integer undesiredShards() { + return this.undesiredShards; + } + + /** + * Forecasted ingest load for the node. + *

+ * API name: {@code forecasted_ingest_load} + */ + @Nullable + public final Double forecastedIngestLoad() { + return this.forecastedIngestLoad; + } + + /** + * Forecasted disk usage, in bytes, for the node. + *

+ * API name: {@code forecasted_disk_usage_in_bytes} + */ + @Nullable + public final Long forecastedDiskUsageInBytes() { + return this.forecastedDiskUsageInBytes; + } + + /** + * Current disk usage, in bytes, for the node. + *

+ * API name: {@code current_disk_usage_in_bytes} + */ + @Nullable + public final Long currentDiskUsageInBytes() { + return this.currentDiskUsageInBytes; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + if (this.shards != null) { + generator.writeKey("shards"); + generator.write(this.shards); + + } + if (this.undesiredShards != null) { + generator.writeKey("undesired_shards"); + generator.write(this.undesiredShards); + + } + if (this.forecastedIngestLoad != null) { + generator.writeKey("forecasted_ingest_load"); + generator.write(this.forecastedIngestLoad); + + } + if (this.forecastedDiskUsageInBytes != null) { + generator.writeKey("forecasted_disk_usage_in_bytes"); + generator.write(this.forecastedDiskUsageInBytes); + + } + if (this.currentDiskUsageInBytes != null) { + generator.writeKey("current_disk_usage_in_bytes"); + generator.write(this.currentDiskUsageInBytes); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link Allocations}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private Integer shards; + + @Nullable + private Integer undesiredShards; + + @Nullable + private Double forecastedIngestLoad; + + @Nullable + private Long forecastedDiskUsageInBytes; + + @Nullable + private Long currentDiskUsageInBytes; + + public Builder() { + } + private Builder(Allocations instance) { + this.shards = instance.shards; + this.undesiredShards = instance.undesiredShards; + this.forecastedIngestLoad = instance.forecastedIngestLoad; + this.forecastedDiskUsageInBytes = instance.forecastedDiskUsageInBytes; + this.currentDiskUsageInBytes = instance.currentDiskUsageInBytes; + + } + /** + * Number of shards allocated to the node. + *

+ * API name: {@code shards} + */ + public final Builder shards(@Nullable Integer value) { + this.shards = value; + return this; + } + + /** + * Number of shards allocated to the node that are currently undesired. + *

+ * API name: {@code undesired_shards} + */ + public final Builder undesiredShards(@Nullable Integer value) { + this.undesiredShards = value; + return this; + } + + /** + * Forecasted ingest load for the node. + *

+ * API name: {@code forecasted_ingest_load} + */ + public final Builder forecastedIngestLoad(@Nullable Double value) { + this.forecastedIngestLoad = value; + return this; + } + + /** + * Forecasted disk usage, in bytes, for the node. + *

+ * API name: {@code forecasted_disk_usage_in_bytes} + */ + public final Builder forecastedDiskUsageInBytes(@Nullable Long value) { + this.forecastedDiskUsageInBytes = value; + return this; + } + + /** + * Current disk usage, in bytes, for the node. + *

+ * API name: {@code current_disk_usage_in_bytes} + */ + public final Builder currentDiskUsageInBytes(@Nullable Long value) { + this.currentDiskUsageInBytes = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link Allocations}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public Allocations build() { + _checkSingleUse(); + + return new Allocations(this); + } + } + + /** + * @return New {@link Builder} initialized with field values of this instance + */ + public Builder rebuild() { + return new Builder(this); + } + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link Allocations} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + Allocations::setupAllocationsDeserializer); + + protected static void setupAllocationsDeserializer(ObjectDeserializer op) { + + op.add(Builder::shards, JsonpDeserializer.integerDeserializer(), "shards"); + op.add(Builder::undesiredShards, JsonpDeserializer.integerDeserializer(), "undesired_shards"); + op.add(Builder::forecastedIngestLoad, JsonpDeserializer.doubleDeserializer(), "forecasted_ingest_load"); + op.add(Builder::forecastedDiskUsageInBytes, JsonpDeserializer.longDeserializer(), + "forecasted_disk_usage_in_bytes"); + op.add(Builder::currentDiskUsageInBytes, JsonpDeserializer.longDeserializer(), "current_disk_usage_in_bytes"); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/nodes/Stats.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/nodes/Stats.java index 59e6006b68..1f01f0a8b8 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/nodes/Stats.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/nodes/Stats.java @@ -66,6 +66,9 @@ public class Stats implements JsonpSerializable { private final Map adaptiveSelection; + @Nullable + private final Allocations allocations; + private final Map breakers; @Nullable @@ -128,6 +131,7 @@ public class Stats implements JsonpSerializable { private Stats(Builder builder) { this.adaptiveSelection = ApiTypeHelper.unmodifiable(builder.adaptiveSelection); + this.allocations = builder.allocations; this.breakers = ApiTypeHelper.unmodifiable(builder.breakers); this.fs = builder.fs; this.host = builder.host; @@ -165,6 +169,16 @@ public final Map adaptiveSelection() { return this.adaptiveSelection; } + /** + * Statistics about shard allocations on the node. + *

+ * API name: {@code allocations} + */ + @Nullable + public final Allocations allocations() { + return this.allocations; + } + /** * Statistics about the field data circuit breaker. *

@@ -390,6 +404,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } generator.writeEnd(); + } + if (this.allocations != null) { + generator.writeKey("allocations"); + this.allocations.serialize(generator, mapper); + } if (ApiTypeHelper.isDefined(this.breakers)) { generator.writeKey("breakers"); @@ -554,6 +573,9 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private Map adaptiveSelection; + @Nullable + private Allocations allocations; + @Nullable private Map breakers; @@ -621,6 +643,7 @@ public Builder() { } private Builder(Stats instance) { this.adaptiveSelection = instance.adaptiveSelection; + this.allocations = instance.allocations; this.breakers = instance.breakers; this.fs = instance.fs; this.host = instance.host; @@ -680,6 +703,25 @@ public final Builder adaptiveSelection(String key, return adaptiveSelection(key, fn.apply(new AdaptiveSelection.Builder()).build()); } + /** + * Statistics about shard allocations on the node. + *

+ * API name: {@code allocations} + */ + public final Builder allocations(@Nullable Allocations value) { + this.allocations = value; + return this; + } + + /** + * Statistics about shard allocations on the node. + *

+ * API name: {@code allocations} + */ + public final Builder allocations(Function> fn) { + return this.allocations(fn.apply(new Allocations.Builder()).build()); + } + /** * Statistics about the field data circuit breaker. *

@@ -1133,6 +1175,7 @@ protected static void setupStatsDeserializer(ObjectDeserializer o op.add(Builder::adaptiveSelection, JsonpDeserializer.stringMapDeserializer(AdaptiveSelection._DESERIALIZER), "adaptive_selection"); + op.add(Builder::allocations, Allocations._DESERIALIZER, "allocations"); op.add(Builder::breakers, JsonpDeserializer.stringMapDeserializer(Breaker._DESERIALIZER), "breakers"); op.add(Builder::fs, FileSystem._DESERIALIZER, "fs"); op.add(Builder::host, JsonpDeserializer.stringDeserializer(), "host"); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/GetTransformStatsRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/GetTransformStatsRequest.java index a7e340528c..23afa683f0 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/GetTransformStatsRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/GetTransformStatsRequest.java @@ -73,6 +73,9 @@ public class GetTransformStatsRequest extends RequestBase { @Nullable private final Boolean allowNoMatch; + @Nullable + private final Boolean basic; + @Nullable private final Long from; @@ -89,6 +92,7 @@ public class GetTransformStatsRequest extends RequestBase { private GetTransformStatsRequest(Builder builder) { this.allowNoMatch = builder.allowNoMatch; + this.basic = builder.basic; this.from = builder.from; this.size = builder.size; this.timeout = builder.timeout; @@ -119,6 +123,22 @@ public final Boolean allowNoMatch() { return this.allowNoMatch; } + /** + * If true, the response includes id, state, + * node, stats, health, and basic + * checkpointing information (the last and next checkpoint numbers, + * and the next checkpoint's position and progress). + * Skips statistics that require heavy computations to calculate: + * operations_behind, changes_last_detected_at, + * last_search_time, and the checkpoint timestamps. + *

+ * API name: {@code basic} + */ + @Nullable + public final Boolean basic() { + return this.basic; + } + /** * Skips the specified number of transforms. *

@@ -174,6 +194,9 @@ public static class Builder extends RequestBase.AbstractBuilder @Nullable private Boolean allowNoMatch; + @Nullable + private Boolean basic; + @Nullable private Long from; @@ -189,6 +212,7 @@ public Builder() { } private Builder(GetTransformStatsRequest instance) { this.allowNoMatch = instance.allowNoMatch; + this.basic = instance.basic; this.from = instance.from; this.size = instance.size; this.timeout = instance.timeout; @@ -214,6 +238,22 @@ public final Builder allowNoMatch(@Nullable Boolean value) { return this; } + /** + * If true, the response includes id, state, + * node, stats, health, and basic + * checkpointing information (the last and next checkpoint numbers, + * and the next checkpoint's position and progress). + * Skips statistics that require heavy computations to calculate: + * operations_behind, changes_last_detected_at, + * last_search_time, and the checkpoint timestamps. + *

+ * API name: {@code basic} + */ + public final Builder basic(@Nullable Boolean value) { + this.basic = value; + return this; + } + /** * Skips the specified number of transforms. *

@@ -369,6 +409,9 @@ public Builder rebuild() { if (request.from != null) { params.put("from", String.valueOf(request.from)); } + if (request.basic != null) { + params.put("basic", String.valueOf(request.basic)); + } if (request.allowNoMatch != null) { params.put("allow_no_match", String.valueOf(request.allowNoMatch)); }