diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cluster/HealthRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cluster/HealthRequest.java index 0c88e21d1..08bc59796 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cluster/HealthRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cluster/HealthRequest.java @@ -148,8 +148,9 @@ public final List expandWildcards() { /** * Comma-separated list of data streams, indices, and index aliases used to - * limit the request. Wildcard expressions (*) are supported. To target all data - * streams and indices in a cluster, omit this parameter or use _all or *. + * limit the request. Wildcard expressions (*) are supported. To + * target all data streams and indices in a cluster, omit this parameter or use + * _all or *. *

* API name: {@code index} */ @@ -342,8 +343,9 @@ public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... val /** * Comma-separated list of data streams, indices, and index aliases used to - * limit the request. Wildcard expressions (*) are supported. To target all data - * streams and indices in a cluster, omit this parameter or use _all or *. + * limit the request. Wildcard expressions (*) are supported. To + * target all data streams and indices in a cluster, omit this parameter or use + * _all or *. *

* API name: {@code index} *

@@ -356,8 +358,9 @@ public final Builder index(List list) { /** * Comma-separated list of data streams, indices, and index aliases used to - * limit the request. Wildcard expressions (*) are supported. To target all data - * streams and indices in a cluster, omit this parameter or use _all or *. + * limit the request. Wildcard expressions (*) are supported. To + * target all data streams and indices in a cluster, omit this parameter or use + * _all or *. *

* API name: {@code index} *

diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/MsearchRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/MsearchRequest.java index 62f51f89e..a73479dbd 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/MsearchRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/MsearchRequest.java @@ -578,9 +578,6 @@ public MsearchRequest build() { request -> { Map params = new HashMap<>(); params.put("typed_keys", "true"); - if (request.routing != null) { - params.put("routing", request.routing); - } if (request.preFilterShardSize != null) { params.put("pre_filter_shard_size", String.valueOf(request.preFilterShardSize)); } @@ -591,6 +588,15 @@ public MsearchRequest build() { params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); } + if (request.searchType != null) { + params.put("search_type", request.searchType.jsonValue()); + } + if (request.ccsMinimizeRoundtrips != null) { + params.put("ccs_minimize_roundtrips", String.valueOf(request.ccsMinimizeRoundtrips)); + } + if (request.routing != null) { + params.put("routing", request.routing); + } if (request.ignoreUnavailable != null) { params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); } @@ -603,12 +609,6 @@ public MsearchRequest build() { if (request.maxConcurrentSearches != null) { params.put("max_concurrent_searches", String.valueOf(request.maxConcurrentSearches)); } - if (request.searchType != null) { - params.put("search_type", request.searchType.jsonValue()); - } - if (request.ccsMinimizeRoundtrips != null) { - params.put("ccs_minimize_roundtrips", String.valueOf(request.ccsMinimizeRoundtrips)); - } return params; }, SimpleEndpoint.emptyMap(), true, MsearchResponse._DESERIALIZER); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html b/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html index 54d69bf26..c19ab1a35 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html @@ -100,7 +100,7 @@ '_global.msearch.MultiSearchResult': '_global/msearch/types.ts#L203-L206', '_global.msearch.MultisearchBody': '_global/msearch/types.ts#L70-L201', '_global.msearch.MultisearchHeader': '_global/msearch/types.ts#L52-L67', -'_global.msearch.Request': '_global/msearch/MultiSearchRequest.ts#L25-L96', +'_global.msearch.Request': '_global/msearch/MultiSearchRequest.ts#L25-L106', '_global.msearch.Response': '_global/msearch/MultiSearchResponse.ts#L25-L27', '_global.msearch.ResponseItem': '_global/msearch/types.ts#L208-L211', '_global.msearch_template.Request': '_global/msearch_template/MultiSearchTemplateRequest.ts#L25-L70', @@ -149,7 +149,7 @@ '_global.scripts_painless_execute.Response': '_global/scripts_painless_execute/ExecutePainlessScriptResponse.ts#L20-L24', '_global.scroll.Request': '_global/scroll/ScrollRequest.ts#L24-L59', '_global.scroll.Response': '_global/scroll/ScrollResponse.ts#L22-L24', -'_global.search.Request': '_global/search/SearchRequest.ts#L54-L520', +'_global.search.Request': '_global/search/SearchRequest.ts#L54-L530', '_global.search.Response': '_global/search/SearchResponse.ts#L34-L36', '_global.search.ResponseBody': '_global/search/SearchResponse.ts#L38-L54', '_global.search._types.AggregationBreakdown': '_global/search/_types/profile.ts#L23-L36', @@ -1302,20 +1302,20 @@ 'graph._types.VertexInclude': 'graph/_types/Vertex.ts#L61-L64', 'graph.explore.Request': 'graph/explore/GraphExploreRequest.ts#L28-L72', 'graph.explore.Response': 'graph/explore/GraphExploreResponse.ts#L25-L33', -'ilm._types.Actions': 'ilm/_types/Phase.ts#L42-L91', -'ilm._types.AllocateAction': 'ilm/_types/Phase.ts#L131-L137', -'ilm._types.DeleteAction': 'ilm/_types/Phase.ts#L147-L149', -'ilm._types.DownsampleAction': 'ilm/_types/Phase.ts#L110-L113', -'ilm._types.ForceMergeAction': 'ilm/_types/Phase.ts#L121-L124', -'ilm._types.MigrateAction': 'ilm/_types/Phase.ts#L139-L141', +'ilm._types.Actions': 'ilm/_types/Phase.ts#L42-L96', +'ilm._types.AllocateAction': 'ilm/_types/Phase.ts#L136-L142', +'ilm._types.DeleteAction': 'ilm/_types/Phase.ts#L152-L154', +'ilm._types.DownsampleAction': 'ilm/_types/Phase.ts#L115-L118', +'ilm._types.ForceMergeAction': 'ilm/_types/Phase.ts#L126-L129', +'ilm._types.MigrateAction': 'ilm/_types/Phase.ts#L144-L146', 'ilm._types.Phase': 'ilm/_types/Phase.ts#L26-L32', 'ilm._types.Phases': 'ilm/_types/Phase.ts#L34-L40', 'ilm._types.Policy': 'ilm/_types/Policy.ts#L23-L26', -'ilm._types.RolloverAction': 'ilm/_types/Phase.ts#L97-L108', -'ilm._types.SearchableSnapshotAction': 'ilm/_types/Phase.ts#L126-L129', -'ilm._types.SetPriorityAction': 'ilm/_types/Phase.ts#L93-L95', -'ilm._types.ShrinkAction': 'ilm/_types/Phase.ts#L115-L119', -'ilm._types.WaitForSnapshotAction': 'ilm/_types/Phase.ts#L143-L145', +'ilm._types.RolloverAction': 'ilm/_types/Phase.ts#L102-L113', +'ilm._types.SearchableSnapshotAction': 'ilm/_types/Phase.ts#L131-L134', +'ilm._types.SetPriorityAction': 'ilm/_types/Phase.ts#L98-L100', +'ilm._types.ShrinkAction': 'ilm/_types/Phase.ts#L120-L124', +'ilm._types.WaitForSnapshotAction': 'ilm/_types/Phase.ts#L148-L150', 'ilm.delete_lifecycle.Request': 'ilm/delete_lifecycle/DeleteLifecycleRequest.ts#L24-L51', 'ilm.delete_lifecycle.Response': 'ilm/delete_lifecycle/DeleteLifecycleResponse.ts#L22-L24', 'ilm.explain_lifecycle.LifecycleExplain': 'ilm/explain_lifecycle/types.ts#L59-L62', @@ -2843,10 +2843,10 @@ if (hash.length > 1) { hash = hash.substring(1); } - window.location = "https://github.com/elastic/elasticsearch-specification/tree/b0bf13170793e6e66db261a456ff726a690216d8/specification/" + (paths[hash] || ""); + window.location = "https://github.com/elastic/elasticsearch-specification/tree/19027dbdd366978ccae41842a040a636730e7c10/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/ilm/Actions.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/Actions.java index 17d18ecd0..4fc382c1d 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/Actions.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/Actions.java @@ -67,6 +67,9 @@ public class Actions implements JsonpSerializable { @Nullable private final DownsampleAction downsample; + @Nullable + private final EmptyObject freeze; + @Nullable private final ForceMergeAction forcemerge; @@ -101,6 +104,7 @@ private Actions(Builder builder) { this.allocate = builder.allocate; this.delete = builder.delete; this.downsample = builder.downsample; + this.freeze = builder.freeze; this.forcemerge = builder.forcemerge; this.migrate = builder.migrate; this.readonly = builder.readonly; @@ -147,6 +151,19 @@ public final DownsampleAction downsample() { return this.downsample; } + /** + * The freeze action is a noop in 8.x + *

+ * API name: {@code freeze} + * + * @deprecated 7.0.0 + */ + @Deprecated + @Nullable + public final EmptyObject freeze() { + return this.freeze; + } + /** * Phases allowed: hot, warm. *

@@ -262,6 +279,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("downsample"); this.downsample.serialize(generator, mapper); + } + if (this.freeze != null) { + generator.writeKey("freeze"); + this.freeze.serialize(generator, mapper); + } if (this.forcemerge != null) { generator.writeKey("forcemerge"); @@ -332,6 +354,9 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private DownsampleAction downsample; + @Nullable + private EmptyObject freeze; + @Nullable private ForceMergeAction forcemerge; @@ -416,6 +441,31 @@ public final Builder downsample(Function + * API name: {@code freeze} + * + * @deprecated 7.0.0 + */ + @Deprecated + public final Builder freeze(@Nullable EmptyObject value) { + this.freeze = value; + return this; + } + + /** + * The freeze action is a noop in 8.x + *

+ * API name: {@code freeze} + * + * @deprecated 7.0.0 + */ + @Deprecated + public final Builder freeze(Function> fn) { + return this.freeze(fn.apply(new EmptyObject.Builder()).build()); + } + /** * Phases allowed: hot, warm. *

@@ -620,6 +670,7 @@ protected static void setupActionsDeserializer(ObjectDeserializer nodes; private final int numberOfAllocations; @@ -103,7 +104,7 @@ private TrainedModelDeploymentStats(Builder builder) { this.errorCount = ApiTypeHelper.requireNonNull(builder.errorCount, this, "errorCount"); this.inferenceCount = ApiTypeHelper.requireNonNull(builder.inferenceCount, this, "inferenceCount"); this.modelId = ApiTypeHelper.requireNonNull(builder.modelId, this, "modelId"); - this.nodes = ApiTypeHelper.requireNonNull(builder.nodes, this, "nodes"); + this.nodes = ApiTypeHelper.unmodifiableRequired(builder.nodes, this, "nodes"); this.numberOfAllocations = ApiTypeHelper.requireNonNull(builder.numberOfAllocations, this, "numberOfAllocations"); this.queueCapacity = ApiTypeHelper.requireNonNull(builder.queueCapacity, this, "queueCapacity"); @@ -184,7 +185,7 @@ public final String modelId() { *

* API name: {@code nodes} */ - public final TrainedModelDeploymentNodesStats nodes() { + public final List nodes() { return this.nodes; } @@ -298,9 +299,16 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("model_id"); generator.write(this.modelId); - generator.writeKey("nodes"); - this.nodes.serialize(generator, mapper); + if (ApiTypeHelper.isDefined(this.nodes)) { + generator.writeKey("nodes"); + generator.writeStartArray(); + for (TrainedModelDeploymentNodesStats item0 : this.nodes) { + item0.serialize(generator, mapper); + } + generator.writeEnd(); + + } generator.writeKey("number_of_allocations"); generator.write(this.numberOfAllocations); @@ -353,7 +361,7 @@ public static class Builder extends WithJsonObjectBuilderBase private String modelId; - private TrainedModelDeploymentNodesStats nodes; + private List nodes; private Integer numberOfAllocations; @@ -447,9 +455,11 @@ public final Builder modelId(String value) { * node. *

* API name: {@code nodes} + *

+ * Adds all elements of list to nodes. */ - public final Builder nodes(TrainedModelDeploymentNodesStats value) { - this.nodes = value; + public final Builder nodes(List list) { + this.nodes = _listAddAll(this.nodes, list); return this; } @@ -459,10 +469,26 @@ public final Builder nodes(TrainedModelDeploymentNodesStats value) { * node. *

* API name: {@code nodes} + *

+ * Adds one or more values to nodes. + */ + public final Builder nodes(TrainedModelDeploymentNodesStats value, TrainedModelDeploymentNodesStats... values) { + this.nodes = _listAdd(this.nodes, value, values); + return this; + } + + /** + * Required - The deployment stats for each node that currently has the model + * allocated. In serverless, stats are reported for a single unnamed virtual + * node. + *

+ * API name: {@code nodes} + *

+ * Adds a value to nodes using a builder lambda. */ public final Builder nodes( Function> fn) { - return this.nodes(fn.apply(new TrainedModelDeploymentNodesStats.Builder()).build()); + return nodes(fn.apply(new TrainedModelDeploymentNodesStats.Builder()).build()); } /** @@ -587,7 +613,8 @@ protected static void setupTrainedModelDeploymentStatsDeserializer( op.add(Builder::errorCount, JsonpDeserializer.integerDeserializer(), "error_count"); op.add(Builder::inferenceCount, JsonpDeserializer.integerDeserializer(), "inference_count"); op.add(Builder::modelId, JsonpDeserializer.stringDeserializer(), "model_id"); - op.add(Builder::nodes, TrainedModelDeploymentNodesStats._DESERIALIZER, "nodes"); + op.add(Builder::nodes, JsonpDeserializer.arrayDeserializer(TrainedModelDeploymentNodesStats._DESERIALIZER), + "nodes"); op.add(Builder::numberOfAllocations, JsonpDeserializer.integerDeserializer(), "number_of_allocations"); op.add(Builder::queueCapacity, JsonpDeserializer.integerDeserializer(), "queue_capacity"); op.add(Builder::rejectedExecutionCount, JsonpDeserializer.integerDeserializer(), "rejected_execution_count"); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelInferenceStats.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelInferenceStats.java index f22ba270c..3cdbec9a9 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelInferenceStats.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelInferenceStats.java @@ -27,14 +27,13 @@ import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.DateTime; import co.elastic.clients.util.ObjectBuilder; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; 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. @@ -69,7 +68,7 @@ public class TrainedModelInferenceStats implements JsonpSerializable { private final int missingAllFieldsCount; - private final DateTime timestamp; + private final long timestamp; // --------------------------------------------------------------------------------------------- @@ -135,7 +134,7 @@ public final int missingAllFieldsCount() { *

* API name: {@code timestamp} */ - public final DateTime timestamp() { + public final long timestamp() { return this.timestamp; } @@ -163,7 +162,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write(this.missingAllFieldsCount); generator.writeKey("timestamp"); - this.timestamp.serialize(generator, mapper); + generator.write(this.timestamp); } @@ -189,7 +188,7 @@ public static class Builder extends WithJsonObjectBuilderBase private Integer missingAllFieldsCount; - private DateTime timestamp; + private Long timestamp; /** * Required - The number of times the model was loaded for inference and was not @@ -242,7 +241,7 @@ public final Builder missingAllFieldsCount(int value) { *

* API name: {@code timestamp} */ - public final Builder timestamp(DateTime value) { + public final Builder timestamp(long value) { this.timestamp = value; return this; } @@ -280,7 +279,7 @@ protected static void setupTrainedModelInferenceStatsDeserializer( op.add(Builder::failureCount, JsonpDeserializer.integerDeserializer(), "failure_count"); op.add(Builder::inferenceCount, JsonpDeserializer.integerDeserializer(), "inference_count"); op.add(Builder::missingAllFieldsCount, JsonpDeserializer.integerDeserializer(), "missing_all_fields_count"); - op.add(Builder::timestamp, DateTime._DESERIALIZER, "timestamp"); + op.add(Builder::timestamp, JsonpDeserializer.longDeserializer(), "timestamp"); }