diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/AliasesRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/AliasesRequest.java index 22562342d..ca6aeeee2 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/AliasesRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/AliasesRequest.java @@ -21,6 +21,7 @@ import co.elastic.clients.elasticsearch._types.ErrorResponse; import co.elastic.clients.elasticsearch._types.ExpandWildcard; +import co.elastic.clients.elasticsearch._types.Time; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -71,6 +72,9 @@ public class AliasesRequest extends CatRequestBase { private final List expandWildcards; + @Nullable + private final Time masterTimeout; + private final List name; // --------------------------------------------------------------------------------------------- @@ -78,6 +82,7 @@ public class AliasesRequest extends CatRequestBase { private AliasesRequest(Builder builder) { this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); + this.masterTimeout = builder.masterTimeout; this.name = ApiTypeHelper.unmodifiable(builder.name); } @@ -96,6 +101,16 @@ public final List expandWildcards() { return this.expandWildcards; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + /** * A comma-separated list of aliases to retrieve. Supports wildcards * (*). To retrieve all aliases, omit this parameter or use @@ -119,6 +134,9 @@ public static class Builder extends CatRequestBase.AbstractBuilder @Nullable private List expandWildcards; + @Nullable + private Time masterTimeout; + @Nullable private List name; @@ -148,6 +166,25 @@ public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... val return this; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(Function> fn) { + return this.masterTimeout(fn.apply(new Time.Builder()).build()); + } + /** * A comma-separated list of aliases to retrieve. Supports wildcards * (*). To retrieve all aliases, omit this parameter or use @@ -257,6 +294,9 @@ public AliasesRequest build() { request -> { Map params = new HashMap<>(); params.put("format", "json"); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } if (ApiTypeHelper.isDefined(request.expandWildcards)) { params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/AllocationRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/AllocationRequest.java index 208adcedb..870e98ab1 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/AllocationRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/AllocationRequest.java @@ -21,6 +21,7 @@ import co.elastic.clients.elasticsearch._types.Bytes; import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.Time; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -74,6 +75,9 @@ public class AllocationRequest extends CatRequestBase { @Nullable private final Boolean local; + @Nullable + private final Time masterTimeout; + private final List nodeId; // --------------------------------------------------------------------------------------------- @@ -82,6 +86,7 @@ private AllocationRequest(Builder builder) { this.bytes = builder.bytes; this.local = builder.local; + this.masterTimeout = builder.masterTimeout; this.nodeId = ApiTypeHelper.unmodifiable(builder.nodeId); } @@ -114,6 +119,16 @@ public final Boolean local() { return this.local; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + /** * Comma-separated list of node identifiers or names used to limit the returned * information. @@ -139,6 +154,9 @@ public static class Builder extends CatRequestBase.AbstractBuilder @Nullable private Boolean local; + @Nullable + private Time masterTimeout; + @Nullable private List nodeId; @@ -166,6 +184,25 @@ public final Builder local(@Nullable Boolean value) { return this; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(Function> fn) { + return this.masterTimeout(fn.apply(new Time.Builder()).build()); + } + /** * Comma-separated list of node identifiers or names used to limit the returned * information. @@ -274,6 +311,9 @@ public AllocationRequest build() { request -> { Map params = new HashMap<>(); params.put("format", "json"); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } if (request.bytes != null) { params.put("bytes", request.bytes.jsonValue()); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/ComponentTemplatesRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/ComponentTemplatesRequest.java index ef0891a3a..556e3a40b 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/ComponentTemplatesRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/ComponentTemplatesRequest.java @@ -20,6 +20,7 @@ package co.elastic.clients.elasticsearch.cat; import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.Time; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -70,6 +71,9 @@ public class ComponentTemplatesRequest extends CatRequestBase { @Nullable private final Boolean local; + @Nullable + private final Time masterTimeout; + @Nullable private final String name; @@ -78,6 +82,7 @@ public class ComponentTemplatesRequest extends CatRequestBase { private ComponentTemplatesRequest(Builder builder) { this.local = builder.local; + this.masterTimeout = builder.masterTimeout; this.name = builder.name; } @@ -100,6 +105,16 @@ public final Boolean local() { return this.local; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + /** * The name of the component template. Accepts wildcard expressions. If omitted, * all component templates are returned. @@ -123,6 +138,9 @@ public static class Builder extends CatRequestBase.AbstractBuilder @Nullable private Boolean local; + @Nullable + private Time masterTimeout; + @Nullable private String name; @@ -140,6 +158,25 @@ public final Builder local(@Nullable Boolean value) { return this; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(Function> fn) { + return this.masterTimeout(fn.apply(new Time.Builder()).build()); + } + /** * The name of the component template. Accepts wildcard expressions. If omitted, * all component templates are returned. @@ -232,6 +269,9 @@ public ComponentTemplatesRequest build() { request -> { Map params = new HashMap<>(); params.put("format", "json"); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } if (request.local != null) { params.put("local", String.valueOf(request.local)); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/ElasticsearchCatAsyncClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/ElasticsearchCatAsyncClient.java index 84420f15c..c10250bbb 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/ElasticsearchCatAsyncClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/ElasticsearchCatAsyncClient.java @@ -1193,9 +1193,49 @@ public CompletableFuture recovery() { * "https://www.elastic.co/guide/en/elasticsearch/reference/9.0/cat-repositories.html">Documentation * on elastic.co */ + + public CompletableFuture repositories(RepositoriesRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) RepositoriesRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Get snapshot repository information. Get a list of snapshot repositories for + * a cluster. IMPORTANT: cat APIs are only intended for human consumption using + * the command line or Kibana console. They are not intended for use by + * applications. For application consumption, use the get snapshot repository + * API. + * + * @param fn + * a function that initializes a builder to create the + * {@link RepositoriesRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture repositories( + Function> fn) { + return repositories(fn.apply(new RepositoriesRequest.Builder()).build()); + } + + /** + * Get snapshot repository information. Get a list of snapshot repositories for + * a cluster. IMPORTANT: cat APIs are only intended for human consumption using + * the command line or Kibana console. They are not intended for use by + * applications. For application consumption, use the get snapshot repository + * API. + * + * @see Documentation + * on elastic.co + */ + public CompletableFuture repositories() { - return this.transport.performRequestAsync(RepositoriesRequest._INSTANCE, RepositoriesRequest._ENDPOINT, - this.transportOptions); + return this.transport.performRequestAsync(new RepositoriesRequest.Builder().build(), + RepositoriesRequest._ENDPOINT, this.transportOptions); } // ----- Endpoint: cat.segments diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/ElasticsearchCatClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/ElasticsearchCatClient.java index dbc70f2db..05a5baa0e 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/ElasticsearchCatClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/ElasticsearchCatClient.java @@ -1202,8 +1202,49 @@ public RecoveryResponse recovery() throws IOException, ElasticsearchException { * "https://www.elastic.co/guide/en/elasticsearch/reference/9.0/cat-repositories.html">Documentation * on elastic.co */ + + public RepositoriesResponse repositories(RepositoriesRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) RepositoriesRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Get snapshot repository information. Get a list of snapshot repositories for + * a cluster. IMPORTANT: cat APIs are only intended for human consumption using + * the command line or Kibana console. They are not intended for use by + * applications. For application consumption, use the get snapshot repository + * API. + * + * @param fn + * a function that initializes a builder to create the + * {@link RepositoriesRequest} + * @see Documentation + * on elastic.co + */ + + public final RepositoriesResponse repositories( + Function> fn) + throws IOException, ElasticsearchException { + return repositories(fn.apply(new RepositoriesRequest.Builder()).build()); + } + + /** + * Get snapshot repository information. Get a list of snapshot repositories for + * a cluster. IMPORTANT: cat APIs are only intended for human consumption using + * the command line or Kibana console. They are not intended for use by + * applications. For application consumption, use the get snapshot repository + * API. + * + * @see Documentation + * on elastic.co + */ + public RepositoriesResponse repositories() throws IOException, ElasticsearchException { - return this.transport.performRequest(RepositoriesRequest._INSTANCE, RepositoriesRequest._ENDPOINT, + return this.transport.performRequest(new RepositoriesRequest.Builder().build(), RepositoriesRequest._ENDPOINT, this.transportOptions); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/HelpRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/HelpRequest.java index 92567555f..78d0d996a 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/HelpRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/HelpRequest.java @@ -29,8 +29,6 @@ import co.elastic.clients.util.ObjectBuilder; import jakarta.json.stream.JsonGenerator; import java.util.Collections; -import java.util.HashMap; -import java.util.Map; import java.util.Objects; //---------------------------------------------------------------- @@ -57,7 +55,7 @@ * specification */ -public class HelpRequest extends CatRequestBase { +public class HelpRequest { public HelpRequest() { } @@ -93,9 +91,7 @@ public HelpRequest() { // Request parameters request -> { - Map params = new HashMap<>(); - params.put("format", "json"); - return params; + return Collections.emptyMap(); }, SimpleEndpoint.emptyMap(), false, HelpResponse._DESERIALIZER); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/HelpResponse.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/HelpResponse.java index 0edc100ee..03fced1f8 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/HelpResponse.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/HelpResponse.java @@ -19,23 +19,13 @@ package co.elastic.clients.elasticsearch.cat; -import co.elastic.clients.elasticsearch.cat.help.HelpRecord; 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.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; -import jakarta.json.stream.JsonParser; -import java.util.List; import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; //---------------------------------------------------------------- // THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. @@ -59,120 +49,17 @@ * @see API * specification */ -@JsonpDeserializable -public class HelpResponse implements JsonpSerializable { - private final List valueBody; - // --------------------------------------------------------------------------------------------- - - private HelpResponse(Builder builder) { - - this.valueBody = ApiTypeHelper.unmodifiableRequired(builder.valueBody, this, "valueBody"); - - } - - public static HelpResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Response value. - */ - public final List valueBody() { - return this.valueBody; +public class HelpResponse { + public HelpResponse() { } /** - * Serialize this value to JSON. + * Singleton instance for {@link HelpResponse}. */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartArray(); - for (HelpRecord item0 : this.valueBody) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } + public static final HelpResponse _INSTANCE = new HelpResponse(); - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link HelpResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private List valueBody; - - /** - * Required - Response value. - *

- * Adds all elements of list to valueBody. - */ - public final Builder valueBody(List list) { - this.valueBody = _listAddAll(this.valueBody, list); - return this; - } - - /** - * Required - Response value. - *

- * Adds one or more values to valueBody. - */ - public final Builder valueBody(HelpRecord value, HelpRecord... values) { - this.valueBody = _listAdd(this.valueBody, value, values); - return this; - } - - /** - * Required - Response value. - *

- * Adds a value to valueBody using a builder lambda. - */ - public final Builder valueBody(Function> fn) { - return valueBody(fn.apply(new HelpRecord.Builder()).build()); - } - - @Override - public Builder withJson(JsonParser parser, JsonpMapper mapper) { - - @SuppressWarnings("unchecked") - List value = (List) JsonpDeserializer.arrayDeserializer(HelpRecord._DESERIALIZER) - .deserialize(parser, mapper); - return this.valueBody(value); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link HelpResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public HelpResponse build() { - _checkSingleUse(); - - return new HelpResponse(this); - } - } - - public static final JsonpDeserializer _DESERIALIZER = createHelpResponseDeserializer(); - protected static JsonpDeserializer createHelpResponseDeserializer() { - - JsonpDeserializer> valueDeserializer = JsonpDeserializer - .arrayDeserializer(HelpRecord._DESERIALIZER); - - return JsonpDeserializer.of(valueDeserializer.acceptedEvents(), (parser, mapper, event) -> new Builder() - .valueBody(valueDeserializer.deserialize(parser, mapper, event)).build()); - } + public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer + .emptyObject(HelpResponse._INSTANCE); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/IndicesRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/IndicesRequest.java index af07f14e5..794b548b5 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/IndicesRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/IndicesRequest.java @@ -23,6 +23,7 @@ import co.elastic.clients.elasticsearch._types.ErrorResponse; import co.elastic.clients.elasticsearch._types.ExpandWildcard; import co.elastic.clients.elasticsearch._types.HealthStatus; +import co.elastic.clients.elasticsearch._types.Time; import co.elastic.clients.elasticsearch._types.TimeUnit; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; @@ -101,6 +102,9 @@ public class IndicesRequest extends CatRequestBase { private final List index; + @Nullable + private final Time masterTimeout; + @Nullable private final Boolean pri; @@ -116,6 +120,7 @@ private IndicesRequest(Builder builder) { this.health = builder.health; this.includeUnloadedSegments = builder.includeUnloadedSegments; this.index = ApiTypeHelper.unmodifiable(builder.index); + this.masterTimeout = builder.masterTimeout; this.pri = builder.pri; this.time = builder.time; @@ -177,6 +182,16 @@ public final List index() { return this.index; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + /** * If true, the response only includes information from primary shards. *

@@ -221,6 +236,9 @@ public static class Builder extends CatRequestBase.AbstractBuilder @Nullable private List index; + @Nullable + private Time masterTimeout; + @Nullable private Boolean pri; @@ -311,6 +329,25 @@ public final Builder index(String value, String... values) { return this; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(Function> fn) { + return this.masterTimeout(fn.apply(new Time.Builder()).build()); + } + /** * If true, the response only includes information from primary shards. *

@@ -412,6 +449,9 @@ public IndicesRequest build() { request -> { Map params = new HashMap<>(); params.put("format", "json"); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } if (ApiTypeHelper.isDefined(request.expandWildcards)) { params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/MasterRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/MasterRequest.java index a9cc80187..52e9dfd52 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/MasterRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/MasterRequest.java @@ -20,6 +20,7 @@ package co.elastic.clients.elasticsearch.cat; import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.Time; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -68,11 +69,15 @@ public class MasterRequest extends CatRequestBase { @Nullable private final Boolean local; + @Nullable + private final Time masterTimeout; + // --------------------------------------------------------------------------------------------- private MasterRequest(Builder builder) { this.local = builder.local; + this.masterTimeout = builder.masterTimeout; } @@ -94,6 +99,16 @@ public final Boolean local() { return this.local; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + // --------------------------------------------------------------------------------------------- /** @@ -106,6 +121,9 @@ public static class Builder extends CatRequestBase.AbstractBuilder @Nullable private Boolean local; + @Nullable + private Time masterTimeout; + /** * If true, the request computes the list of selected nodes from * the local cluster state. If false the list of selected nodes are @@ -120,6 +138,25 @@ public final Builder local(@Nullable Boolean value) { return this; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(Function> fn) { + return this.masterTimeout(fn.apply(new Time.Builder()).build()); + } + @Override protected Builder self() { return this; @@ -167,6 +204,9 @@ public MasterRequest build() { request -> { Map params = new HashMap<>(); params.put("format", "json"); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } if (request.local != null) { params.put("local", String.valueOf(request.local)); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/MlDataFrameAnalyticsRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/MlDataFrameAnalyticsRequest.java index c257917f4..2457f9c21 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/MlDataFrameAnalyticsRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/MlDataFrameAnalyticsRequest.java @@ -21,7 +21,7 @@ import co.elastic.clients.elasticsearch._types.Bytes; import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.Time; +import co.elastic.clients.elasticsearch._types.TimeUnit; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -86,7 +86,7 @@ public class MlDataFrameAnalyticsRequest extends CatRequestBase { private final List s; @Nullable - private final Time time; + private final TimeUnit time; // --------------------------------------------------------------------------------------------- @@ -161,7 +161,7 @@ public final List s() { * API name: {@code time} */ @Nullable - public final Time time() { + public final TimeUnit time() { return this.time; } @@ -190,7 +190,7 @@ public static class Builder extends CatRequestBase.AbstractBuilder private List s; @Nullable - private Time time; + private TimeUnit time; /** * Whether to ignore if a wildcard expression matches no configs. (This includes @@ -278,20 +278,11 @@ public final Builder s(CatDfaColumn value, CatDfaColumn... values) { *

* API name: {@code time} */ - public final Builder time(@Nullable Time value) { + public final Builder time(@Nullable TimeUnit value) { this.time = value; return this; } - /** - * Unit used to display time values. - *

- * API name: {@code time} - */ - public final Builder time(Function> fn) { - return this.time(fn.apply(new Time.Builder()).build()); - } - @Override protected Builder self() { return this; @@ -387,7 +378,7 @@ public MlDataFrameAnalyticsRequest build() { params.put("h", request.h.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); } if (request.time != null) { - params.put("time", request.time._toJsonString()); + params.put("time", request.time.jsonValue()); } if (request.allowNoMatch != null) { params.put("allow_no_match", String.valueOf(request.allowNoMatch)); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/MlTrainedModelsRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/MlTrainedModelsRequest.java index fe3bc8011..b5beb9f66 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/MlTrainedModelsRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/MlTrainedModelsRequest.java @@ -21,6 +21,7 @@ import co.elastic.clients.elasticsearch._types.Bytes; import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.TimeUnit; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -90,6 +91,9 @@ public class MlTrainedModelsRequest extends CatRequestBase { @Nullable private final Integer size; + @Nullable + private final TimeUnit time; + // --------------------------------------------------------------------------------------------- private MlTrainedModelsRequest(Builder builder) { @@ -101,6 +105,7 @@ private MlTrainedModelsRequest(Builder builder) { this.modelId = builder.modelId; this.s = ApiTypeHelper.unmodifiable(builder.s); this.size = builder.size; + this.time = builder.time; } @@ -182,6 +187,16 @@ public final Integer size() { return this.size; } + /** + * Unit used to display time values. + *

+ * API name: {@code time} + */ + @Nullable + public final TimeUnit time() { + return this.time; + } + // --------------------------------------------------------------------------------------------- /** @@ -212,6 +227,9 @@ public static class Builder extends CatRequestBase.AbstractBuilder @Nullable private Integer size; + @Nullable + private TimeUnit time; + /** * Specifies what to do when the request: contains wildcard expressions and * there are no models that match; contains the _all string or no @@ -316,6 +334,16 @@ public final Builder size(@Nullable Integer value) { return this; } + /** + * Unit used to display time values. + *

+ * API name: {@code time} + */ + public final Builder time(@Nullable TimeUnit value) { + this.time = value; + return this; + } + @Override protected Builder self() { return this; @@ -414,6 +442,9 @@ public MlTrainedModelsRequest build() { if (request.from != null) { params.put("from", String.valueOf(request.from)); } + if (request.time != null) { + params.put("time", request.time.jsonValue()); + } if (request.allowNoMatch != null) { params.put("allow_no_match", String.valueOf(request.allowNoMatch)); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/NodeattrsRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/NodeattrsRequest.java index d97911919..4c9ffb766 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/NodeattrsRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/NodeattrsRequest.java @@ -20,6 +20,7 @@ package co.elastic.clients.elasticsearch.cat; import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.Time; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -67,11 +68,15 @@ public class NodeattrsRequest extends CatRequestBase { @Nullable private final Boolean local; + @Nullable + private final Time masterTimeout; + // --------------------------------------------------------------------------------------------- private NodeattrsRequest(Builder builder) { this.local = builder.local; + this.masterTimeout = builder.masterTimeout; } @@ -93,6 +98,16 @@ public final Boolean local() { return this.local; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + // --------------------------------------------------------------------------------------------- /** @@ -105,6 +120,9 @@ public static class Builder extends CatRequestBase.AbstractBuilder @Nullable private Boolean local; + @Nullable + private Time masterTimeout; + /** * If true, the request computes the list of selected nodes from * the local cluster state. If false the list of selected nodes are @@ -119,6 +137,25 @@ public final Builder local(@Nullable Boolean value) { return this; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(Function> fn) { + return this.masterTimeout(fn.apply(new Time.Builder()).build()); + } + @Override protected Builder self() { return this; @@ -166,6 +203,9 @@ public NodeattrsRequest build() { request -> { Map params = new HashMap<>(); params.put("format", "json"); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } if (request.local != null) { params.put("local", String.valueOf(request.local)); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/NodesRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/NodesRequest.java index 8fea93dc6..2c8868664 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/NodesRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/NodesRequest.java @@ -21,6 +21,8 @@ import co.elastic.clients.elasticsearch._types.Bytes; import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.Time; +import co.elastic.clients.elasticsearch._types.TimeUnit; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -74,6 +76,12 @@ public class NodesRequest extends CatRequestBase { @Nullable private final Boolean includeUnloadedSegments; + @Nullable + private final Time masterTimeout; + + @Nullable + private final TimeUnit time; + // --------------------------------------------------------------------------------------------- private NodesRequest(Builder builder) { @@ -81,6 +89,8 @@ private NodesRequest(Builder builder) { this.bytes = builder.bytes; this.fullId = builder.fullId; this.includeUnloadedSegments = builder.includeUnloadedSegments; + this.masterTimeout = builder.masterTimeout; + this.time = builder.time; } @@ -120,6 +130,26 @@ public final Boolean includeUnloadedSegments() { return this.includeUnloadedSegments; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + /** + * Unit used to display time values. + *

+ * API name: {@code time} + */ + @Nullable + public final TimeUnit time() { + return this.time; + } + // --------------------------------------------------------------------------------------------- /** @@ -136,6 +166,12 @@ public static class Builder extends CatRequestBase.AbstractBuilder impl @Nullable private Boolean includeUnloadedSegments; + @Nullable + private Time masterTimeout; + + @Nullable + private TimeUnit time; + /** * The unit used to display byte values. *

@@ -168,6 +204,35 @@ public final Builder includeUnloadedSegments(@Nullable Boolean value) { return this; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(Function> fn) { + return this.masterTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * Unit used to display time values. + *

+ * API name: {@code time} + */ + public final Builder time(@Nullable TimeUnit value) { + this.time = value; + return this; + } + @Override protected Builder self() { return this; @@ -215,12 +280,18 @@ public NodesRequest build() { request -> { Map params = new HashMap<>(); params.put("format", "json"); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } if (request.bytes != null) { params.put("bytes", request.bytes.jsonValue()); } if (request.includeUnloadedSegments != null) { params.put("include_unloaded_segments", String.valueOf(request.includeUnloadedSegments)); } + if (request.time != null) { + params.put("time", request.time.jsonValue()); + } if (request.fullId != null) { params.put("full_id", String.valueOf(request.fullId)); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/PendingTasksRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/PendingTasksRequest.java index 3f08d5276..59c25c500 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/PendingTasksRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/PendingTasksRequest.java @@ -20,6 +20,8 @@ package co.elastic.clients.elasticsearch.cat; import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.Time; +import co.elastic.clients.elasticsearch._types.TimeUnit; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -68,11 +70,19 @@ public class PendingTasksRequest extends CatRequestBase { @Nullable private final Boolean local; + @Nullable + private final Time masterTimeout; + + @Nullable + private final TimeUnit time; + // --------------------------------------------------------------------------------------------- private PendingTasksRequest(Builder builder) { this.local = builder.local; + this.masterTimeout = builder.masterTimeout; + this.time = builder.time; } @@ -94,6 +104,26 @@ public final Boolean local() { return this.local; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + /** + * Unit used to display time values. + *

+ * API name: {@code time} + */ + @Nullable + public final TimeUnit time() { + return this.time; + } + // --------------------------------------------------------------------------------------------- /** @@ -106,6 +136,12 @@ public static class Builder extends CatRequestBase.AbstractBuilder @Nullable private Boolean local; + @Nullable + private Time masterTimeout; + + @Nullable + private TimeUnit time; + /** * If true, the request computes the list of selected nodes from * the local cluster state. If false the list of selected nodes are @@ -120,6 +156,35 @@ public final Builder local(@Nullable Boolean value) { return this; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(Function> fn) { + return this.masterTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * Unit used to display time values. + *

+ * API name: {@code time} + */ + public final Builder time(@Nullable TimeUnit value) { + this.time = value; + return this; + } + @Override protected Builder self() { return this; @@ -167,6 +232,12 @@ public PendingTasksRequest build() { request -> { Map params = new HashMap<>(); params.put("format", "json"); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } + if (request.time != null) { + params.put("time", request.time.jsonValue()); + } if (request.local != null) { params.put("local", String.valueOf(request.local)); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/PluginsRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/PluginsRequest.java index 1487f4cf1..7f2237687 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/PluginsRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/PluginsRequest.java @@ -20,6 +20,7 @@ package co.elastic.clients.elasticsearch.cat; import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.Time; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -64,14 +65,22 @@ */ public class PluginsRequest extends CatRequestBase { + @Nullable + private final Boolean includeBootstrap; + @Nullable private final Boolean local; + @Nullable + private final Time masterTimeout; + // --------------------------------------------------------------------------------------------- private PluginsRequest(Builder builder) { + this.includeBootstrap = builder.includeBootstrap; this.local = builder.local; + this.masterTimeout = builder.masterTimeout; } @@ -79,6 +88,16 @@ public static PluginsRequest of(Function> return fn.apply(new Builder()).build(); } + /** + * Include bootstrap plugins in the response + *

+ * API name: {@code include_bootstrap} + */ + @Nullable + public final Boolean includeBootstrap() { + return this.includeBootstrap; + } + /** * If true, the request computes the list of selected nodes from * the local cluster state. If false the list of selected nodes are @@ -93,6 +112,16 @@ public final Boolean local() { return this.local; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + // --------------------------------------------------------------------------------------------- /** @@ -102,9 +131,25 @@ public final Boolean local() { public static class Builder extends CatRequestBase.AbstractBuilder implements ObjectBuilder { + @Nullable + private Boolean includeBootstrap; + @Nullable private Boolean local; + @Nullable + private Time masterTimeout; + + /** + * Include bootstrap plugins in the response + *

+ * API name: {@code include_bootstrap} + */ + public final Builder includeBootstrap(@Nullable Boolean value) { + this.includeBootstrap = value; + return this; + } + /** * If true, the request computes the list of selected nodes from * the local cluster state. If false the list of selected nodes are @@ -119,6 +164,25 @@ public final Builder local(@Nullable Boolean value) { return this; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(Function> fn) { + return this.masterTimeout(fn.apply(new Time.Builder()).build()); + } + @Override protected Builder self() { return this; @@ -166,6 +230,12 @@ public PluginsRequest build() { request -> { Map params = new HashMap<>(); params.put("format", "json"); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } + if (request.includeBootstrap != null) { + params.put("include_bootstrap", String.valueOf(request.includeBootstrap)); + } if (request.local != null) { params.put("local", String.valueOf(request.local)); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/RecoveryRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/RecoveryRequest.java index 37e01d4c0..10bd684f7 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/RecoveryRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/RecoveryRequest.java @@ -21,6 +21,7 @@ import co.elastic.clients.elasticsearch._types.Bytes; import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.TimeUnit; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -84,6 +85,9 @@ public class RecoveryRequest extends CatRequestBase { private final List index; + @Nullable + private final TimeUnit time; + // --------------------------------------------------------------------------------------------- private RecoveryRequest(Builder builder) { @@ -92,6 +96,7 @@ private RecoveryRequest(Builder builder) { this.bytes = builder.bytes; this.detailed = builder.detailed; this.index = ApiTypeHelper.unmodifiable(builder.index); + this.time = builder.time; } @@ -141,6 +146,16 @@ public final List index() { return this.index; } + /** + * Unit used to display time values. + *

+ * API name: {@code time} + */ + @Nullable + public final TimeUnit time() { + return this.time; + } + // --------------------------------------------------------------------------------------------- /** @@ -162,6 +177,9 @@ public static class Builder extends CatRequestBase.AbstractBuilder @Nullable private List index; + @Nullable + private TimeUnit time; + /** * If true, the response only includes ongoing shard recoveries. *

@@ -221,6 +239,16 @@ public final Builder index(String value, String... values) { return this; } + /** + * Unit used to display time values. + *

+ * API name: {@code time} + */ + public final Builder time(@Nullable TimeUnit value) { + this.time = value; + return this; + } + @Override protected Builder self() { return this; @@ -311,6 +339,9 @@ public RecoveryRequest build() { if (request.bytes != null) { params.put("bytes", request.bytes.jsonValue()); } + if (request.time != null) { + params.put("time", request.time.jsonValue()); + } return params; }, SimpleEndpoint.emptyMap(), false, RecoveryResponse._DESERIALIZER); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/RepositoriesRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/RepositoriesRequest.java index 99f6cd8f7..b7e42b8eb 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/RepositoriesRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/RepositoriesRequest.java @@ -20,6 +20,7 @@ package co.elastic.clients.elasticsearch.cat; import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.Time; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -28,10 +29,13 @@ import co.elastic.clients.transport.endpoints.SimpleEndpoint; import co.elastic.clients.util.ObjectBuilder; import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; //---------------------------------------------------------------- // THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. @@ -62,13 +66,114 @@ */ public class RepositoriesRequest extends CatRequestBase { - public RepositoriesRequest() { + @Nullable + private final Boolean local; + + @Nullable + private final Time masterTimeout; + + // --------------------------------------------------------------------------------------------- + + private RepositoriesRequest(Builder builder) { + + this.local = builder.local; + this.masterTimeout = builder.masterTimeout; + + } + + public static RepositoriesRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * If true, the request computes the list of selected nodes from + * the local cluster state. If false the list of selected nodes are + * computed from the cluster state of the master node. In both cases the + * coordinating node will send requests for further information to each selected + * node. + *

+ * API name: {@code local} + */ + @Nullable + public final Boolean local() { + return this.local; + } + + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; } + // --------------------------------------------------------------------------------------------- + /** - * Singleton instance for {@link RepositoriesRequest}. + * Builder for {@link RepositoriesRequest}. */ - public static final RepositoriesRequest _INSTANCE = new RepositoriesRequest(); + + public static class Builder extends CatRequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Boolean local; + + @Nullable + private Time masterTimeout; + + /** + * If true, the request computes the list of selected nodes from + * the local cluster state. If false the list of selected nodes are + * computed from the cluster state of the master node. In both cases the + * coordinating node will send requests for further information to each selected + * node. + *

+ * API name: {@code local} + */ + public final Builder local(@Nullable Boolean value) { + this.local = value; + return this; + } + + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(Function> fn) { + return this.masterTimeout(fn.apply(new Time.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link RepositoriesRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public RepositoriesRequest build() { + _checkSingleUse(); + + return new RepositoriesRequest(this); + } + } // --------------------------------------------------------------------------------------------- @@ -99,6 +204,12 @@ public RepositoriesRequest() { request -> { Map params = new HashMap<>(); params.put("format", "json"); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } + if (request.local != null) { + params.put("local", String.valueOf(request.local)); + } return params; }, SimpleEndpoint.emptyMap(), false, RepositoriesResponse._DESERIALIZER); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/SegmentsRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/SegmentsRequest.java index b5199379e..9d8a1ac78 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/SegmentsRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/SegmentsRequest.java @@ -21,6 +21,7 @@ import co.elastic.clients.elasticsearch._types.Bytes; import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.Time; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -77,6 +78,9 @@ public class SegmentsRequest extends CatRequestBase { @Nullable private final Boolean local; + @Nullable + private final Time masterTimeout; + // --------------------------------------------------------------------------------------------- private SegmentsRequest(Builder builder) { @@ -84,6 +88,7 @@ private SegmentsRequest(Builder builder) { this.bytes = builder.bytes; this.index = ApiTypeHelper.unmodifiable(builder.index); this.local = builder.local; + this.masterTimeout = builder.masterTimeout; } @@ -126,6 +131,16 @@ public final Boolean local() { return this.local; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + // --------------------------------------------------------------------------------------------- /** @@ -144,6 +159,9 @@ public static class Builder extends CatRequestBase.AbstractBuilder @Nullable private Boolean local; + @Nullable + private Time masterTimeout; + /** * The unit used to display byte values. *

@@ -196,6 +214,25 @@ public final Builder local(@Nullable Boolean value) { return this; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(Function> fn) { + return this.masterTimeout(fn.apply(new Time.Builder()).build()); + } + @Override protected Builder self() { return this; @@ -277,6 +314,9 @@ public SegmentsRequest build() { request -> { Map params = new HashMap<>(); params.put("format", "json"); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } if (request.bytes != null) { params.put("bytes", request.bytes.jsonValue()); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/ShardsRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/ShardsRequest.java index 8ce91892d..87f0e5e67 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/ShardsRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/ShardsRequest.java @@ -21,6 +21,8 @@ import co.elastic.clients.elasticsearch._types.Bytes; import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.Time; +import co.elastic.clients.elasticsearch._types.TimeUnit; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -72,12 +74,20 @@ public class ShardsRequest extends CatRequestBase { private final List index; + @Nullable + private final Time masterTimeout; + + @Nullable + private final TimeUnit time; + // --------------------------------------------------------------------------------------------- private ShardsRequest(Builder builder) { this.bytes = builder.bytes; this.index = ApiTypeHelper.unmodifiable(builder.index); + this.masterTimeout = builder.masterTimeout; + this.time = builder.time; } @@ -106,6 +116,26 @@ public final List index() { return this.index; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + /** + * Unit used to display time values. + *

+ * API name: {@code time} + */ + @Nullable + public final TimeUnit time() { + return this.time; + } + // --------------------------------------------------------------------------------------------- /** @@ -121,6 +151,12 @@ public static class Builder extends CatRequestBase.AbstractBuilder @Nullable private List index; + @Nullable + private Time masterTimeout; + + @Nullable + private TimeUnit time; + /** * The unit used to display byte values. *

@@ -159,6 +195,35 @@ public final Builder index(String value, String... values) { return this; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(Function> fn) { + return this.masterTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * Unit used to display time values. + *

+ * API name: {@code time} + */ + public final Builder time(@Nullable TimeUnit value) { + this.time = value; + return this; + } + @Override protected Builder self() { return this; @@ -240,9 +305,15 @@ public ShardsRequest build() { request -> { Map params = new HashMap<>(); params.put("format", "json"); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } if (request.bytes != null) { params.put("bytes", request.bytes.jsonValue()); } + if (request.time != null) { + params.put("time", request.time.jsonValue()); + } return params; }, SimpleEndpoint.emptyMap(), false, ShardsResponse._DESERIALIZER); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/SnapshotsRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/SnapshotsRequest.java index 1e30a07c4..e2b9663c3 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/SnapshotsRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/SnapshotsRequest.java @@ -20,6 +20,8 @@ package co.elastic.clients.elasticsearch.cat; import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.Time; +import co.elastic.clients.elasticsearch._types.TimeUnit; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -72,14 +74,22 @@ public class SnapshotsRequest extends CatRequestBase { @Nullable private final Boolean ignoreUnavailable; + @Nullable + private final Time masterTimeout; + private final List repository; + @Nullable + private final TimeUnit time; + // --------------------------------------------------------------------------------------------- private SnapshotsRequest(Builder builder) { this.ignoreUnavailable = builder.ignoreUnavailable; + this.masterTimeout = builder.masterTimeout; this.repository = ApiTypeHelper.unmodifiable(builder.repository); + this.time = builder.time; } @@ -98,6 +108,16 @@ public final Boolean ignoreUnavailable() { return this.ignoreUnavailable; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + /** * A comma-separated list of snapshot repositories used to limit the request. * Accepts wildcard expressions. _all returns all repositories. If @@ -109,6 +129,16 @@ public final List repository() { return this.repository; } + /** + * Unit used to display time values. + *

+ * API name: {@code time} + */ + @Nullable + public final TimeUnit time() { + return this.time; + } + // --------------------------------------------------------------------------------------------- /** @@ -121,9 +151,15 @@ public static class Builder extends CatRequestBase.AbstractBuilder @Nullable private Boolean ignoreUnavailable; + @Nullable + private Time masterTimeout; + @Nullable private List repository; + @Nullable + private TimeUnit time; + /** * If true, the response does not include information from * unavailable snapshots. @@ -135,6 +171,25 @@ public final Builder ignoreUnavailable(@Nullable Boolean value) { return this; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(Function> fn) { + return this.masterTimeout(fn.apply(new Time.Builder()).build()); + } + /** * A comma-separated list of snapshot repositories used to limit the request. * Accepts wildcard expressions. _all returns all repositories. If @@ -163,6 +218,16 @@ public final Builder repository(String value, String... values) { return this; } + /** + * Unit used to display time values. + *

+ * API name: {@code time} + */ + public final Builder time(@Nullable TimeUnit value) { + this.time = value; + return this; + } + @Override protected Builder self() { return this; @@ -245,9 +310,15 @@ public SnapshotsRequest build() { request -> { Map params = new HashMap<>(); params.put("format", "json"); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } if (request.ignoreUnavailable != null) { params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); } + if (request.time != null) { + params.put("time", request.time.jsonValue()); + } return params; }, SimpleEndpoint.emptyMap(), false, SnapshotsResponse._DESERIALIZER); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/TasksRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/TasksRequest.java index 7abeec6e1..468e1d00f 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/TasksRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/TasksRequest.java @@ -20,6 +20,8 @@ package co.elastic.clients.elasticsearch.cat; import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.Time; +import co.elastic.clients.elasticsearch._types.TimeUnit; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -73,19 +75,31 @@ public class TasksRequest extends CatRequestBase { @Nullable private final Boolean detailed; - private final List nodeId; + private final List nodes; @Nullable private final String parentTaskId; + @Nullable + private final TimeUnit time; + + @Nullable + private final Time timeout; + + @Nullable + private final Boolean waitForCompletion; + // --------------------------------------------------------------------------------------------- private TasksRequest(Builder builder) { this.actions = ApiTypeHelper.unmodifiable(builder.actions); this.detailed = builder.detailed; - this.nodeId = ApiTypeHelper.unmodifiable(builder.nodeId); + this.nodes = ApiTypeHelper.unmodifiable(builder.nodes); this.parentTaskId = builder.parentTaskId; + this.time = builder.time; + this.timeout = builder.timeout; + this.waitForCompletion = builder.waitForCompletion; } @@ -116,10 +130,10 @@ public final Boolean detailed() { /** * Unique node identifiers, which are used to limit the response. *

- * API name: {@code node_id} + * API name: {@code nodes} */ - public final List nodeId() { - return this.nodeId; + public final List nodes() { + return this.nodes; } /** @@ -132,6 +146,37 @@ public final String parentTaskId() { return this.parentTaskId; } + /** + * Unit used to display time values. + *

+ * API name: {@code time} + */ + @Nullable + public final TimeUnit time() { + return this.time; + } + + /** + * Period to wait for a response. If no response is received before the timeout + * expires, the request fails and returns an error. + *

+ * API name: {@code timeout} + */ + @Nullable + public final Time timeout() { + return this.timeout; + } + + /** + * If true, the request blocks until the task has completed. + *

+ * API name: {@code wait_for_completion} + */ + @Nullable + public final Boolean waitForCompletion() { + return this.waitForCompletion; + } + // --------------------------------------------------------------------------------------------- /** @@ -146,11 +191,20 @@ public static class Builder extends CatRequestBase.AbstractBuilder impl private Boolean detailed; @Nullable - private List nodeId; + private List nodes; @Nullable private String parentTaskId; + @Nullable + private TimeUnit time; + + @Nullable + private Time timeout; + + @Nullable + private Boolean waitForCompletion; + /** * The task action names, which are used to limit the response. *

@@ -189,24 +243,24 @@ public final Builder detailed(@Nullable Boolean value) { /** * Unique node identifiers, which are used to limit the response. *

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

- * Adds all elements of list to nodeId. + * Adds all elements of list to nodes. */ - public final Builder nodeId(List list) { - this.nodeId = _listAddAll(this.nodeId, list); + public final Builder nodes(List list) { + this.nodes = _listAddAll(this.nodes, list); return this; } /** * Unique node identifiers, which are used to limit the response. *

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

- * Adds one or more values to nodeId. + * Adds one or more values to nodes. */ - public final Builder nodeId(String value, String... values) { - this.nodeId = _listAdd(this.nodeId, value, values); + public final Builder nodes(String value, String... values) { + this.nodes = _listAdd(this.nodes, value, values); return this; } @@ -220,6 +274,47 @@ public final Builder parentTaskId(@Nullable String value) { return this; } + /** + * Unit used to display time values. + *

+ * API name: {@code time} + */ + public final Builder time(@Nullable TimeUnit value) { + this.time = value; + return this; + } + + /** + * Period to wait for a response. If no response is received before the timeout + * expires, the request fails and returns an error. + *

+ * API name: {@code timeout} + */ + public final Builder timeout(@Nullable Time value) { + this.timeout = value; + return this; + } + + /** + * Period to wait for a response. If no response is received before the timeout + * expires, the request fails and returns an error. + *

+ * API name: {@code timeout} + */ + public final Builder timeout(Function> fn) { + return this.timeout(fn.apply(new Time.Builder()).build()); + } + + /** + * If true, the request blocks until the task has completed. + *

+ * API name: {@code wait_for_completion} + */ + public final Builder waitForCompletion(@Nullable Boolean value) { + this.waitForCompletion = value; + return this; + } + @Override protected Builder self() { return this; @@ -267,17 +362,26 @@ public TasksRequest build() { request -> { Map params = new HashMap<>(); params.put("format", "json"); + if (ApiTypeHelper.isDefined(request.nodes)) { + params.put("nodes", request.nodes.stream().map(v -> v).collect(Collectors.joining(","))); + } if (request.parentTaskId != null) { params.put("parent_task_id", request.parentTaskId); } if (request.detailed != null) { params.put("detailed", String.valueOf(request.detailed)); } + if (request.time != null) { + params.put("time", request.time.jsonValue()); + } if (ApiTypeHelper.isDefined(request.actions)) { params.put("actions", request.actions.stream().map(v -> v).collect(Collectors.joining(","))); } - if (ApiTypeHelper.isDefined(request.nodeId)) { - params.put("node_id", request.nodeId.stream().map(v -> v).collect(Collectors.joining(","))); + if (request.waitForCompletion != null) { + params.put("wait_for_completion", String.valueOf(request.waitForCompletion)); + } + if (request.timeout != null) { + params.put("timeout", request.timeout._toJsonString()); } return params; diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/TemplatesRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/TemplatesRequest.java index 150e9d865..bd9e46820 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/TemplatesRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/TemplatesRequest.java @@ -20,6 +20,7 @@ package co.elastic.clients.elasticsearch.cat; import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.Time; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -69,6 +70,9 @@ public class TemplatesRequest extends CatRequestBase { @Nullable private final Boolean local; + @Nullable + private final Time masterTimeout; + @Nullable private final String name; @@ -77,6 +81,7 @@ public class TemplatesRequest extends CatRequestBase { private TemplatesRequest(Builder builder) { this.local = builder.local; + this.masterTimeout = builder.masterTimeout; this.name = builder.name; } @@ -99,6 +104,16 @@ public final Boolean local() { return this.local; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + /** * The name of the template to return. Accepts wildcard expressions. If omitted, * all templates are returned. @@ -122,6 +137,9 @@ public static class Builder extends CatRequestBase.AbstractBuilder @Nullable private Boolean local; + @Nullable + private Time masterTimeout; + @Nullable private String name; @@ -139,6 +157,25 @@ public final Builder local(@Nullable Boolean value) { return this; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(Function> fn) { + return this.masterTimeout(fn.apply(new Time.Builder()).build()); + } + /** * The name of the template to return. Accepts wildcard expressions. If omitted, * all templates are returned. @@ -231,6 +268,9 @@ public TemplatesRequest build() { request -> { Map params = new HashMap<>(); params.put("format", "json"); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } if (request.local != null) { params.put("local", String.valueOf(request.local)); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/ThreadPoolRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/ThreadPoolRequest.java index b9b79ea4f..9105bd8db 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/ThreadPoolRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/ThreadPoolRequest.java @@ -20,6 +20,7 @@ package co.elastic.clients.elasticsearch.cat; import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.Time; import co.elastic.clients.elasticsearch._types.TimeUnit; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; @@ -72,6 +73,9 @@ public class ThreadPoolRequest extends CatRequestBase { @Nullable private final Boolean local; + @Nullable + private final Time masterTimeout; + private final List threadPoolPatterns; @Nullable @@ -82,6 +86,7 @@ public class ThreadPoolRequest extends CatRequestBase { private ThreadPoolRequest(Builder builder) { this.local = builder.local; + this.masterTimeout = builder.masterTimeout; this.threadPoolPatterns = ApiTypeHelper.unmodifiable(builder.threadPoolPatterns); this.time = builder.time; @@ -105,6 +110,16 @@ public final Boolean local() { return this.local; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + /** * A comma-separated list of thread pool names used to limit the request. * Accepts wildcard expressions. @@ -137,6 +152,9 @@ public static class Builder extends CatRequestBase.AbstractBuilder @Nullable private Boolean local; + @Nullable + private Time masterTimeout; + @Nullable private List threadPoolPatterns; @@ -157,6 +175,25 @@ public final Builder local(@Nullable Boolean value) { return this; } + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * Period to wait for a connection to the master node. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(Function> fn) { + return this.masterTimeout(fn.apply(new Time.Builder()).build()); + } + /** * A comma-separated list of thread pool names used to limit the request. * Accepts wildcard expressions. @@ -276,6 +313,9 @@ public ThreadPoolRequest build() { request -> { Map params = new HashMap<>(); params.put("format", "json"); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } if (request.time != null) { params.put("time", request.time.jsonValue()); } 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 38ab7e139..711b7121b 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 @@ -1022,13 +1022,13 @@ 'cat._types.CatTrainedModelsColumn': 'cat/_types/CatBase.ts#L561-L635', 'cat._types.CatTransformColumn': 'cat/_types/CatBase.ts#L640-L844', 'cat.aliases.AliasesRecord': 'cat/aliases/types.ts#L22-L53', -'cat.aliases.Request': 'cat/aliases/CatAliasesRequest.ts#L23-L43', +'cat.aliases.Request': 'cat/aliases/CatAliasesRequest.ts#L24-L49', 'cat.aliases.Response': 'cat/aliases/CatAliasesResponse.ts#L22-L24', 'cat.allocation.AllocationRecord': 'cat/allocation/types.ts#L25-L99', -'cat.allocation.Request': 'cat/allocation/CatAllocationRequest.ts#L23-L50', +'cat.allocation.Request': 'cat/allocation/CatAllocationRequest.ts#L24-L56', 'cat.allocation.Response': 'cat/allocation/CatAllocationResponse.ts#L22-L24', 'cat.component_templates.ComponentTemplate': 'cat/component_templates/types.ts#L20-L28', -'cat.component_templates.Request': 'cat/component_templates/CatComponentTemplatesRequest.ts#L22-L49', +'cat.component_templates.Request': 'cat/component_templates/CatComponentTemplatesRequest.ts#L23-L55', 'cat.component_templates.Response': 'cat/component_templates/CatComponentTemplatesResponse.ts#L22-L24', 'cat.count.CountRecord': 'cat/count/types.ts#L23-L39', 'cat.count.Request': 'cat/count/CatCountRequest.ts#L23-L44', @@ -1039,14 +1039,13 @@ 'cat.health.HealthRecord': 'cat/health/types.ts#L23-L99', 'cat.health.Request': 'cat/health/CatHealthRequest.ts#L23-L52', 'cat.health.Response': 'cat/health/CatHealthResponse.ts#L22-L24', -'cat.help.HelpRecord': 'cat/help/types.ts#L20-L22', -'cat.help.Request': 'cat/help/CatHelpRequest.ts#L22-L30', -'cat.help.Response': 'cat/help/CatHelpResponse.ts#L22-L24', +'cat.help.Request': 'cat/help/CatHelpRequest.ts#L20-L28', +'cat.help.Response': 'cat/help/CatHelpResponse.ts#L20-L25', 'cat.indices.IndicesRecord': 'cat/indices/types.ts#L20-L808', -'cat.indices.Request': 'cat/indices/CatIndicesRequest.ts#L24-L77', +'cat.indices.Request': 'cat/indices/CatIndicesRequest.ts#L24-L82', 'cat.indices.Response': 'cat/indices/CatIndicesResponse.ts#L22-L24', 'cat.master.MasterRecord': 'cat/master/types.ts#L20-L39', -'cat.master.Request': 'cat/master/CatMasterRequest.ts#L22-L43', +'cat.master.Request': 'cat/master/CatMasterRequest.ts#L23-L49', 'cat.master.Response': 'cat/master/CatMasterResponse.ts#L22-L24', 'cat.ml_data_frame_analytics.DataFrameAnalyticsRecord': 'cat/ml_data_frame_analytics/types.ts#L22-L102', 'cat.ml_data_frame_analytics.Request': 'cat/ml_data_frame_analytics/CatDataFrameAnalyticsRequest.ts#L24-L59', @@ -1057,43 +1056,43 @@ 'cat.ml_jobs.JobsRecord': 'cat/ml_jobs/types.ts#L24-L347', 'cat.ml_jobs.Request': 'cat/ml_jobs/CatJobsRequest.ts#L24-L78', 'cat.ml_jobs.Response': 'cat/ml_jobs/CatJobsResponse.ts#L22-L24', -'cat.ml_trained_models.Request': 'cat/ml_trained_models/CatTrainedModelsRequest.ts#L24-L64', +'cat.ml_trained_models.Request': 'cat/ml_trained_models/CatTrainedModelsRequest.ts#L25-L69', 'cat.ml_trained_models.Response': 'cat/ml_trained_models/CatTrainedModelsResponse.ts#L22-L24', 'cat.ml_trained_models.TrainedModelsRecord': 'cat/ml_trained_models/types.ts#L23-L115', 'cat.nodeattrs.NodeAttributesRecord': 'cat/nodeattrs/types.ts#L20-L55', -'cat.nodeattrs.Request': 'cat/nodeattrs/CatNodeAttributesRequest.ts#L22-L43', +'cat.nodeattrs.Request': 'cat/nodeattrs/CatNodeAttributesRequest.ts#L23-L49', 'cat.nodeattrs.Response': 'cat/nodeattrs/CatNodeAttributesResponse.ts#L22-L24', 'cat.nodes.NodesRecord': 'cat/nodes/types.ts#L23-L542', -'cat.nodes.Request': 'cat/nodes/CatNodesRequest.ts#L23-L50', +'cat.nodes.Request': 'cat/nodes/CatNodesRequest.ts#L24-L60', 'cat.nodes.Response': 'cat/nodes/CatNodesResponse.ts#L22-L24', 'cat.pending_tasks.PendingTasksRecord': 'cat/pending_tasks/types.ts#L20-L41', -'cat.pending_tasks.Request': 'cat/pending_tasks/CatPendingTasksRequest.ts#L22-L43', +'cat.pending_tasks.Request': 'cat/pending_tasks/CatPendingTasksRequest.ts#L23-L53', 'cat.pending_tasks.Response': 'cat/pending_tasks/CatPendingTasksResponse.ts#L22-L24', 'cat.plugins.PluginsRecord': 'cat/plugins/types.ts#L22-L52', -'cat.plugins.Request': 'cat/plugins/CatPluginsRequest.ts#L22-L43', +'cat.plugins.Request': 'cat/plugins/CatPluginsRequest.ts#L23-L54', 'cat.plugins.Response': 'cat/plugins/CatPluginsResponse.ts#L22-L24', 'cat.recovery.RecoveryRecord': 'cat/recovery/types.ts#L24-L155', -'cat.recovery.Request': 'cat/recovery/CatRecoveryRequest.ts#L23-L60', +'cat.recovery.Request': 'cat/recovery/CatRecoveryRequest.ts#L24-L65', 'cat.recovery.Response': 'cat/recovery/CatRecoveryResponse.ts#L22-L24', 'cat.repositories.RepositoriesRecord': 'cat/repositories/types.ts#L20-L31', -'cat.repositories.Request': 'cat/repositories/CatRepositoriesRequest.ts#L22-L32', +'cat.repositories.Request': 'cat/repositories/CatRepositoriesRequest.ts#L23-L49', 'cat.repositories.Response': 'cat/repositories/CatRepositoriesResponse.ts#L22-L24', -'cat.segments.Request': 'cat/segments/CatSegmentsRequest.ts#L23-L58', +'cat.segments.Request': 'cat/segments/CatSegmentsRequest.ts#L24-L64', 'cat.segments.Response': 'cat/segments/CatSegmentsResponse.ts#L22-L24', 'cat.segments.SegmentsRecord': 'cat/segments/types.ts#L22-L107', -'cat.shards.Request': 'cat/shards/CatShardsRequest.ts#L23-L50', +'cat.shards.Request': 'cat/shards/CatShardsRequest.ts#L24-L60', 'cat.shards.Response': 'cat/shards/CatShardsResponse.ts#L22-L24', 'cat.shards.ShardsRecord': 'cat/shards/types.ts#L20-L427', -'cat.snapshots.Request': 'cat/snapshots/CatSnapshotsRequest.ts#L23-L51', +'cat.snapshots.Request': 'cat/snapshots/CatSnapshotsRequest.ts#L24-L61', 'cat.snapshots.Response': 'cat/snapshots/CatSnapshotsResponse.ts#L22-L24', 'cat.snapshots.SnapshotsRecord': 'cat/snapshots/types.ts#L24-L96', -'cat.tasks.Request': 'cat/tasks/CatTasksRequest.ts#L22-L48', +'cat.tasks.Request': 'cat/tasks/CatTasksRequest.ts#L23-L64', 'cat.tasks.Response': 'cat/tasks/CatTasksResponse.ts#L22-L24', 'cat.tasks.TasksRecord': 'cat/tasks/types.ts#L22-L101', -'cat.templates.Request': 'cat/templates/CatTemplatesRequest.ts#L23-L52', +'cat.templates.Request': 'cat/templates/CatTemplatesRequest.ts#L24-L58', 'cat.templates.Response': 'cat/templates/CatTemplatesResponse.ts#L22-L24', 'cat.templates.TemplatesRecord': 'cat/templates/types.ts#L22-L48', -'cat.thread_pool.Request': 'cat/thread_pool/CatThreadPoolRequest.ts#L24-L57', +'cat.thread_pool.Request': 'cat/thread_pool/CatThreadPoolRequest.ts#L24-L62', 'cat.thread_pool.Response': 'cat/thread_pool/CatThreadPoolResponse.ts#L22-L24', 'cat.thread_pool.ThreadPoolRecord': 'cat/thread_pool/types.ts#L22-L124', 'cat.transforms.Request': 'cat/transforms/CatTransformsRequest.ts#L25-L78', @@ -1344,7 +1343,7 @@ 'eql.get.Response': 'eql/get/EqlGetResponse.ts#L22-L24', 'eql.get_status.Request': 'eql/get_status/EqlGetStatusRequest.ts#L23-L36', 'eql.get_status.Response': 'eql/get_status/EqlGetStatusResponse.ts#L24-L51', -'eql.search.Request': 'eql/search/EqlSearchRequest.ts#L28-L129', +'eql.search.Request': 'eql/search/EqlSearchRequest.ts#L28-L142', 'eql.search.Response': 'eql/search/EqlSearchResponse.ts#L22-L24', 'eql.search.ResultPosition': 'eql/search/types.ts#L20-L32', 'esql._types.TableValuesContainer': 'esql/_types/TableValuesContainer.ts#L22-L28', @@ -1708,7 +1707,8 @@ 'ingest._types.ConvertProcessor': 'ingest/_types/Processors.ts#L672-L692', 'ingest._types.ConvertType': 'ingest/_types/Processors.ts#L661-L670', 'ingest._types.CsvProcessor': 'ingest/_types/Processors.ts#L694-L727', -'ingest._types.DatabaseConfiguration': 'ingest/_types/Database.ts#L22-L29', +'ingest._types.DatabaseConfiguration': 'ingest/_types/Database.ts#L22-L37', +'ingest._types.DatabaseConfigurationFull': 'ingest/_types/Database.ts#L39-L53', 'ingest._types.DateIndexNameProcessor': 'ingest/_types/Processors.ts#L729-L767', 'ingest._types.DateProcessor': 'ingest/_types/Processors.ts#L769-L802', 'ingest._types.DissectProcessor': 'ingest/_types/Processors.ts#L804-L823', @@ -1731,12 +1731,14 @@ 'ingest._types.InferenceConfigRegression': 'ingest/_types/Processors.ts#L1062-L1073', 'ingest._types.InferenceProcessor': 'ingest/_types/Processors.ts#L1027-L1046', 'ingest._types.IpLocationProcessor': 'ingest/_types/Processors.ts#L478-L512', +'ingest._types.Ipinfo': 'ingest/_types/Database.ts#L59-L59', 'ingest._types.JoinProcessor': 'ingest/_types/Processors.ts#L1103-L1118', 'ingest._types.JsonProcessor': 'ingest/_types/Processors.ts#L1120-L1149', 'ingest._types.JsonProcessorConflictStrategy': 'ingest/_types/Processors.ts#L1151-L1156', 'ingest._types.KeyValueProcessor': 'ingest/_types/Processors.ts#L1158-L1210', +'ingest._types.Local': 'ingest/_types/Database.ts#L63-L65', 'ingest._types.LowercaseProcessor': 'ingest/_types/Processors.ts#L1212-L1228', -'ingest._types.Maxmind': 'ingest/_types/Database.ts#L31-L33', +'ingest._types.Maxmind': 'ingest/_types/Database.ts#L55-L57', 'ingest._types.NetworkDirectionProcessor': 'ingest/_types/Processors.ts#L1230-L1264', 'ingest._types.Pipeline': 'ingest/_types/Pipeline.ts#L23-L51', 'ingest._types.PipelineProcessor': 'ingest/_types/Processors.ts#L1266-L1277', @@ -1760,8 +1762,11 @@ 'ingest._types.UrlDecodeProcessor': 'ingest/_types/Processors.ts#L1561-L1577', 'ingest._types.UserAgentProcessor': 'ingest/_types/Processors.ts#L514-L545', 'ingest._types.UserAgentProperty': 'ingest/_types/Processors.ts#L547-L553', +'ingest._types.Web': 'ingest/_types/Database.ts#L61-L61', 'ingest.delete_geoip_database.Request': 'ingest/delete_geoip_database/DeleteGeoipDatabaseRequest.ts#L24-L49', 'ingest.delete_geoip_database.Response': 'ingest/delete_geoip_database/DeleteGeoipDatabaseResponse.ts#L22-L24', +'ingest.delete_ip_location_database.Request': 'ingest/delete_ip_location_database/DeleteIpLocationDatabaseRequest.ts#L24-L48', +'ingest.delete_ip_location_database.Response': 'ingest/delete_ip_location_database/DeleteIpLocationDatabaseResponse.ts#L22-L24', 'ingest.delete_pipeline.Request': 'ingest/delete_pipeline/DeletePipelineRequest.ts#L24-L54', 'ingest.delete_pipeline.Response': 'ingest/delete_pipeline/DeletePipelineResponse.ts#L22-L24', 'ingest.geo_ip_stats.GeoIpDownloadStatistics': 'ingest/geo_ip_stats/types.ts#L24-L37', @@ -1772,12 +1777,17 @@ 'ingest.get_geoip_database.DatabaseConfigurationMetadata': 'ingest/get_geoip_database/GetGeoipDatabaseResponse.ts#L29-L34', 'ingest.get_geoip_database.Request': 'ingest/get_geoip_database/GetGeoipDatabaseRequest.ts#L24-L47', 'ingest.get_geoip_database.Response': 'ingest/get_geoip_database/GetGeoipDatabaseResponse.ts#L25-L27', +'ingest.get_ip_location_database.DatabaseConfigurationMetadata': 'ingest/get_ip_location_database/GetIpLocationDatabaseResponse.ts#L28-L34', +'ingest.get_ip_location_database.Request': 'ingest/get_ip_location_database/GetIpLocationDatabaseRequest.ts#L24-L46', +'ingest.get_ip_location_database.Response': 'ingest/get_ip_location_database/GetIpLocationDatabaseResponse.ts#L24-L26', 'ingest.get_pipeline.Request': 'ingest/get_pipeline/GetPipelineRequest.ts#L24-L52', 'ingest.get_pipeline.Response': 'ingest/get_pipeline/GetPipelineResponse.ts#L23-L26', 'ingest.processor_grok.Request': 'ingest/processor_grok/GrokProcessorPatternsRequest.ts#L22-L33', 'ingest.processor_grok.Response': 'ingest/processor_grok/GrokProcessorPatternsResponse.ts#L22-L24', 'ingest.put_geoip_database.Request': 'ingest/put_geoip_database/PutGeoipDatabaseRequest.ts#L25-L58', 'ingest.put_geoip_database.Response': 'ingest/put_geoip_database/PutGeoipDatabaseResponse.ts#L22-L24', +'ingest.put_ip_location_database.Request': 'ingest/put_ip_location_database/PutIpLocationDatabaseRequest.ts#L25-L51', +'ingest.put_ip_location_database.Response': 'ingest/put_ip_location_database/PutIpLocationDatabaseResponse.ts#L22-L24', 'ingest.put_pipeline.Request': 'ingest/put_pipeline/PutPipelineRequest.ts#L25-L84', 'ingest.put_pipeline.Response': 'ingest/put_pipeline/PutPipelineResponse.ts#L22-L24', 'ingest.simulate.Document': 'ingest/simulate/types.ts#L62-L76', @@ -2716,18 +2726,18 @@ 'tasks._types.GroupBy': 'tasks/_types/GroupBy.ts#L20-L27', 'tasks._types.NodeTasks': 'tasks/_types/TaskListResponseBase.ts#L49-L57', 'tasks._types.ParentTaskInfo': 'tasks/_types/TaskListResponseBase.ts#L45-L47', -'tasks._types.TaskInfo': 'tasks/_types/TaskInfo.ts#L32-L47', +'tasks._types.TaskInfo': 'tasks/_types/TaskInfo.ts#L32-L58', 'tasks._types.TaskInfos': 'tasks/_types/TaskListResponseBase.ts#L40-L43', 'tasks._types.TaskListResponseBase': 'tasks/_types/TaskListResponseBase.ts#L26-L38', -'tasks.cancel.Request': 'tasks/cancel/CancelTasksRequest.ts#L23-L51', +'tasks.cancel.Request': 'tasks/cancel/CancelTasksRequest.ts#L23-L59', 'tasks.cancel.Response': 'tasks/cancel/CancelTasksResponse.ts#L22-L24', 'tasks.get.Request': 'tasks/get/GetTaskRequest.ts#L24-L52', 'tasks.get.Response': 'tasks/get/GetTaskResponse.ts#L24-L31', -'tasks.list.Request': 'tasks/list/ListTasksRequest.ts#L25-L72', +'tasks.list.Request': 'tasks/list/ListTasksRequest.ts#L25-L74', 'tasks.list.Response': 'tasks/list/ListTasksResponse.ts#L22-L24', 'text_structure.test_grok_pattern.MatchedField': 'text_structure/test_grok_pattern/types.ts#L23-L27', 'text_structure.test_grok_pattern.MatchedText': 'text_structure/test_grok_pattern/types.ts#L29-L32', -'text_structure.test_grok_pattern.Request': 'text_structure/test_grok_pattern/TestGrokPatternRequest.ts#L23-L44', +'text_structure.test_grok_pattern.Request': 'text_structure/test_grok_pattern/TestGrokPatternRequest.ts#L23-L48', 'text_structure.test_grok_pattern.Response': 'text_structure/test_grok_pattern/TestGrokPatternResponse.ts#L22-L26', 'transform._types.Destination': 'transform/_types/Transform.ts#L34-L45', 'transform._types.Latest': 'transform/_types/Transform.ts#L47-L52', @@ -2766,7 +2776,7 @@ 'transform.stop_transform.Response': 'transform/stop_transform/StopTransformResponse.ts#L22-L24', 'transform.update_transform.Request': 'transform/update_transform/UpdateTransformRequest.ts#L31-L106', 'transform.update_transform.Response': 'transform/update_transform/UpdateTransformResponse.ts#L33-L51', -'transform.upgrade_transforms.Request': 'transform/upgrade_transforms/UpgradeTransformsRequest.ts#L23-L49', +'transform.upgrade_transforms.Request': 'transform/upgrade_transforms/UpgradeTransformsRequest.ts#L23-L57', 'transform.upgrade_transforms.Response': 'transform/upgrade_transforms/UpgradeTransformsResponse.ts#L25-L34', 'watcher._types.AcknowledgeState': 'watcher/_types/Action.ts#L109-L112', 'watcher._types.AcknowledgementOptions': 'watcher/_types/Action.ts#L103-L107', @@ -2860,42 +2870,42 @@ 'watcher._types.WatchStatus': 'watcher/_types/Watch.ts#L49-L56', 'watcher._types.WebhookAction': 'watcher/_types/Actions.ts#L293-L293', 'watcher._types.WebhookResult': 'watcher/_types/Actions.ts#L295-L298', -'watcher.ack_watch.Request': 'watcher/ack_watch/WatcherAckWatchRequest.ts#L23-L32', +'watcher.ack_watch.Request': 'watcher/ack_watch/WatcherAckWatchRequest.ts#L23-L40', 'watcher.ack_watch.Response': 'watcher/ack_watch/WatcherAckWatchResponse.ts#L22-L24', -'watcher.activate_watch.Request': 'watcher/activate_watch/WatcherActivateWatchRequest.ts#L23-L31', +'watcher.activate_watch.Request': 'watcher/activate_watch/WatcherActivateWatchRequest.ts#L23-L35', 'watcher.activate_watch.Response': 'watcher/activate_watch/WatcherActivateWatchResponse.ts#L22-L24', -'watcher.deactivate_watch.Request': 'watcher/deactivate_watch/DeactivateWatchRequest.ts#L23-L31', +'watcher.deactivate_watch.Request': 'watcher/deactivate_watch/DeactivateWatchRequest.ts#L23-L35', 'watcher.deactivate_watch.Response': 'watcher/deactivate_watch/DeactivateWatchResponse.ts#L22-L24', -'watcher.delete_watch.Request': 'watcher/delete_watch/DeleteWatchRequest.ts#L23-L31', +'watcher.delete_watch.Request': 'watcher/delete_watch/DeleteWatchRequest.ts#L23-L40', 'watcher.delete_watch.Response': 'watcher/delete_watch/DeleteWatchResponse.ts#L22-L24', -'watcher.execute_watch.Request': 'watcher/execute_watch/WatcherExecuteWatchRequest.ts#L28-L79', +'watcher.execute_watch.Request': 'watcher/execute_watch/WatcherExecuteWatchRequest.ts#L28-L86', 'watcher.execute_watch.Response': 'watcher/execute_watch/WatcherExecuteWatchResponse.ts#L23-L25', 'watcher.execute_watch.WatchRecord': 'watcher/execute_watch/types.ts#L27-L39', -'watcher.get_watch.Request': 'watcher/get_watch/GetWatchRequest.ts#L23-L31', +'watcher.get_watch.Request': 'watcher/get_watch/GetWatchRequest.ts#L23-L33', 'watcher.get_watch.Response': 'watcher/get_watch/GetWatchResponse.ts#L24-L34', -'watcher.put_watch.Request': 'watcher/put_watch/WatcherPutWatchRequest.ts#L30-L53', +'watcher.put_watch.Request': 'watcher/put_watch/WatcherPutWatchRequest.ts#L30-L66', 'watcher.put_watch.Response': 'watcher/put_watch/WatcherPutWatchResponse.ts#L23-L31', -'watcher.query_watches.Request': 'watcher/query_watches/WatcherQueryWatchesRequest.ts#L25-L48', +'watcher.query_watches.Request': 'watcher/query_watches/WatcherQueryWatchesRequest.ts#L25-L51', 'watcher.query_watches.Response': 'watcher/query_watches/WatcherQueryWatchesResponse.ts#L23-L28', -'watcher.start.Request': 'watcher/start/WatcherStartRequest.ts#L22-L26', +'watcher.start.Request': 'watcher/start/WatcherStartRequest.ts#L22-L29', 'watcher.start.Response': 'watcher/start/WatcherStartResponse.ts#L22-L24', -'watcher.stats.Request': 'watcher/stats/WatcherStatsRequest.ts#L23-L45', +'watcher.stats.Request': 'watcher/stats/WatcherStatsRequest.ts#L23-L47', 'watcher.stats.Response': 'watcher/stats/WatcherStatsResponse.ts#L24-L32', 'watcher.stats.WatchRecordQueuedStats': 'watcher/stats/types.ts#L50-L52', 'watcher.stats.WatchRecordStats': 'watcher/stats/types.ts#L54-L60', 'watcher.stats.WatcherMetric': 'watcher/stats/types.ts#L42-L48', 'watcher.stats.WatcherNodeStats': 'watcher/stats/types.ts#L33-L40', 'watcher.stats.WatcherState': 'watcher/stats/types.ts#L26-L31', -'watcher.stop.Request': 'watcher/stop/WatcherStopRequest.ts#L22-L26', +'watcher.stop.Request': 'watcher/stop/WatcherStopRequest.ts#L22-L29', 'watcher.stop.Response': 'watcher/stop/WatcherStopResponse.ts#L22-L24', 'xpack.info.BuildInformation': 'xpack/info/types.ts#L24-L27', 'xpack.info.Feature': 'xpack/info/types.ts#L85-L90', 'xpack.info.Features': 'xpack/info/types.ts#L42-L83', 'xpack.info.MinimalLicenseInformation': 'xpack/info/types.ts#L34-L40', 'xpack.info.NativeCodeInformation': 'xpack/info/types.ts#L29-L32', -'xpack.info.Request': 'xpack/info/XPackInfoRequest.ts#L22-L42', +'xpack.info.Request': 'xpack/info/XPackInfoRequest.ts#L22-L47', 'xpack.info.Response': 'xpack/info/XPackInfoResponse.ts#L22-L29', -'xpack.info.XPackCategory': 'xpack/info/XPackInfoRequest.ts#L44-L48', +'xpack.info.XPackCategory': 'xpack/info/XPackInfoRequest.ts#L49-L53', 'xpack.usage.Analytics': 'xpack/usage/types.ts#L328-L330', 'xpack.usage.AnalyticsStatistics': 'xpack/usage/types.ts#L59-L69', 'xpack.usage.Archive': 'xpack/usage/types.ts#L46-L48', @@ -2940,7 +2950,7 @@ 'xpack.usage.Query': 'xpack/usage/types.ts#L257-L262', 'xpack.usage.Realm': 'xpack/usage/types.ts#L415-L424', 'xpack.usage.RealmCache': 'xpack/usage/types.ts#L264-L266', -'xpack.usage.Request': 'xpack/usage/XPackUsageRequest.ts#L23-L38', +'xpack.usage.Request': 'xpack/usage/XPackUsageRequest.ts#L23-L40', 'xpack.usage.Response': 'xpack/usage/XPackUsageResponse.ts#L43-L79', 'xpack.usage.RoleMapping': 'xpack/usage/types.ts#L268-L271', 'xpack.usage.RuntimeFieldTypes': 'xpack/usage/types.ts#L273-L275', @@ -2967,10 +2977,10 @@ if (hash.length > 1) { hash = hash.substring(1); } - window.location = "https://github.com/elastic/elasticsearch-specification/tree/fd5d7cff3f7e72348ac3ebf32bfadd7be9243b86/specification/" + (paths[hash] || ""); + window.location = "https://github.com/elastic/elasticsearch-specification/tree/435b8e796d89e583c87334292c08b4e366d8abfb/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/eql/EqlSearchRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/eql/EqlSearchRequest.java index 603e1074b..3ca8368a6 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/eql/EqlSearchRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/eql/EqlSearchRequest.java @@ -80,6 +80,12 @@ public class EqlSearchRequest extends RequestBase implements JsonpSerializable { @Nullable private final Boolean allowNoIndices; + @Nullable + private final Boolean allowPartialSearchResults; + + @Nullable + private final Boolean allowPartialSequenceResults; + @Nullable private final Boolean caseSensitive; @@ -133,6 +139,8 @@ public class EqlSearchRequest extends RequestBase implements JsonpSerializable { private EqlSearchRequest(Builder builder) { this.allowNoIndices = builder.allowNoIndices; + this.allowPartialSearchResults = builder.allowPartialSearchResults; + this.allowPartialSequenceResults = builder.allowPartialSequenceResults; this.caseSensitive = builder.caseSensitive; this.eventCategoryField = builder.eventCategoryField; this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); @@ -166,6 +174,22 @@ public final Boolean allowNoIndices() { return this.allowNoIndices; } + /** + * API name: {@code allow_partial_search_results} + */ + @Nullable + public final Boolean allowPartialSearchResults() { + return this.allowPartialSearchResults; + } + + /** + * API name: {@code allow_partial_sequence_results} + */ + @Nullable + public final Boolean allowPartialSequenceResults() { + return this.allowPartialSequenceResults; + } + /** * API name: {@code case_sensitive} */ @@ -345,6 +369,16 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.allowPartialSearchResults != null) { + generator.writeKey("allow_partial_search_results"); + generator.write(this.allowPartialSearchResults); + + } + if (this.allowPartialSequenceResults != null) { + generator.writeKey("allow_partial_sequence_results"); + generator.write(this.allowPartialSequenceResults); + + } if (this.caseSensitive != null) { generator.writeKey("case_sensitive"); generator.write(this.caseSensitive); @@ -448,6 +482,12 @@ public static class Builder extends RequestBase.AbstractBuilder @Nullable private Boolean allowNoIndices; + @Nullable + private Boolean allowPartialSearchResults; + + @Nullable + private Boolean allowPartialSequenceResults; + @Nullable private Boolean caseSensitive; @@ -508,6 +548,22 @@ public final Builder allowNoIndices(@Nullable Boolean value) { return this; } + /** + * API name: {@code allow_partial_search_results} + */ + public final Builder allowPartialSearchResults(@Nullable Boolean value) { + this.allowPartialSearchResults = value; + return this; + } + + /** + * API name: {@code allow_partial_sequence_results} + */ + public final Builder allowPartialSequenceResults(@Nullable Boolean value) { + this.allowPartialSequenceResults = value; + return this; + } + /** * API name: {@code case_sensitive} */ @@ -826,6 +882,10 @@ public EqlSearchRequest build() { protected static void setupEqlSearchRequestDeserializer(ObjectDeserializer op) { + op.add(Builder::allowPartialSearchResults, JsonpDeserializer.booleanDeserializer(), + "allow_partial_search_results"); + op.add(Builder::allowPartialSequenceResults, JsonpDeserializer.booleanDeserializer(), + "allow_partial_sequence_results"); op.add(Builder::caseSensitive, JsonpDeserializer.booleanDeserializer(), "case_sensitive"); op.add(Builder::eventCategoryField, JsonpDeserializer.stringDeserializer(), "event_category_field"); op.add(Builder::fetchSize, JsonpDeserializer.numberDeserializer(), "fetch_size"); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DatabaseConfiguration.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DatabaseConfiguration.java index 63a428ed8..0314ef484 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DatabaseConfiguration.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DatabaseConfiguration.java @@ -19,6 +19,7 @@ package co.elastic.clients.elasticsearch.ingest; +import co.elastic.clients.json.JsonEnum; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -28,8 +29,11 @@ import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.TaggedUnion; +import co.elastic.clients.util.TaggedUnionUtils; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; +import java.lang.Object; import java.lang.String; import java.util.Objects; import java.util.function.Function; @@ -53,23 +57,69 @@ // typedef: ingest._types.DatabaseConfiguration /** - * + * The configuration necessary to identify which IP geolocation provider to use + * to download a database, as well as any provider-specific configuration + * necessary for such downloading. At present, the only supported providers are + * maxmind and ipinfo, and the maxmind provider requires that an account_id + * (string) is configured. A provider (either maxmind or ipinfo) must be + * specified. The web and local providers can be returned as read only + * configurations. + * * @see API * specification */ @JsonpDeserializable -public class DatabaseConfiguration implements JsonpSerializable { - private final String name; +public class DatabaseConfiguration implements TaggedUnion, JsonpSerializable { + + /** + * {@link DatabaseConfiguration} variant kinds. + * + * @see API + * specification + */ - private final Maxmind maxmind; + public enum Kind implements JsonEnum { + Maxmind("maxmind"), - // --------------------------------------------------------------------------------------------- + Ipinfo("ipinfo"), + + ; + + private final String jsonValue; + + Kind(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + } + + private final Kind _kind; + private final Object _value; + + @Override + public final Kind _kind() { + return _kind; + } + + @Override + public final Object _get() { + return _value; + } + + private final String name; private DatabaseConfiguration(Builder builder) { + this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); + this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.maxmind = ApiTypeHelper.requireNonNull(builder.maxmind, this, "maxmind"); } @@ -88,34 +138,54 @@ public final String name() { } /** - * Required - The configuration necessary to identify which IP geolocation - * provider to use to download the database, as well as any provider-specific - * configuration necessary for such downloading. At present, the only supported - * provider is maxmind, and the maxmind provider requires that an account_id - * (string) is configured. - *

- * API name: {@code maxmind} + * Is this variant instance of kind {@code maxmind}? */ - public final Maxmind maxmind() { - return this.maxmind; + public boolean isMaxmind() { + return _kind == Kind.Maxmind; } /** - * Serialize this object to JSON. + * Get the {@code maxmind} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code maxmind} kind. */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); + public Maxmind maxmind() { + return TaggedUnionUtils.get(this, Kind.Maxmind); + } + + /** + * Is this variant instance of kind {@code ipinfo}? + */ + public boolean isIpinfo() { + return _kind == Kind.Ipinfo; } - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + /** + * Get the {@code ipinfo} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code ipinfo} kind. + */ + public Ipinfo ipinfo() { + return TaggedUnionUtils.get(this, Kind.Ipinfo); + } + + @Override + @SuppressWarnings("unchecked") + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + + generator.writeStartObject(); generator.writeKey("name"); generator.write(this.name); - generator.writeKey("maxmind"); - this.maxmind.serialize(generator, mapper); + generator.writeKey(_kind.jsonValue()); + if (_value instanceof JsonpSerializable) { + ((JsonpSerializable) _value).serialize(generator, mapper); + } + + generator.writeEnd(); } @@ -124,18 +194,13 @@ public String toString() { return JsonpUtils.toString(this); } - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DatabaseConfiguration}. - */ - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private String name; + private Kind _kind; + private Object _value; - private Maxmind maxmind; + private String name; /** * Required - The provider-assigned name of the IP geolocation database to @@ -148,64 +213,62 @@ public final Builder name(String value) { return this; } - /** - * Required - The configuration necessary to identify which IP geolocation - * provider to use to download the database, as well as any provider-specific - * configuration necessary for such downloading. At present, the only supported - * provider is maxmind, and the maxmind provider requires that an account_id - * (string) is configured. - *

- * API name: {@code maxmind} - */ - public final Builder maxmind(Maxmind value) { - this.maxmind = value; + @Override + protected Builder self() { return this; } + public ContainerBuilder maxmind(Maxmind v) { + this._kind = Kind.Maxmind; + this._value = v; + return new ContainerBuilder(); + } - /** - * Required - The configuration necessary to identify which IP geolocation - * provider to use to download the database, as well as any provider-specific - * configuration necessary for such downloading. At present, the only supported - * provider is maxmind, and the maxmind provider requires that an account_id - * (string) is configured. - *

- * API name: {@code maxmind} - */ - public final Builder maxmind(Function> fn) { + public ContainerBuilder maxmind(Function> fn) { return this.maxmind(fn.apply(new Maxmind.Builder()).build()); } - @Override - protected Builder self() { - return this; + public ContainerBuilder ipinfo(Ipinfo v) { + this._kind = Kind.Ipinfo; + this._value = v; + return new ContainerBuilder(); + } + + public ContainerBuilder ipinfo(Function> fn) { + return this.ipinfo(fn.apply(new Ipinfo.Builder()).build()); } - /** - * Builds a {@link DatabaseConfiguration}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ public DatabaseConfiguration build() { _checkSingleUse(); - return new DatabaseConfiguration(this); } - } - - // --------------------------------------------------------------------------------------------- - /** - * Json deserializer for {@link DatabaseConfiguration} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, DatabaseConfiguration::setupDatabaseConfigurationDeserializer); + public class ContainerBuilder implements ObjectBuilder { + + /** + * Required - The provider-assigned name of the IP geolocation database to + * download. + *

+ * API name: {@code name} + */ + public final ContainerBuilder name(String value) { + Builder.this.name = value; + return this; + } + + public DatabaseConfiguration build() { + return Builder.this.build(); + } + } + } - protected static void setupDatabaseConfigurationDeserializer(ObjectDeserializer op) { + protected static void setupDatabaseConfigurationDeserializer(ObjectDeserializer op) { op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); op.add(Builder::maxmind, Maxmind._DESERIALIZER, "maxmind"); + op.add(Builder::ipinfo, Ipinfo._DESERIALIZER, "ipinfo"); } + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DatabaseConfiguration::setupDatabaseConfigurationDeserializer, Builder::build); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DatabaseConfigurationBuilders.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DatabaseConfigurationBuilders.java new file mode 100644 index 000000000..17cbd004c --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DatabaseConfigurationBuilders.java @@ -0,0 +1,83 @@ +/* + * 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.ingest; + +import co.elastic.clients.util.ObjectBuilder; +import java.util.function.Function; + +//---------------------------------------------------------------- +// 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. +// +//---------------------------------------------------------------- + +/** + * Builders for {@link DatabaseConfiguration} variants. + */ +public class DatabaseConfigurationBuilders { + private DatabaseConfigurationBuilders() { + } + + /** + * Creates a builder for the {@link Maxmind maxmind} + * {@code DatabaseConfiguration} variant. + */ + public static Maxmind.Builder maxmind() { + return new Maxmind.Builder(); + } + + /** + * Creates a DatabaseConfiguration of the {@link Maxmind maxmind} + * {@code DatabaseConfiguration} variant. + */ + public static DatabaseConfiguration maxmind(Function> fn) { + DatabaseConfiguration.Builder builder = new DatabaseConfiguration.Builder(); + builder.maxmind(fn.apply(new Maxmind.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link Ipinfo ipinfo} {@code DatabaseConfiguration} + * variant. + */ + public static Ipinfo.Builder ipinfo() { + return new Ipinfo.Builder(); + } + + /** + * Creates a DatabaseConfiguration of the {@link Ipinfo ipinfo} + * {@code DatabaseConfiguration} variant. + */ + public static DatabaseConfiguration ipinfo(Function> fn) { + DatabaseConfiguration.Builder builder = new DatabaseConfiguration.Builder(); + builder.ipinfo(fn.apply(new Ipinfo.Builder()).build()); + return builder.build(); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DatabaseConfigurationFull.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DatabaseConfigurationFull.java new file mode 100644 index 000000000..4c7c399a9 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DatabaseConfigurationFull.java @@ -0,0 +1,330 @@ +/* + * 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.ingest; + +import co.elastic.clients.json.JsonEnum; +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.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.TaggedUnion; +import co.elastic.clients.util.TaggedUnionUtils; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Object; +import java.lang.String; +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: ingest._types.DatabaseConfigurationFull + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DatabaseConfigurationFull + implements + TaggedUnion, + JsonpSerializable { + + /** + * {@link DatabaseConfigurationFull} variant kinds. + * + * @see API + * specification + */ + + public enum Kind implements JsonEnum { + Web("web"), + + Local("local"), + + Maxmind("maxmind"), + + Ipinfo("ipinfo"), + + ; + + private final String jsonValue; + + Kind(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + } + + private final Kind _kind; + private final Object _value; + + @Override + public final Kind _kind() { + return _kind; + } + + @Override + public final Object _get() { + return _value; + } + + private final String name; + + private DatabaseConfigurationFull(Builder builder) { + + this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); + this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); + + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + + } + + public static DatabaseConfigurationFull of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - The provider-assigned name of the IP geolocation database to + * download. + *

+ * API name: {@code name} + */ + public final String name() { + return this.name; + } + + /** + * Is this variant instance of kind {@code web}? + */ + public boolean isWeb() { + return _kind == Kind.Web; + } + + /** + * Get the {@code web} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code web} kind. + */ + public Web web() { + return TaggedUnionUtils.get(this, Kind.Web); + } + + /** + * Is this variant instance of kind {@code local}? + */ + public boolean isLocal() { + return _kind == Kind.Local; + } + + /** + * Get the {@code local} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code local} kind. + */ + public Local local() { + return TaggedUnionUtils.get(this, Kind.Local); + } + + /** + * Is this variant instance of kind {@code maxmind}? + */ + public boolean isMaxmind() { + return _kind == Kind.Maxmind; + } + + /** + * Get the {@code maxmind} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code maxmind} kind. + */ + public Maxmind maxmind() { + return TaggedUnionUtils.get(this, Kind.Maxmind); + } + + /** + * Is this variant instance of kind {@code ipinfo}? + */ + public boolean isIpinfo() { + return _kind == Kind.Ipinfo; + } + + /** + * Get the {@code ipinfo} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code ipinfo} kind. + */ + public Ipinfo ipinfo() { + return TaggedUnionUtils.get(this, Kind.Ipinfo); + } + + @Override + @SuppressWarnings("unchecked") + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + + generator.writeStartObject(); + + generator.writeKey("name"); + generator.write(this.name); + + generator.writeKey(_kind.jsonValue()); + if (_value instanceof JsonpSerializable) { + ((JsonpSerializable) _value).serialize(generator, mapper); + } + + generator.writeEnd(); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private Kind _kind; + private Object _value; + + private String name; + + /** + * Required - The provider-assigned name of the IP geolocation database to + * download. + *

+ * API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + public ContainerBuilder web(Web v) { + this._kind = Kind.Web; + this._value = v; + return new ContainerBuilder(); + } + + public ContainerBuilder web(Function> fn) { + return this.web(fn.apply(new Web.Builder()).build()); + } + + public ContainerBuilder local(Local v) { + this._kind = Kind.Local; + this._value = v; + return new ContainerBuilder(); + } + + public ContainerBuilder local(Function> fn) { + return this.local(fn.apply(new Local.Builder()).build()); + } + + public ContainerBuilder maxmind(Maxmind v) { + this._kind = Kind.Maxmind; + this._value = v; + return new ContainerBuilder(); + } + + public ContainerBuilder maxmind(Function> fn) { + return this.maxmind(fn.apply(new Maxmind.Builder()).build()); + } + + public ContainerBuilder ipinfo(Ipinfo v) { + this._kind = Kind.Ipinfo; + this._value = v; + return new ContainerBuilder(); + } + + public ContainerBuilder ipinfo(Function> fn) { + return this.ipinfo(fn.apply(new Ipinfo.Builder()).build()); + } + + public DatabaseConfigurationFull build() { + _checkSingleUse(); + return new DatabaseConfigurationFull(this); + } + + public class ContainerBuilder implements ObjectBuilder { + + /** + * Required - The provider-assigned name of the IP geolocation database to + * download. + *

+ * API name: {@code name} + */ + public final ContainerBuilder name(String value) { + Builder.this.name = value; + return this; + } + + public DatabaseConfigurationFull build() { + return Builder.this.build(); + } + } + } + + protected static void setupDatabaseConfigurationFullDeserializer(ObjectDeserializer op) { + + op.add(Builder::web, Web._DESERIALIZER, "web"); + op.add(Builder::local, Local._DESERIALIZER, "local"); + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::maxmind, Maxmind._DESERIALIZER, "maxmind"); + op.add(Builder::ipinfo, Ipinfo._DESERIALIZER, "ipinfo"); + + } + + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DatabaseConfigurationFull::setupDatabaseConfigurationFullDeserializer, Builder::build); +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DatabaseConfigurationFullBuilders.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DatabaseConfigurationFullBuilders.java new file mode 100644 index 000000000..f1b483a30 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DatabaseConfigurationFullBuilders.java @@ -0,0 +1,119 @@ +/* + * 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.ingest; + +import co.elastic.clients.util.ObjectBuilder; +import java.util.function.Function; + +//---------------------------------------------------------------- +// 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. +// +//---------------------------------------------------------------- + +/** + * Builders for {@link DatabaseConfigurationFull} variants. + */ +public class DatabaseConfigurationFullBuilders { + private DatabaseConfigurationFullBuilders() { + } + + /** + * Creates a builder for the {@link Web web} {@code DatabaseConfigurationFull} + * variant. + */ + public static Web.Builder web() { + return new Web.Builder(); + } + + /** + * Creates a DatabaseConfigurationFull of the {@link Web web} + * {@code DatabaseConfigurationFull} variant. + */ + public static DatabaseConfigurationFull web(Function> fn) { + DatabaseConfigurationFull.Builder builder = new DatabaseConfigurationFull.Builder(); + builder.web(fn.apply(new Web.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link Local local} + * {@code DatabaseConfigurationFull} variant. + */ + public static Local.Builder local() { + return new Local.Builder(); + } + + /** + * Creates a DatabaseConfigurationFull of the {@link Local local} + * {@code DatabaseConfigurationFull} variant. + */ + public static DatabaseConfigurationFull local(Function> fn) { + DatabaseConfigurationFull.Builder builder = new DatabaseConfigurationFull.Builder(); + builder.local(fn.apply(new Local.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link Maxmind maxmind} + * {@code DatabaseConfigurationFull} variant. + */ + public static Maxmind.Builder maxmind() { + return new Maxmind.Builder(); + } + + /** + * Creates a DatabaseConfigurationFull of the {@link Maxmind maxmind} + * {@code DatabaseConfigurationFull} variant. + */ + public static DatabaseConfigurationFull maxmind(Function> fn) { + DatabaseConfigurationFull.Builder builder = new DatabaseConfigurationFull.Builder(); + builder.maxmind(fn.apply(new Maxmind.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link Ipinfo ipinfo} + * {@code DatabaseConfigurationFull} variant. + */ + public static Ipinfo.Builder ipinfo() { + return new Ipinfo.Builder(); + } + + /** + * Creates a DatabaseConfigurationFull of the {@link Ipinfo ipinfo} + * {@code DatabaseConfigurationFull} variant. + */ + public static DatabaseConfigurationFull ipinfo(Function> fn) { + DatabaseConfigurationFull.Builder builder = new DatabaseConfigurationFull.Builder(); + builder.ipinfo(fn.apply(new Ipinfo.Builder()).build()); + return builder.build(); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DatabaseConfigurationFullVariant.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DatabaseConfigurationFullVariant.java new file mode 100644 index 000000000..01146affb --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DatabaseConfigurationFullVariant.java @@ -0,0 +1,44 @@ +/* + * 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.ingest; + +//---------------------------------------------------------------- +// 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. +// +//---------------------------------------------------------------- + +/** + * Base interface for {@link DatabaseConfigurationFull} variants. + */ +public interface DatabaseConfigurationFullVariant { + + DatabaseConfigurationFull.Kind _databaseConfigurationFullKind(); + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DatabaseConfigurationVariant.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DatabaseConfigurationVariant.java new file mode 100644 index 000000000..88232446f --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DatabaseConfigurationVariant.java @@ -0,0 +1,44 @@ +/* + * 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.ingest; + +//---------------------------------------------------------------- +// 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. +// +//---------------------------------------------------------------- + +/** + * Base interface for {@link DatabaseConfiguration} variants. + */ +public interface DatabaseConfigurationVariant { + + DatabaseConfiguration.Kind _databaseConfigurationKind(); + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DeleteIpLocationDatabaseRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DeleteIpLocationDatabaseRequest.java new file mode 100644 index 000000000..9fbffa205 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DeleteIpLocationDatabaseRequest.java @@ -0,0 +1,289 @@ +/* + * 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.ingest; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.RequestBase; +import co.elastic.clients.elasticsearch._types.Time; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.transport.Endpoint; +import co.elastic.clients.transport.endpoints.SimpleEndpoint; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import java.util.stream.Collectors; +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: ingest.delete_ip_location_database.Request + +/** + * Deletes an IP location database configuration. + * + * @see API + * specification + */ + +public class DeleteIpLocationDatabaseRequest extends RequestBase { + private final List id; + + @Nullable + private final Time masterTimeout; + + @Nullable + private final Time timeout; + + // --------------------------------------------------------------------------------------------- + + private DeleteIpLocationDatabaseRequest(Builder builder) { + + this.id = ApiTypeHelper.unmodifiableRequired(builder.id, this, "id"); + this.masterTimeout = builder.masterTimeout; + this.timeout = builder.timeout; + + } + + public static DeleteIpLocationDatabaseRequest of( + Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - A comma-separated list of IP location database configurations to + * delete + *

+ * API name: {@code id} + */ + public final List id() { + return this.id; + } + + /** + * Period to wait for a connection to the master node. If no response is + * received before the timeout expires, the request fails and returns an error. + *

+ * API name: {@code master_timeout} + */ + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + /** + * Period to wait for a response. If no response is received before the timeout + * expires, the request fails and returns an error. + *

+ * API name: {@code timeout} + */ + @Nullable + public final Time timeout() { + return this.timeout; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DeleteIpLocationDatabaseRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + private List id; + + @Nullable + private Time masterTimeout; + + @Nullable + private Time timeout; + + /** + * Required - A comma-separated list of IP location database configurations to + * delete + *

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

+ * Adds all elements of list to id. + */ + public final Builder id(List list) { + this.id = _listAddAll(this.id, list); + return this; + } + + /** + * Required - A comma-separated list of IP location database configurations to + * delete + *

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

+ * Adds one or more values to id. + */ + public final Builder id(String value, String... values) { + this.id = _listAdd(this.id, value, values); + return this; + } + + /** + * Period to wait for a connection to the master node. If no response is + * received before the timeout expires, the request fails and returns an error. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * Period to wait for a connection to the master node. If no response is + * received before the timeout expires, the request fails and returns an error. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(Function> fn) { + return this.masterTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * Period to wait for a response. If no response is received before the timeout + * expires, the request fails and returns an error. + *

+ * API name: {@code timeout} + */ + public final Builder timeout(@Nullable Time value) { + this.timeout = value; + return this; + } + + /** + * Period to wait for a response. If no response is received before the timeout + * expires, the request fails and returns an error. + *

+ * API name: {@code timeout} + */ + public final Builder timeout(Function> fn) { + return this.timeout(fn.apply(new Time.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DeleteIpLocationDatabaseRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DeleteIpLocationDatabaseRequest build() { + _checkSingleUse(); + + return new DeleteIpLocationDatabaseRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code ingest.delete_ip_location_database}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/ingest.delete_ip_location_database", + + // Request method + request -> { + return "DELETE"; + + }, + + // Request path + request -> { + final int _id = 1 << 0; + + int propsSet = 0; + + propsSet |= _id; + + if (propsSet == (_id)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_ingest"); + buf.append("/ip_location"); + buf.append("/database"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.id.stream().map(v -> v).collect(Collectors.joining(",")), buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _id = 1 << 0; + + int propsSet = 0; + + propsSet |= _id; + + if (propsSet == (_id)) { + params.put("id", request.id.stream().map(v -> v).collect(Collectors.joining(","))); + } + return params; + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } + if (request.timeout != null) { + params.put("timeout", request.timeout._toJsonString()); + } + return params; + + }, SimpleEndpoint.emptyMap(), false, DeleteIpLocationDatabaseResponse._DESERIALIZER); +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DeleteIpLocationDatabaseResponse.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DeleteIpLocationDatabaseResponse.java new file mode 100644 index 000000000..8c2b16082 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DeleteIpLocationDatabaseResponse.java @@ -0,0 +1,110 @@ +/* + * 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.ingest; + +import co.elastic.clients.elasticsearch._types.AcknowledgedResponseBase; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; + +//---------------------------------------------------------------- +// 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: ingest.delete_ip_location_database.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DeleteIpLocationDatabaseResponse extends AcknowledgedResponseBase { + // --------------------------------------------------------------------------------------------- + + private DeleteIpLocationDatabaseResponse(Builder builder) { + super(builder); + + } + + public static DeleteIpLocationDatabaseResponse of( + Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DeleteIpLocationDatabaseResponse}. + */ + + public static class Builder extends AcknowledgedResponseBase.AbstractBuilder + implements + ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DeleteIpLocationDatabaseResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DeleteIpLocationDatabaseResponse build() { + _checkSingleUse(); + + return new DeleteIpLocationDatabaseResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DeleteIpLocationDatabaseResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DeleteIpLocationDatabaseResponse::setupDeleteIpLocationDatabaseResponseDeserializer); + + protected static void setupDeleteIpLocationDatabaseResponseDeserializer( + ObjectDeserializer op) { + AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestAsyncClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestAsyncClient.java index f412dfe03..c82e0bfc1 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestAsyncClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestAsyncClient.java @@ -100,6 +100,40 @@ public final CompletableFuture deleteGeoipDatabase( return deleteGeoipDatabase(fn.apply(new DeleteGeoipDatabaseRequest.Builder()).build()); } + // ----- Endpoint: ingest.delete_ip_location_database + + /** + * Deletes an IP location database configuration. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture deleteIpLocationDatabase( + DeleteIpLocationDatabaseRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeleteIpLocationDatabaseRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Deletes an IP location database configuration. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeleteIpLocationDatabaseRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture deleteIpLocationDatabase( + Function> fn) { + return deleteIpLocationDatabase(fn.apply(new DeleteIpLocationDatabaseRequest.Builder()).build()); + } + // ----- Endpoint: ingest.delete_pipeline /** @@ -197,6 +231,53 @@ public CompletableFuture getGeoipDatabase() { GetGeoipDatabaseRequest._ENDPOINT, this.transportOptions); } + // ----- Endpoint: ingest.get_ip_location_database + + /** + * Returns information about one or more IP location database configurations. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture getIpLocationDatabase( + GetIpLocationDatabaseRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetIpLocationDatabaseRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns information about one or more IP location database configurations. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetIpLocationDatabaseRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture getIpLocationDatabase( + Function> fn) { + return getIpLocationDatabase(fn.apply(new GetIpLocationDatabaseRequest.Builder()).build()); + } + + /** + * Returns information about one or more IP location database configurations. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture getIpLocationDatabase() { + return this.transport.performRequestAsync(new GetIpLocationDatabaseRequest.Builder().build(), + GetIpLocationDatabaseRequest._ENDPOINT, this.transportOptions); + } + // ----- Endpoint: ingest.get_pipeline /** @@ -299,6 +380,40 @@ public final CompletableFuture putGeoipDatabase( return putGeoipDatabase(fn.apply(new PutGeoipDatabaseRequest.Builder()).build()); } + // ----- Endpoint: ingest.put_ip_location_database + + /** + * Returns information about one or more IP location database configurations. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture putIpLocationDatabase( + PutIpLocationDatabaseRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) PutIpLocationDatabaseRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns information about one or more IP location database configurations. + * + * @param fn + * a function that initializes a builder to create the + * {@link PutIpLocationDatabaseRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture putIpLocationDatabase( + Function> fn) { + return putIpLocationDatabase(fn.apply(new PutIpLocationDatabaseRequest.Builder()).build()); + } + // ----- Endpoint: ingest.put_pipeline /** diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestClient.java index 4f3f2c160..e4ba40122 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestClient.java @@ -102,6 +102,41 @@ public final DeleteGeoipDatabaseResponse deleteGeoipDatabase( return deleteGeoipDatabase(fn.apply(new DeleteGeoipDatabaseRequest.Builder()).build()); } + // ----- Endpoint: ingest.delete_ip_location_database + + /** + * Deletes an IP location database configuration. + * + * @see Documentation + * on elastic.co + */ + + public DeleteIpLocationDatabaseResponse deleteIpLocationDatabase(DeleteIpLocationDatabaseRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeleteIpLocationDatabaseRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Deletes an IP location database configuration. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeleteIpLocationDatabaseRequest} + * @see Documentation + * on elastic.co + */ + + public final DeleteIpLocationDatabaseResponse deleteIpLocationDatabase( + Function> fn) + throws IOException, ElasticsearchException { + return deleteIpLocationDatabase(fn.apply(new DeleteIpLocationDatabaseRequest.Builder()).build()); + } + // ----- Endpoint: ingest.delete_pipeline /** @@ -203,6 +238,54 @@ public GetGeoipDatabaseResponse getGeoipDatabase() throws IOException, Elasticse GetGeoipDatabaseRequest._ENDPOINT, this.transportOptions); } + // ----- Endpoint: ingest.get_ip_location_database + + /** + * Returns information about one or more IP location database configurations. + * + * @see Documentation + * on elastic.co + */ + + public GetIpLocationDatabaseResponse getIpLocationDatabase(GetIpLocationDatabaseRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetIpLocationDatabaseRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns information about one or more IP location database configurations. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetIpLocationDatabaseRequest} + * @see Documentation + * on elastic.co + */ + + public final GetIpLocationDatabaseResponse getIpLocationDatabase( + Function> fn) + throws IOException, ElasticsearchException { + return getIpLocationDatabase(fn.apply(new GetIpLocationDatabaseRequest.Builder()).build()); + } + + /** + * Returns information about one or more IP location database configurations. + * + * @see Documentation + * on elastic.co + */ + + public GetIpLocationDatabaseResponse getIpLocationDatabase() throws IOException, ElasticsearchException { + return this.transport.performRequest(new GetIpLocationDatabaseRequest.Builder().build(), + GetIpLocationDatabaseRequest._ENDPOINT, this.transportOptions); + } + // ----- Endpoint: ingest.get_pipeline /** @@ -308,6 +391,41 @@ public final PutGeoipDatabaseResponse putGeoipDatabase( return putGeoipDatabase(fn.apply(new PutGeoipDatabaseRequest.Builder()).build()); } + // ----- Endpoint: ingest.put_ip_location_database + + /** + * Returns information about one or more IP location database configurations. + * + * @see Documentation + * on elastic.co + */ + + public PutIpLocationDatabaseResponse putIpLocationDatabase(PutIpLocationDatabaseRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) PutIpLocationDatabaseRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns information about one or more IP location database configurations. + * + * @param fn + * a function that initializes a builder to create the + * {@link PutIpLocationDatabaseRequest} + * @see Documentation + * on elastic.co + */ + + public final PutIpLocationDatabaseResponse putIpLocationDatabase( + Function> fn) + throws IOException, ElasticsearchException { + return putIpLocationDatabase(fn.apply(new PutIpLocationDatabaseRequest.Builder()).build()); + } + // ----- Endpoint: ingest.put_pipeline /** diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/GetIpLocationDatabaseRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/GetIpLocationDatabaseRequest.java new file mode 100644 index 000000000..570f1b352 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/GetIpLocationDatabaseRequest.java @@ -0,0 +1,261 @@ +/* + * 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.ingest; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.RequestBase; +import co.elastic.clients.elasticsearch._types.Time; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.transport.Endpoint; +import co.elastic.clients.transport.endpoints.SimpleEndpoint; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import java.util.stream.Collectors; +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: ingest.get_ip_location_database.Request + +/** + * Returns information about one or more IP location database configurations. + * + * @see API + * specification + */ + +public class GetIpLocationDatabaseRequest extends RequestBase { + private final List id; + + @Nullable + private final Time masterTimeout; + + // --------------------------------------------------------------------------------------------- + + private GetIpLocationDatabaseRequest(Builder builder) { + + this.id = ApiTypeHelper.unmodifiable(builder.id); + this.masterTimeout = builder.masterTimeout; + + } + + public static GetIpLocationDatabaseRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Comma-separated list of database configuration IDs to retrieve. Wildcard + * (*) expressions are supported. To get all database + * configurations, omit this parameter or use *. + *

+ * API name: {@code id} + */ + public final List id() { + return this.id; + } + + /** + * Period to wait for a connection to the master node. If no response is + * received before the timeout expires, the request fails and returns an error. + *

+ * API name: {@code master_timeout} + */ + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GetIpLocationDatabaseRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private List id; + + @Nullable + private Time masterTimeout; + + /** + * Comma-separated list of database configuration IDs to retrieve. Wildcard + * (*) expressions are supported. To get all database + * configurations, omit this parameter or use *. + *

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

+ * Adds all elements of list to id. + */ + public final Builder id(List list) { + this.id = _listAddAll(this.id, list); + return this; + } + + /** + * Comma-separated list of database configuration IDs to retrieve. Wildcard + * (*) expressions are supported. To get all database + * configurations, omit this parameter or use *. + *

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

+ * Adds one or more values to id. + */ + public final Builder id(String value, String... values) { + this.id = _listAdd(this.id, value, values); + return this; + } + + /** + * Period to wait for a connection to the master node. If no response is + * received before the timeout expires, the request fails and returns an error. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * Period to wait for a connection to the master node. If no response is + * received before the timeout expires, the request fails and returns an error. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(Function> fn) { + return this.masterTimeout(fn.apply(new Time.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GetIpLocationDatabaseRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GetIpLocationDatabaseRequest build() { + _checkSingleUse(); + + return new GetIpLocationDatabaseRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code ingest.get_ip_location_database}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/ingest.get_ip_location_database", + + // Request method + request -> { + return "GET"; + + }, + + // Request path + request -> { + final int _id = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.id())) + propsSet |= _id; + + if (propsSet == 0) { + StringBuilder buf = new StringBuilder(); + buf.append("/_ingest"); + buf.append("/ip_location"); + buf.append("/database"); + return buf.toString(); + } + if (propsSet == (_id)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_ingest"); + buf.append("/ip_location"); + buf.append("/database"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.id.stream().map(v -> v).collect(Collectors.joining(",")), buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _id = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.id())) + propsSet |= _id; + + if (propsSet == 0) { + } + if (propsSet == (_id)) { + params.put("id", request.id.stream().map(v -> v).collect(Collectors.joining(","))); + } + return params; + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } + return params; + + }, SimpleEndpoint.emptyMap(), false, GetIpLocationDatabaseResponse._DESERIALIZER); +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/GetIpLocationDatabaseResponse.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/GetIpLocationDatabaseResponse.java new file mode 100644 index 000000000..ccc8d9f58 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/GetIpLocationDatabaseResponse.java @@ -0,0 +1,189 @@ +/* + * 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.ingest; + +import co.elastic.clients.elasticsearch.ingest.get_ip_location_database.DatabaseConfigurationMetadata; +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.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.util.List; +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: ingest.get_ip_location_database.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class GetIpLocationDatabaseResponse implements JsonpSerializable { + private final List databases; + + // --------------------------------------------------------------------------------------------- + + private GetIpLocationDatabaseResponse(Builder builder) { + + this.databases = ApiTypeHelper.unmodifiableRequired(builder.databases, this, "databases"); + + } + + public static GetIpLocationDatabaseResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code databases} + */ + public final List databases() { + return this.databases; + } + + /** + * 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 (ApiTypeHelper.isDefined(this.databases)) { + generator.writeKey("databases"); + generator.writeStartArray(); + for (DatabaseConfigurationMetadata item0 : this.databases) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GetIpLocationDatabaseResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private List databases; + + /** + * Required - API name: {@code databases} + *

+ * Adds all elements of list to databases. + */ + public final Builder databases(List list) { + this.databases = _listAddAll(this.databases, list); + return this; + } + + /** + * Required - API name: {@code databases} + *

+ * Adds one or more values to databases. + */ + public final Builder databases(DatabaseConfigurationMetadata value, DatabaseConfigurationMetadata... values) { + this.databases = _listAdd(this.databases, value, values); + return this; + } + + /** + * Required - API name: {@code databases} + *

+ * Adds a value to databases using a builder lambda. + */ + public final Builder databases( + Function> fn) { + return databases(fn.apply(new DatabaseConfigurationMetadata.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GetIpLocationDatabaseResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GetIpLocationDatabaseResponse build() { + _checkSingleUse(); + + return new GetIpLocationDatabaseResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link GetIpLocationDatabaseResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, GetIpLocationDatabaseResponse::setupGetIpLocationDatabaseResponseDeserializer); + + protected static void setupGetIpLocationDatabaseResponseDeserializer( + ObjectDeserializer op) { + + op.add(Builder::databases, JsonpDeserializer.arrayDeserializer(DatabaseConfigurationMetadata._DESERIALIZER), + "databases"); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/Ipinfo.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/Ipinfo.java new file mode 100644 index 000000000..85c4569c9 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/Ipinfo.java @@ -0,0 +1,90 @@ +/* + * 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.ingest; + +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.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; + +//---------------------------------------------------------------- +// 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 API + * specification + */ +@JsonpDeserializable +public class Ipinfo implements DatabaseConfigurationFullVariant, DatabaseConfigurationVariant, JsonpSerializable { + + /** + * DatabaseConfigurationFull variant kind. + */ + @Override + public DatabaseConfigurationFull.Kind _databaseConfigurationFullKind() { + return DatabaseConfigurationFull.Kind.Ipinfo; + } + + /** + * DatabaseConfiguration variant kind. + */ + @Override + public DatabaseConfiguration.Kind _databaseConfigurationKind() { + return DatabaseConfiguration.Kind.Ipinfo; + } + + public static final class Builder implements ObjectBuilder { + @Override + public Ipinfo build() { + return Ipinfo._INSTANCE; + } + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + generator.writeEnd(); + } + + /** + * Singleton instance for empty class {@link Ipinfo}. + */ + public static final Ipinfo _INSTANCE = new Ipinfo(); + + public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer.emptyObject(Ipinfo._INSTANCE); + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/help/HelpRecord.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/Local.java similarity index 69% rename from java-client/src/main/java/co/elastic/clients/elasticsearch/cat/help/HelpRecord.java rename to java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/Local.java index 5c193bb45..1f2cf6f1b 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/help/HelpRecord.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/Local.java @@ -17,7 +17,7 @@ * under the License. */ -package co.elastic.clients.elasticsearch.cat.help; +package co.elastic.clients.elasticsearch.ingest; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; @@ -50,34 +50,42 @@ // //---------------------------------------------------------------- -// typedef: cat.help.HelpRecord +// typedef: ingest._types.Local /** * - * @see API + * @see API * specification */ @JsonpDeserializable -public class HelpRecord implements JsonpSerializable { - private final String endpoint; +public class Local implements DatabaseConfigurationFullVariant, JsonpSerializable { + private final String type; // --------------------------------------------------------------------------------------------- - private HelpRecord(Builder builder) { + private Local(Builder builder) { - this.endpoint = ApiTypeHelper.requireNonNull(builder.endpoint, this, "endpoint"); + this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); } - public static HelpRecord of(Function> fn) { + public static Local of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * Required - API name: {@code endpoint} + * DatabaseConfigurationFull variant kind. */ - public final String endpoint() { - return this.endpoint; + @Override + public DatabaseConfigurationFull.Kind _databaseConfigurationFullKind() { + return DatabaseConfigurationFull.Kind.Local; + } + + /** + * Required - API name: {@code type} + */ + public final String type() { + return this.type; } /** @@ -91,8 +99,8 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - generator.writeKey("endpoint"); - generator.write(this.endpoint); + generator.writeKey("type"); + generator.write(this.type); } @@ -104,17 +112,17 @@ public String toString() { // --------------------------------------------------------------------------------------------- /** - * Builder for {@link HelpRecord}. + * Builder for {@link Local}. */ - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private String endpoint; + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String type; /** - * Required - API name: {@code endpoint} + * Required - API name: {@code type} */ - public final Builder endpoint(String value) { - this.endpoint = value; + public final Builder type(String value) { + this.type = value; return this; } @@ -124,29 +132,29 @@ protected Builder self() { } /** - * Builds a {@link HelpRecord}. + * Builds a {@link Local}. * * @throws NullPointerException * if some of the required fields are null. */ - public HelpRecord build() { + public Local build() { _checkSingleUse(); - return new HelpRecord(this); + return new Local(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link HelpRecord} + * Json deserializer for {@link Local} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - HelpRecord::setupHelpRecordDeserializer); + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + Local::setupLocalDeserializer); - protected static void setupHelpRecordDeserializer(ObjectDeserializer op) { + protected static void setupLocalDeserializer(ObjectDeserializer op) { - op.add(Builder::endpoint, JsonpDeserializer.stringDeserializer(), "endpoint"); + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/Maxmind.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/Maxmind.java index 702572886..ac93cf0c4 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/Maxmind.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/Maxmind.java @@ -58,7 +58,7 @@ * specification */ @JsonpDeserializable -public class Maxmind implements JsonpSerializable { +public class Maxmind implements DatabaseConfigurationFullVariant, DatabaseConfigurationVariant, JsonpSerializable { private final String accountId; // --------------------------------------------------------------------------------------------- @@ -73,6 +73,22 @@ public static Maxmind of(Function> fn) { return fn.apply(new Builder()).build(); } + /** + * DatabaseConfigurationFull variant kind. + */ + @Override + public DatabaseConfigurationFull.Kind _databaseConfigurationFullKind() { + return DatabaseConfigurationFull.Kind.Maxmind; + } + + /** + * DatabaseConfiguration variant kind. + */ + @Override + public DatabaseConfiguration.Kind _databaseConfigurationKind() { + return DatabaseConfiguration.Kind.Maxmind; + } + /** * Required - API name: {@code account_id} */ diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/PutIpLocationDatabaseRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/PutIpLocationDatabaseRequest.java new file mode 100644 index 000000000..141b98cd9 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/PutIpLocationDatabaseRequest.java @@ -0,0 +1,326 @@ +/* + * 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.ingest; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.RequestBase; +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.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.transport.Endpoint; +import co.elastic.clients.transport.endpoints.SimpleEndpoint; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import java.lang.String; +import java.util.HashMap; +import java.util.Map; +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: ingest.put_ip_location_database.Request + +/** + * Returns information about one or more IP location database configurations. + * + * @see API + * specification + */ +@JsonpDeserializable +public class PutIpLocationDatabaseRequest extends RequestBase implements JsonpSerializable { + private final String id; + + @Nullable + private final Time masterTimeout; + + @Nullable + private final Time timeout; + + private final DatabaseConfiguration configuration; + + // --------------------------------------------------------------------------------------------- + + private PutIpLocationDatabaseRequest(Builder builder) { + + this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id"); + this.masterTimeout = builder.masterTimeout; + this.timeout = builder.timeout; + this.configuration = ApiTypeHelper.requireNonNull(builder.configuration, this, "configuration"); + + } + + public static PutIpLocationDatabaseRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - ID of the database configuration to create or update. + *

+ * API name: {@code id} + */ + public final String id() { + return this.id; + } + + /** + * Period to wait for a connection to the master node. If no response is + * received before the timeout expires, the request fails and returns an error. + *

+ * API name: {@code master_timeout} + */ + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + /** + * Period to wait for a response. If no response is received before the timeout + * expires, the request fails and returns an error. + *

+ * API name: {@code timeout} + */ + @Nullable + public final Time timeout() { + return this.timeout; + } + + /** + * Required - Request body. + */ + public final DatabaseConfiguration configuration() { + return this.configuration; + } + + /** + * Serialize this value to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + this.configuration.serialize(generator, mapper); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link PutIpLocationDatabaseRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + private String id; + + @Nullable + private Time masterTimeout; + + @Nullable + private Time timeout; + + private DatabaseConfiguration configuration; + + /** + * Required - ID of the database configuration to create or update. + *

+ * API name: {@code id} + */ + public final Builder id(String value) { + this.id = value; + return this; + } + + /** + * Period to wait for a connection to the master node. If no response is + * received before the timeout expires, the request fails and returns an error. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * Period to wait for a connection to the master node. If no response is + * received before the timeout expires, the request fails and returns an error. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(Function> fn) { + return this.masterTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * Period to wait for a response. If no response is received before the timeout + * expires, the request fails and returns an error. + *

+ * API name: {@code timeout} + */ + public final Builder timeout(@Nullable Time value) { + this.timeout = value; + return this; + } + + /** + * Period to wait for a response. If no response is received before the timeout + * expires, the request fails and returns an error. + *

+ * API name: {@code timeout} + */ + public final Builder timeout(Function> fn) { + return this.timeout(fn.apply(new Time.Builder()).build()); + } + + /** + * Required - Request body. + */ + public final Builder configuration(DatabaseConfiguration value) { + this.configuration = value; + return this; + } + + /** + * Required - Request body. + */ + public final Builder configuration( + Function> fn) { + return this.configuration(fn.apply(new DatabaseConfiguration.Builder()).build()); + } + + @Override + public Builder withJson(JsonParser parser, JsonpMapper mapper) { + + @SuppressWarnings("unchecked") + DatabaseConfiguration value = (DatabaseConfiguration) DatabaseConfiguration._DESERIALIZER + .deserialize(parser, mapper); + return this.configuration(value); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link PutIpLocationDatabaseRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public PutIpLocationDatabaseRequest build() { + _checkSingleUse(); + + return new PutIpLocationDatabaseRequest(this); + } + } + + public static final JsonpDeserializer _DESERIALIZER = createPutIpLocationDatabaseRequestDeserializer(); + protected static JsonpDeserializer createPutIpLocationDatabaseRequestDeserializer() { + + JsonpDeserializer valueDeserializer = DatabaseConfiguration._DESERIALIZER; + + return JsonpDeserializer.of(valueDeserializer.acceptedEvents(), (parser, mapper, event) -> new Builder() + .configuration(valueDeserializer.deserialize(parser, mapper, event)).build()); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code ingest.put_ip_location_database}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/ingest.put_ip_location_database", + + // Request method + request -> { + return "PUT"; + + }, + + // Request path + request -> { + final int _id = 1 << 0; + + int propsSet = 0; + + propsSet |= _id; + + if (propsSet == (_id)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_ingest"); + buf.append("/ip_location"); + buf.append("/database"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.id, buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _id = 1 << 0; + + int propsSet = 0; + + propsSet |= _id; + + if (propsSet == (_id)) { + params.put("id", request.id); + } + return params; + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } + if (request.timeout != null) { + params.put("timeout", request.timeout._toJsonString()); + } + return params; + + }, SimpleEndpoint.emptyMap(), true, PutIpLocationDatabaseResponse._DESERIALIZER); +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/PutIpLocationDatabaseResponse.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/PutIpLocationDatabaseResponse.java new file mode 100644 index 000000000..b679ae5a2 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/PutIpLocationDatabaseResponse.java @@ -0,0 +1,109 @@ +/* + * 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.ingest; + +import co.elastic.clients.elasticsearch._types.AcknowledgedResponseBase; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; + +//---------------------------------------------------------------- +// 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: ingest.put_ip_location_database.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class PutIpLocationDatabaseResponse extends AcknowledgedResponseBase { + // --------------------------------------------------------------------------------------------- + + private PutIpLocationDatabaseResponse(Builder builder) { + super(builder); + + } + + public static PutIpLocationDatabaseResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link PutIpLocationDatabaseResponse}. + */ + + public static class Builder extends AcknowledgedResponseBase.AbstractBuilder + implements + ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link PutIpLocationDatabaseResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public PutIpLocationDatabaseResponse build() { + _checkSingleUse(); + + return new PutIpLocationDatabaseResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link PutIpLocationDatabaseResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, PutIpLocationDatabaseResponse::setupPutIpLocationDatabaseResponseDeserializer); + + protected static void setupPutIpLocationDatabaseResponseDeserializer( + ObjectDeserializer op) { + AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/Web.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/Web.java new file mode 100644 index 000000000..9e5a42ebe --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/Web.java @@ -0,0 +1,82 @@ +/* + * 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.ingest; + +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.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; + +//---------------------------------------------------------------- +// 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 API + * specification + */ +@JsonpDeserializable +public class Web implements DatabaseConfigurationFullVariant, JsonpSerializable { + + /** + * DatabaseConfigurationFull variant kind. + */ + @Override + public DatabaseConfigurationFull.Kind _databaseConfigurationFullKind() { + return DatabaseConfigurationFull.Kind.Web; + } + + public static final class Builder implements ObjectBuilder { + @Override + public Web build() { + return Web._INSTANCE; + } + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + generator.writeEnd(); + } + + /** + * Singleton instance for empty class {@link Web}. + */ + public static final Web _INSTANCE = new Web(); + + public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer.emptyObject(Web._INSTANCE); + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/get_ip_location_database/DatabaseConfigurationMetadata.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/get_ip_location_database/DatabaseConfigurationMetadata.java new file mode 100644 index 000000000..4dc9b6398 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/get_ip_location_database/DatabaseConfigurationMetadata.java @@ -0,0 +1,273 @@ +/* + * 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.ingest.get_ip_location_database; + +import co.elastic.clients.elasticsearch.ingest.DatabaseConfigurationFull; +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.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Long; +import java.lang.String; +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: ingest.get_ip_location_database.DatabaseConfigurationMetadata + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DatabaseConfigurationMetadata implements JsonpSerializable { + private final String id; + + private final long version; + + @Nullable + private final Long modifiedDateMillis; + + @Nullable + private final Long modifiedDate; + + private final DatabaseConfigurationFull database; + + // --------------------------------------------------------------------------------------------- + + private DatabaseConfigurationMetadata(Builder builder) { + + this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id"); + this.version = ApiTypeHelper.requireNonNull(builder.version, this, "version"); + this.modifiedDateMillis = builder.modifiedDateMillis; + this.modifiedDate = builder.modifiedDate; + this.database = ApiTypeHelper.requireNonNull(builder.database, this, "database"); + + } + + public static DatabaseConfigurationMetadata of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code id} + */ + public final String id() { + return this.id; + } + + /** + * Required - API name: {@code version} + */ + public final long version() { + return this.version; + } + + /** + * API name: {@code modified_date_millis} + */ + @Nullable + public final Long modifiedDateMillis() { + return this.modifiedDateMillis; + } + + /** + * API name: {@code modified_date} + */ + @Nullable + public final Long modifiedDate() { + return this.modifiedDate; + } + + /** + * Required - API name: {@code database} + */ + public final DatabaseConfigurationFull database() { + return this.database; + } + + /** + * 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) { + + generator.writeKey("id"); + generator.write(this.id); + + generator.writeKey("version"); + generator.write(this.version); + + if (this.modifiedDateMillis != null) { + generator.writeKey("modified_date_millis"); + generator.write(this.modifiedDateMillis); + + } + if (this.modifiedDate != null) { + generator.writeKey("modified_date"); + generator.write(this.modifiedDate); + + } + generator.writeKey("database"); + this.database.serialize(generator, mapper); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DatabaseConfigurationMetadata}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private String id; + + private Long version; + + @Nullable + private Long modifiedDateMillis; + + @Nullable + private Long modifiedDate; + + private DatabaseConfigurationFull database; + + /** + * Required - API name: {@code id} + */ + public final Builder id(String value) { + this.id = value; + return this; + } + + /** + * Required - API name: {@code version} + */ + public final Builder version(long value) { + this.version = value; + return this; + } + + /** + * API name: {@code modified_date_millis} + */ + public final Builder modifiedDateMillis(@Nullable Long value) { + this.modifiedDateMillis = value; + return this; + } + + /** + * API name: {@code modified_date} + */ + public final Builder modifiedDate(@Nullable Long value) { + this.modifiedDate = value; + return this; + } + + /** + * Required - API name: {@code database} + */ + public final Builder database(DatabaseConfigurationFull value) { + this.database = value; + return this; + } + + /** + * Required - API name: {@code database} + */ + public final Builder database( + Function> fn) { + return this.database(fn.apply(new DatabaseConfigurationFull.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DatabaseConfigurationMetadata}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DatabaseConfigurationMetadata build() { + _checkSingleUse(); + + return new DatabaseConfigurationMetadata(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DatabaseConfigurationMetadata} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DatabaseConfigurationMetadata::setupDatabaseConfigurationMetadataDeserializer); + + protected static void setupDatabaseConfigurationMetadataDeserializer( + ObjectDeserializer op) { + + op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id"); + op.add(Builder::version, JsonpDeserializer.longDeserializer(), "version"); + op.add(Builder::modifiedDateMillis, JsonpDeserializer.longDeserializer(), "modified_date_millis"); + op.add(Builder::modifiedDate, JsonpDeserializer.longDeserializer(), "modified_date"); + op.add(Builder::database, DatabaseConfigurationFull._DESERIALIZER, "database"); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/tasks/CancelRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/tasks/CancelRequest.java index f9d5ba574..565f08bdd 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/tasks/CancelRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/tasks/CancelRequest.java @@ -58,7 +58,19 @@ // typedef: tasks.cancel.Request /** - * Cancels a task, if it can be cancelled through an API. + * Cancel a task. A task may continue to run for some time after it has been + * cancelled because it may not be able to safely stop its current activity + * straight away. It is also possible that Elasticsearch must complete its work + * on other tasks before it can process the cancellation. The get task + * information API will continue to list these cancelled tasks until they + * complete. The cancelled flag in the response indicates that the cancellation + * command has been processed and the task will stop as soon as possible. + *

+ * To troubleshoot why a cancelled task does not complete promptly, use the get + * task information API with the ?detailed parameter to identify + * the other tasks the system is running. You can also use the node hot threads + * API to obtain detailed information about the work the system is doing instead + * of completing the cancelled task. * * @see API * specification diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/tasks/ElasticsearchTasksAsyncClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/tasks/ElasticsearchTasksAsyncClient.java index 7471f3782..e60e32a47 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/tasks/ElasticsearchTasksAsyncClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/tasks/ElasticsearchTasksAsyncClient.java @@ -68,7 +68,19 @@ public ElasticsearchTasksAsyncClient withTransportOptions(@Nullable TransportOpt // ----- Endpoint: tasks.cancel /** - * Cancels a task, if it can be cancelled through an API. + * Cancel a task. A task may continue to run for some time after it has been + * cancelled because it may not be able to safely stop its current activity + * straight away. It is also possible that Elasticsearch must complete its work + * on other tasks before it can process the cancellation. The get task + * information API will continue to list these cancelled tasks until they + * complete. The cancelled flag in the response indicates that the cancellation + * command has been processed and the task will stop as soon as possible. + *

+ * To troubleshoot why a cancelled task does not complete promptly, use the get + * task information API with the ?detailed parameter to identify + * the other tasks the system is running. You can also use the node hot threads + * API to obtain detailed information about the work the system is doing instead + * of completing the cancelled task. * * @see Documentation @@ -83,7 +95,19 @@ public CompletableFuture cancel(CancelRequest request) { } /** - * Cancels a task, if it can be cancelled through an API. + * Cancel a task. A task may continue to run for some time after it has been + * cancelled because it may not be able to safely stop its current activity + * straight away. It is also possible that Elasticsearch must complete its work + * on other tasks before it can process the cancellation. The get task + * information API will continue to list these cancelled tasks until they + * complete. The cancelled flag in the response indicates that the cancellation + * command has been processed and the task will stop as soon as possible. + *

+ * To troubleshoot why a cancelled task does not complete promptly, use the get + * task information API with the ?detailed parameter to identify + * the other tasks the system is running. You can also use the node hot threads + * API to obtain detailed information about the work the system is doing instead + * of completing the cancelled task. * * @param fn * a function that initializes a builder to create the @@ -99,7 +123,19 @@ public final CompletableFuture cancel( } /** - * Cancels a task, if it can be cancelled through an API. + * Cancel a task. A task may continue to run for some time after it has been + * cancelled because it may not be able to safely stop its current activity + * straight away. It is also possible that Elasticsearch must complete its work + * on other tasks before it can process the cancellation. The get task + * information API will continue to list these cancelled tasks until they + * complete. The cancelled flag in the response indicates that the cancellation + * command has been processed and the task will stop as soon as possible. + *

+ * To troubleshoot why a cancelled task does not complete promptly, use the get + * task information API with the ?detailed parameter to identify + * the other tasks the system is running. You can also use the node hot threads + * API to obtain detailed information about the work the system is doing instead + * of completing the cancelled task. * * @see Documentation @@ -114,8 +150,8 @@ public CompletableFuture cancel() { // ----- Endpoint: tasks.get /** - * Get task information. Returns information about the tasks currently executing - * in the cluster. + * Get task information. Get information about a task currently running in the + * cluster. * * @see Documentation @@ -130,8 +166,8 @@ public CompletableFuture get(GetTasksRequest request) { } /** - * Get task information. Returns information about the tasks currently executing - * in the cluster. + * Get task information. Get information about a task currently running in the + * cluster. * * @param fn * a function that initializes a builder to create the @@ -149,8 +185,8 @@ public final CompletableFuture get( // ----- Endpoint: tasks.list /** - * The task management API returns information about tasks currently executing - * on one or more nodes in the cluster. + * Get all tasks. Get information about the tasks currently running on one or + * more nodes in the cluster. * * @see Documentation @@ -165,8 +201,8 @@ public CompletableFuture list(ListRequest request) { } /** - * The task management API returns information about tasks currently executing - * on one or more nodes in the cluster. + * Get all tasks. Get information about the tasks currently running on one or + * more nodes in the cluster. * * @param fn * a function that initializes a builder to create the @@ -181,8 +217,8 @@ public final CompletableFuture list(FunctionDocumentation diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/tasks/ElasticsearchTasksClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/tasks/ElasticsearchTasksClient.java index 70cd2c12d..b2af621dc 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/tasks/ElasticsearchTasksClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/tasks/ElasticsearchTasksClient.java @@ -68,7 +68,19 @@ public ElasticsearchTasksClient withTransportOptions(@Nullable TransportOptions // ----- Endpoint: tasks.cancel /** - * Cancels a task, if it can be cancelled through an API. + * Cancel a task. A task may continue to run for some time after it has been + * cancelled because it may not be able to safely stop its current activity + * straight away. It is also possible that Elasticsearch must complete its work + * on other tasks before it can process the cancellation. The get task + * information API will continue to list these cancelled tasks until they + * complete. The cancelled flag in the response indicates that the cancellation + * command has been processed and the task will stop as soon as possible. + *

+ * To troubleshoot why a cancelled task does not complete promptly, use the get + * task information API with the ?detailed parameter to identify + * the other tasks the system is running. You can also use the node hot threads + * API to obtain detailed information about the work the system is doing instead + * of completing the cancelled task. * * @see Documentation @@ -83,7 +95,19 @@ public CancelResponse cancel(CancelRequest request) throws IOException, Elastics } /** - * Cancels a task, if it can be cancelled through an API. + * Cancel a task. A task may continue to run for some time after it has been + * cancelled because it may not be able to safely stop its current activity + * straight away. It is also possible that Elasticsearch must complete its work + * on other tasks before it can process the cancellation. The get task + * information API will continue to list these cancelled tasks until they + * complete. The cancelled flag in the response indicates that the cancellation + * command has been processed and the task will stop as soon as possible. + *

+ * To troubleshoot why a cancelled task does not complete promptly, use the get + * task information API with the ?detailed parameter to identify + * the other tasks the system is running. You can also use the node hot threads + * API to obtain detailed information about the work the system is doing instead + * of completing the cancelled task. * * @param fn * a function that initializes a builder to create the @@ -99,7 +123,19 @@ public final CancelResponse cancel(Function + * To troubleshoot why a cancelled task does not complete promptly, use the get + * task information API with the ?detailed parameter to identify + * the other tasks the system is running. You can also use the node hot threads + * API to obtain detailed information about the work the system is doing instead + * of completing the cancelled task. * * @see Documentation @@ -114,8 +150,8 @@ public CancelResponse cancel() throws IOException, ElasticsearchException { // ----- Endpoint: tasks.get /** - * Get task information. Returns information about the tasks currently executing - * in the cluster. + * Get task information. Get information about a task currently running in the + * cluster. * * @see Documentation @@ -130,8 +166,8 @@ public GetTasksResponse get(GetTasksRequest request) throws IOException, Elastic } /** - * Get task information. Returns information about the tasks currently executing - * in the cluster. + * Get task information. Get information about a task currently running in the + * cluster. * * @param fn * a function that initializes a builder to create the @@ -149,8 +185,8 @@ public final GetTasksResponse get(FunctionDocumentation @@ -165,8 +201,8 @@ public ListResponse list(ListRequest request) throws IOException, ElasticsearchE } /** - * The task management API returns information about tasks currently executing - * on one or more nodes in the cluster. + * Get all tasks. Get information about the tasks currently running on one or + * more nodes in the cluster. * * @param fn * a function that initializes a builder to create the @@ -182,8 +218,8 @@ public final ListResponse list(FunctionDocumentation diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/tasks/GetTasksRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/tasks/GetTasksRequest.java index ea9563e26..36c03dab6 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/tasks/GetTasksRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/tasks/GetTasksRequest.java @@ -57,8 +57,8 @@ // typedef: tasks.get.Request /** - * Get task information. Returns information about the tasks currently executing - * in the cluster. + * Get task information. Get information about a task currently running in the + * cluster. * * @see API * specification diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/tasks/ListRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/tasks/ListRequest.java index c212aa37b..7ca029327 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/tasks/ListRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/tasks/ListRequest.java @@ -60,8 +60,8 @@ // typedef: tasks.list.Request /** - * The task management API returns information about tasks currently executing - * on one or more nodes in the cluster. + * Get all tasks. Get information about the tasks currently running on one or + * more nodes in the cluster. * * @see API * specification @@ -121,7 +121,8 @@ public final List actions() { /** * If true, the response includes detailed information about shard - * recoveries. + * recoveries. This information is useful to distinguish tasks from each other + * but is more costly to run. *

* API name: {@code detailed} */ @@ -251,7 +252,8 @@ public final Builder actions(String value, String... values) { /** * If true, the response includes detailed information about shard - * recoveries. + * recoveries. This information is useful to distinguish tasks from each other + * but is more costly to run. *

* API name: {@code detailed} */ diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/tasks/TaskInfo.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/tasks/TaskInfo.java index 646858885..2494bdfcd 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/tasks/TaskInfo.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/tasks/TaskInfo.java @@ -142,6 +142,15 @@ public final boolean cancellable() { } /** + * Human readable text that identifies the particular request that the task is + * performing. For example, it might identify the search request being performed + * by a search task. Other kinds of tasks have different descriptions, like + * _reindex which has the source and the destination, or + * _bulk which just has the number of requests and the destination + * indices. Many requests will have only an empty description because more + * detailed information about the request is not easily available or + * particularly helpful in identifying the request. + *

* API name: {@code description} */ @Nullable @@ -193,7 +202,12 @@ public final long startTimeInMillis() { } /** - * Task status information can vary wildly from task to task. + * The internal status of the task, which varies from task to task. The format + * also varies. While the goal is to keep the status for a particular task + * consistent from version to version, this is not always possible because + * sometimes the implementation changes. Fields might be removed from the status + * for a particular request so any parsing you do of the status might break in + * minor releases. *

* API name: {@code status} */ @@ -377,6 +391,15 @@ public final BuilderT cancellable(boolean value) { } /** + * Human readable text that identifies the particular request that the task is + * performing. For example, it might identify the search request being performed + * by a search task. Other kinds of tasks have different descriptions, like + * _reindex which has the source and the destination, or + * _bulk which just has the number of requests and the destination + * indices. Many requests will have only an empty description because more + * detailed information about the request is not easily available or + * particularly helpful in identifying the request. + *

* API name: {@code description} */ public final BuilderT description(@Nullable String value) { @@ -452,7 +475,12 @@ public final BuilderT startTimeInMillis(long value) { } /** - * Task status information can vary wildly from task to task. + * The internal status of the task, which varies from task to task. The format + * also varies. While the goal is to keep the status for a particular task + * consistent from version to version, this is not always possible because + * sometimes the implementation changes. Fields might be removed from the status + * for a particular request so any parsing you do of the status might break in + * minor releases. *

* API name: {@code status} */ diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/text_structure/ElasticsearchTextStructureAsyncClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/text_structure/ElasticsearchTextStructureAsyncClient.java index 023a616f6..1887c97fb 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/text_structure/ElasticsearchTextStructureAsyncClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/text_structure/ElasticsearchTextStructureAsyncClient.java @@ -70,7 +70,9 @@ public ElasticsearchTextStructureAsyncClient withTransportOptions(@Nullable Tran // ----- Endpoint: text_structure.test_grok_pattern /** - * Tests a Grok pattern on some text. + * Test a Grok pattern. Test a Grok pattern on one or more lines of text. The + * API indicates whether the lines match the pattern together with the offsets + * and lengths of the matched substrings. * * @see Documentation @@ -85,7 +87,9 @@ public CompletableFuture testGrokPattern(TestGrokPatter } /** - * Tests a Grok pattern on some text. + * Test a Grok pattern. Test a Grok pattern on one or more lines of text. The + * API indicates whether the lines match the pattern together with the offsets + * and lengths of the matched substrings. * * @param fn * a function that initializes a builder to create the diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/text_structure/ElasticsearchTextStructureClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/text_structure/ElasticsearchTextStructureClient.java index 6fabfaaaa..fd5765e01 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/text_structure/ElasticsearchTextStructureClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/text_structure/ElasticsearchTextStructureClient.java @@ -71,7 +71,9 @@ public ElasticsearchTextStructureClient withTransportOptions(@Nullable Transport // ----- Endpoint: text_structure.test_grok_pattern /** - * Tests a Grok pattern on some text. + * Test a Grok pattern. Test a Grok pattern on one or more lines of text. The + * API indicates whether the lines match the pattern together with the offsets + * and lengths of the matched substrings. * * @see Documentation @@ -87,7 +89,9 @@ public TestGrokPatternResponse testGrokPattern(TestGrokPatternRequest request) } /** - * Tests a Grok pattern on some text. + * Test a Grok pattern. Test a Grok pattern on one or more lines of text. The + * API indicates whether the lines match the pattern together with the offsets + * and lengths of the matched substrings. * * @param fn * a function that initializes a builder to create the diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/text_structure/TestGrokPatternRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/text_structure/TestGrokPatternRequest.java index 991d6a88c..c6238fb9d 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/text_structure/TestGrokPatternRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/text_structure/TestGrokPatternRequest.java @@ -59,7 +59,9 @@ // typedef: text_structure.test_grok_pattern.Request /** - * Tests a Grok pattern on some text. + * Test a Grok pattern. Test a Grok pattern on one or more lines of text. The + * API indicates whether the lines match the pattern together with the offsets + * and lengths of the matched substrings. * * @see API diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformAsyncClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformAsyncClient.java index f64537fc8..9d58ca3c4 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformAsyncClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformAsyncClient.java @@ -615,13 +615,24 @@ public final CompletableFuture updateTransform( // ----- Endpoint: transform.upgrade_transforms /** - * Upgrades all transforms. This API identifies transforms that have a legacy - * configuration format and upgrades them to the latest version. It also cleans - * up the internal data structures that store the transform state and - * checkpoints. The upgrade does not affect the source and destination indices. - * The upgrade also does not affect the roles that transforms use when + * Upgrade all transforms. Transforms are compatible across minor versions and + * between supported major versions. However, over time, the format of transform + * configuration information may change. This API identifies transforms that + * have a legacy configuration format and upgrades them to the latest version. + * It also cleans up the internal data structures that store the transform state + * and checkpoints. The upgrade does not affect the source and destination + * indices. The upgrade also does not affect the roles that transforms use when * Elasticsearch security features are enabled; the role used to read source * data and write to the destination index remains unchanged. + *

+ * If a transform upgrade step fails, the upgrade stops and an error is returned + * about the underlying issue. Resolve the issue then re-run the process again. + * A summary is returned when the upgrade is finished. + *

+ * To ensure continuous transforms remain running during a major version upgrade + * of the cluster – for example, from 7.16 to 8.0 – it is recommended to upgrade + * transforms before upgrading the cluster. You may want to perform a recent + * cluster backup prior to the upgrade. * * @see Documentation @@ -636,13 +647,24 @@ public CompletableFuture upgradeTransforms(UpgradeTra } /** - * Upgrades all transforms. This API identifies transforms that have a legacy - * configuration format and upgrades them to the latest version. It also cleans - * up the internal data structures that store the transform state and - * checkpoints. The upgrade does not affect the source and destination indices. - * The upgrade also does not affect the roles that transforms use when + * Upgrade all transforms. Transforms are compatible across minor versions and + * between supported major versions. However, over time, the format of transform + * configuration information may change. This API identifies transforms that + * have a legacy configuration format and upgrades them to the latest version. + * It also cleans up the internal data structures that store the transform state + * and checkpoints. The upgrade does not affect the source and destination + * indices. The upgrade also does not affect the roles that transforms use when * Elasticsearch security features are enabled; the role used to read source * data and write to the destination index remains unchanged. + *

+ * If a transform upgrade step fails, the upgrade stops and an error is returned + * about the underlying issue. Resolve the issue then re-run the process again. + * A summary is returned when the upgrade is finished. + *

+ * To ensure continuous transforms remain running during a major version upgrade + * of the cluster – for example, from 7.16 to 8.0 – it is recommended to upgrade + * transforms before upgrading the cluster. You may want to perform a recent + * cluster backup prior to the upgrade. * * @param fn * a function that initializes a builder to create the @@ -658,13 +680,24 @@ public final CompletableFuture upgradeTransforms( } /** - * Upgrades all transforms. This API identifies transforms that have a legacy - * configuration format and upgrades them to the latest version. It also cleans - * up the internal data structures that store the transform state and - * checkpoints. The upgrade does not affect the source and destination indices. - * The upgrade also does not affect the roles that transforms use when + * Upgrade all transforms. Transforms are compatible across minor versions and + * between supported major versions. However, over time, the format of transform + * configuration information may change. This API identifies transforms that + * have a legacy configuration format and upgrades them to the latest version. + * It also cleans up the internal data structures that store the transform state + * and checkpoints. The upgrade does not affect the source and destination + * indices. The upgrade also does not affect the roles that transforms use when * Elasticsearch security features are enabled; the role used to read source * data and write to the destination index remains unchanged. + *

+ * If a transform upgrade step fails, the upgrade stops and an error is returned + * about the underlying issue. Resolve the issue then re-run the process again. + * A summary is returned when the upgrade is finished. + *

+ * To ensure continuous transforms remain running during a major version upgrade + * of the cluster – for example, from 7.16 to 8.0 – it is recommended to upgrade + * transforms before upgrading the cluster. You may want to perform a recent + * cluster backup prior to the upgrade. * * @see Documentation diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformClient.java index f870e782b..009bd385e 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformClient.java @@ -630,13 +630,24 @@ public final UpdateTransformResponse updateTransform( // ----- Endpoint: transform.upgrade_transforms /** - * Upgrades all transforms. This API identifies transforms that have a legacy - * configuration format and upgrades them to the latest version. It also cleans - * up the internal data structures that store the transform state and - * checkpoints. The upgrade does not affect the source and destination indices. - * The upgrade also does not affect the roles that transforms use when + * Upgrade all transforms. Transforms are compatible across minor versions and + * between supported major versions. However, over time, the format of transform + * configuration information may change. This API identifies transforms that + * have a legacy configuration format and upgrades them to the latest version. + * It also cleans up the internal data structures that store the transform state + * and checkpoints. The upgrade does not affect the source and destination + * indices. The upgrade also does not affect the roles that transforms use when * Elasticsearch security features are enabled; the role used to read source * data and write to the destination index remains unchanged. + *

+ * If a transform upgrade step fails, the upgrade stops and an error is returned + * about the underlying issue. Resolve the issue then re-run the process again. + * A summary is returned when the upgrade is finished. + *

+ * To ensure continuous transforms remain running during a major version upgrade + * of the cluster – for example, from 7.16 to 8.0 – it is recommended to upgrade + * transforms before upgrading the cluster. You may want to perform a recent + * cluster backup prior to the upgrade. * * @see Documentation @@ -652,13 +663,24 @@ public UpgradeTransformsResponse upgradeTransforms(UpgradeTransformsRequest requ } /** - * Upgrades all transforms. This API identifies transforms that have a legacy - * configuration format and upgrades them to the latest version. It also cleans - * up the internal data structures that store the transform state and - * checkpoints. The upgrade does not affect the source and destination indices. - * The upgrade also does not affect the roles that transforms use when + * Upgrade all transforms. Transforms are compatible across minor versions and + * between supported major versions. However, over time, the format of transform + * configuration information may change. This API identifies transforms that + * have a legacy configuration format and upgrades them to the latest version. + * It also cleans up the internal data structures that store the transform state + * and checkpoints. The upgrade does not affect the source and destination + * indices. The upgrade also does not affect the roles that transforms use when * Elasticsearch security features are enabled; the role used to read source * data and write to the destination index remains unchanged. + *

+ * If a transform upgrade step fails, the upgrade stops and an error is returned + * about the underlying issue. Resolve the issue then re-run the process again. + * A summary is returned when the upgrade is finished. + *

+ * To ensure continuous transforms remain running during a major version upgrade + * of the cluster – for example, from 7.16 to 8.0 – it is recommended to upgrade + * transforms before upgrading the cluster. You may want to perform a recent + * cluster backup prior to the upgrade. * * @param fn * a function that initializes a builder to create the @@ -675,13 +697,24 @@ public final UpgradeTransformsResponse upgradeTransforms( } /** - * Upgrades all transforms. This API identifies transforms that have a legacy - * configuration format and upgrades them to the latest version. It also cleans - * up the internal data structures that store the transform state and - * checkpoints. The upgrade does not affect the source and destination indices. - * The upgrade also does not affect the roles that transforms use when + * Upgrade all transforms. Transforms are compatible across minor versions and + * between supported major versions. However, over time, the format of transform + * configuration information may change. This API identifies transforms that + * have a legacy configuration format and upgrades them to the latest version. + * It also cleans up the internal data structures that store the transform state + * and checkpoints. The upgrade does not affect the source and destination + * indices. The upgrade also does not affect the roles that transforms use when * Elasticsearch security features are enabled; the role used to read source * data and write to the destination index remains unchanged. + *

+ * If a transform upgrade step fails, the upgrade stops and an error is returned + * about the underlying issue. Resolve the issue then re-run the process again. + * A summary is returned when the upgrade is finished. + *

+ * To ensure continuous transforms remain running during a major version upgrade + * of the cluster – for example, from 7.16 to 8.0 – it is recommended to upgrade + * transforms before upgrading the cluster. You may want to perform a recent + * cluster backup prior to the upgrade. * * @see Documentation diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/UpgradeTransformsRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/UpgradeTransformsRequest.java index 7b351249c..727227830 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/UpgradeTransformsRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/UpgradeTransformsRequest.java @@ -56,13 +56,24 @@ // typedef: transform.upgrade_transforms.Request /** - * Upgrades all transforms. This API identifies transforms that have a legacy - * configuration format and upgrades them to the latest version. It also cleans - * up the internal data structures that store the transform state and - * checkpoints. The upgrade does not affect the source and destination indices. - * The upgrade also does not affect the roles that transforms use when + * Upgrade all transforms. Transforms are compatible across minor versions and + * between supported major versions. However, over time, the format of transform + * configuration information may change. This API identifies transforms that + * have a legacy configuration format and upgrades them to the latest version. + * It also cleans up the internal data structures that store the transform state + * and checkpoints. The upgrade does not affect the source and destination + * indices. The upgrade also does not affect the roles that transforms use when * Elasticsearch security features are enabled; the role used to read source * data and write to the destination index remains unchanged. + *

+ * If a transform upgrade step fails, the upgrade stops and an error is returned + * about the underlying issue. Resolve the issue then re-run the process again. + * A summary is returned when the upgrade is finished. + *

+ * To ensure continuous transforms remain running during a major version upgrade + * of the cluster – for example, from 7.16 to 8.0 – it is recommended to upgrade + * transforms before upgrading the cluster. You may want to perform a recent + * cluster backup prior to the upgrade. * * @see API diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/AckWatchRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/AckWatchRequest.java index ac998913b..3f6611356 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/AckWatchRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/AckWatchRequest.java @@ -58,8 +58,15 @@ // typedef: watcher.ack_watch.Request /** - * Acknowledges a watch, manually throttling the execution of the watch's - * actions. + * Acknowledge a watch. Acknowledging a watch enables you to manually throttle + * the execution of the watch's actions. + *

+ * The acknowledgement state of an action is stored in the + * status.actions.<id>.ack.state structure. + *

+ * IMPORTANT: If the specified watch is currently being executed, this API will + * return an error The reason for this behavior is to prevent overwriting the + * watch status from a watch execution. * * @see API * specification diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/ActivateWatchRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/ActivateWatchRequest.java index 17f91830b..20c2c5edf 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/ActivateWatchRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/ActivateWatchRequest.java @@ -56,7 +56,7 @@ // typedef: watcher.activate_watch.Request /** - * Activates a currently inactive watch. + * Activate a watch. A watch can be either active or inactive. * * @see API * specification diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/DeactivateWatchRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/DeactivateWatchRequest.java index 6181ca080..0ea05e563 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/DeactivateWatchRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/DeactivateWatchRequest.java @@ -56,7 +56,7 @@ // typedef: watcher.deactivate_watch.Request /** - * Deactivates a currently active watch. + * Deactivate a watch. A watch can be either active or inactive. * * @see API diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/DeleteWatchRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/DeleteWatchRequest.java index a4a79459e..312fa1cc2 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/DeleteWatchRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/DeleteWatchRequest.java @@ -56,7 +56,18 @@ // typedef: watcher.delete_watch.Request /** - * Removes a watch from Watcher. + * Delete a watch. When the watch is removed, the document representing the + * watch in the .watches index is gone and it will never be run + * again. + *

+ * Deleting a watch does not delete any watch execution records related to this + * watch from the watch history. + *

+ * IMPORTANT: Deleting a watch must be done by using only this API. Do not + * delete the watch directly from the .watches index using the + * Elasticsearch delete document API When Elasticsearch security features are + * enabled, make sure no write privileges are granted to anyone for the + * .watches index. * * @see API * specification diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/ElasticsearchWatcherAsyncClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/ElasticsearchWatcherAsyncClient.java index 6c37a09b0..620404fd6 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/ElasticsearchWatcherAsyncClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/ElasticsearchWatcherAsyncClient.java @@ -70,8 +70,15 @@ public ElasticsearchWatcherAsyncClient withTransportOptions(@Nullable TransportO // ----- Endpoint: watcher.ack_watch /** - * Acknowledges a watch, manually throttling the execution of the watch's - * actions. + * Acknowledge a watch. Acknowledging a watch enables you to manually throttle + * the execution of the watch's actions. + *

+ * The acknowledgement state of an action is stored in the + * status.actions.<id>.ack.state structure. + *

+ * IMPORTANT: If the specified watch is currently being executed, this API will + * return an error The reason for this behavior is to prevent overwriting the + * watch status from a watch execution. * * @see Documentation @@ -86,8 +93,15 @@ public CompletableFuture ackWatch(AckWatchRequest request) { } /** - * Acknowledges a watch, manually throttling the execution of the watch's - * actions. + * Acknowledge a watch. Acknowledging a watch enables you to manually throttle + * the execution of the watch's actions. + *

+ * The acknowledgement state of an action is stored in the + * status.actions.<id>.ack.state structure. + *

+ * IMPORTANT: If the specified watch is currently being executed, this API will + * return an error The reason for this behavior is to prevent overwriting the + * watch status from a watch execution. * * @param fn * a function that initializes a builder to create the @@ -105,7 +119,7 @@ public final CompletableFuture ackWatch( // ----- Endpoint: watcher.activate_watch /** - * Activates a currently inactive watch. + * Activate a watch. A watch can be either active or inactive. * * @see Documentation @@ -120,7 +134,7 @@ public CompletableFuture activateWatch(ActivateWatchReque } /** - * Activates a currently inactive watch. + * Activate a watch. A watch can be either active or inactive. * * @param fn * a function that initializes a builder to create the @@ -138,7 +152,7 @@ public final CompletableFuture activateWatch( // ----- Endpoint: watcher.deactivate_watch /** - * Deactivates a currently active watch. + * Deactivate a watch. A watch can be either active or inactive. * * @see Documentation @@ -153,7 +167,7 @@ public CompletableFuture deactivateWatch(DeactivateWatc } /** - * Deactivates a currently active watch. + * Deactivate a watch. A watch can be either active or inactive. * * @param fn * a function that initializes a builder to create the @@ -171,7 +185,18 @@ public final CompletableFuture deactivateWatch( // ----- Endpoint: watcher.delete_watch /** - * Removes a watch from Watcher. + * Delete a watch. When the watch is removed, the document representing the + * watch in the .watches index is gone and it will never be run + * again. + *

+ * Deleting a watch does not delete any watch execution records related to this + * watch from the watch history. + *

+ * IMPORTANT: Deleting a watch must be done by using only this API. Do not + * delete the watch directly from the .watches index using the + * Elasticsearch delete document API When Elasticsearch security features are + * enabled, make sure no write privileges are granted to anyone for the + * .watches index. * * @see Documentation @@ -186,7 +211,18 @@ public CompletableFuture deleteWatch(DeleteWatchRequest req } /** - * Removes a watch from Watcher. + * Delete a watch. When the watch is removed, the document representing the + * watch in the .watches index is gone and it will never be run + * again. + *

+ * Deleting a watch does not delete any watch execution records related to this + * watch from the watch history. + *

+ * IMPORTANT: Deleting a watch must be done by using only this API. Do not + * delete the watch directly from the .watches index using the + * Elasticsearch delete document API When Elasticsearch security features are + * enabled, make sure no write privileges are granted to anyone for the + * .watches index. * * @param fn * a function that initializes a builder to create the @@ -204,13 +240,19 @@ public final CompletableFuture deleteWatch( // ----- Endpoint: watcher.execute_watch /** - * This API can be used to force execution of the watch outside of its - * triggering logic or to simulate the watch execution for debugging purposes. + * Run a watch. This API can be used to force execution of the watch outside of + * its triggering logic or to simulate the watch execution for debugging + * purposes. + *

* For testing and debugging purposes, you also have fine-grained control on how - * the watch runs. You can execute the watch without executing all of its - * actions or alternatively by simulating them. You can also force execution by - * ignoring the watch condition and control whether a watch record would be - * written to the watch history after execution. + * the watch runs. You can run the watch without running all of its actions or + * alternatively by simulating them. You can also force execution by ignoring + * the watch condition and control whether a watch record would be written to + * the watch history after it runs. + *

+ * You can use the run watch API to run watches that are not yet registered by + * specifying the watch definition inline. This serves as great tool for testing + * and debugging your watches prior to adding them to Watcher. * * @see Documentation @@ -225,13 +267,19 @@ public CompletableFuture executeWatch(ExecuteWatchRequest } /** - * This API can be used to force execution of the watch outside of its - * triggering logic or to simulate the watch execution for debugging purposes. + * Run a watch. This API can be used to force execution of the watch outside of + * its triggering logic or to simulate the watch execution for debugging + * purposes. + *

* For testing and debugging purposes, you also have fine-grained control on how - * the watch runs. You can execute the watch without executing all of its - * actions or alternatively by simulating them. You can also force execution by - * ignoring the watch condition and control whether a watch record would be - * written to the watch history after execution. + * the watch runs. You can run the watch without running all of its actions or + * alternatively by simulating them. You can also force execution by ignoring + * the watch condition and control whether a watch record would be written to + * the watch history after it runs. + *

+ * You can use the run watch API to run watches that are not yet registered by + * specifying the watch definition inline. This serves as great tool for testing + * and debugging your watches prior to adding them to Watcher. * * @param fn * a function that initializes a builder to create the @@ -247,13 +295,19 @@ public final CompletableFuture executeWatch( } /** - * This API can be used to force execution of the watch outside of its - * triggering logic or to simulate the watch execution for debugging purposes. + * Run a watch. This API can be used to force execution of the watch outside of + * its triggering logic or to simulate the watch execution for debugging + * purposes. + *

* For testing and debugging purposes, you also have fine-grained control on how - * the watch runs. You can execute the watch without executing all of its - * actions or alternatively by simulating them. You can also force execution by - * ignoring the watch condition and control whether a watch record would be - * written to the watch history after execution. + * the watch runs. You can run the watch without running all of its actions or + * alternatively by simulating them. You can also force execution by ignoring + * the watch condition and control whether a watch record would be written to + * the watch history after it runs. + *

+ * You can use the run watch API to run watches that are not yet registered by + * specifying the watch definition inline. This serves as great tool for testing + * and debugging your watches prior to adding them to Watcher. * * @see Documentation @@ -268,7 +322,7 @@ public CompletableFuture executeWatch() { // ----- Endpoint: watcher.get_watch /** - * Retrieves a watch by its ID. + * Get a watch. * * @see Documentation @@ -283,7 +337,7 @@ public CompletableFuture getWatch(GetWatchRequest request) { } /** - * Retrieves a watch by its ID. + * Get a watch. * * @param fn * a function that initializes a builder to create the @@ -301,7 +355,23 @@ public final CompletableFuture getWatch( // ----- Endpoint: watcher.put_watch /** - * Creates a new watch, or updates an existing one. + * Create or update a watch. When a watch is registered, a new document that + * represents the watch is added to the .watches index and its + * trigger is immediately registered with the relevant trigger engine. Typically + * for the schedule trigger, the scheduler is the trigger engine. + *

+ * IMPORTANT: You must use Kibana or this API to create a watch. Do not add a + * watch directly to the .watches index by using the Elasticsearch + * index API. If Elasticsearch security features are enabled, do not give users + * write privileges on the .watches index. + *

+ * When you add a watch you can also define its initial active state by setting + * the active parameter. + *

+ * When Elasticsearch security features are enabled, your watch can index or + * search only on indices for which the user that stored the watch has + * privileges. If the user is able to read index a, but not index + * b, the same will apply when the watch runs. * * @see Documentation @@ -316,7 +386,23 @@ public CompletableFuture putWatch(PutWatchRequest request) { } /** - * Creates a new watch, or updates an existing one. + * Create or update a watch. When a watch is registered, a new document that + * represents the watch is added to the .watches index and its + * trigger is immediately registered with the relevant trigger engine. Typically + * for the schedule trigger, the scheduler is the trigger engine. + *

+ * IMPORTANT: You must use Kibana or this API to create a watch. Do not add a + * watch directly to the .watches index by using the Elasticsearch + * index API. If Elasticsearch security features are enabled, do not give users + * write privileges on the .watches index. + *

+ * When you add a watch you can also define its initial active state by setting + * the active parameter. + *

+ * When Elasticsearch security features are enabled, your watch can index or + * search only on indices for which the user that stored the watch has + * privileges. If the user is able to read index a, but not index + * b, the same will apply when the watch runs. * * @param fn * a function that initializes a builder to create the @@ -334,7 +420,8 @@ public final CompletableFuture putWatch( // ----- Endpoint: watcher.query_watches /** - * Retrieves stored watches. + * Query watches. Get all registered watches in a paginated manner and + * optionally filter watches by a query. * * @see Documentation @@ -349,7 +436,8 @@ public CompletableFuture queryWatches(QueryWatchesRequest } /** - * Retrieves stored watches. + * Query watches. Get all registered watches in a paginated manner and + * optionally filter watches by a query. * * @param fn * a function that initializes a builder to create the @@ -365,7 +453,8 @@ public final CompletableFuture queryWatches( } /** - * Retrieves stored watches. + * Query watches. Get all registered watches in a paginated manner and + * optionally filter watches by a query. * * @see Documentation @@ -380,7 +469,8 @@ public CompletableFuture queryWatches() { // ----- Endpoint: watcher.start /** - * Starts Watcher if it is not already running. + * Start the watch service. Start the Watcher service if it is not already + * running. * * @see Documentation @@ -394,7 +484,7 @@ public CompletableFuture start() { // ----- Endpoint: watcher.stats /** - * Retrieves the current Watcher metrics. + * Get Watcher statistics. * * @see Documentation @@ -409,7 +499,7 @@ public CompletableFuture stats(WatcherStatsRequest request } /** - * Retrieves the current Watcher metrics. + * Get Watcher statistics. * * @param fn * a function that initializes a builder to create the @@ -425,7 +515,7 @@ public final CompletableFuture stats( } /** - * Retrieves the current Watcher metrics. + * Get Watcher statistics. * * @see Documentation @@ -440,7 +530,7 @@ public CompletableFuture stats() { // ----- Endpoint: watcher.stop /** - * Stops Watcher if it is running. + * Stop the watch service. Stop the Watcher service if it is running. * * @see Documentation diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/ElasticsearchWatcherClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/ElasticsearchWatcherClient.java index d5956b5ea..90bb6c101 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/ElasticsearchWatcherClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/ElasticsearchWatcherClient.java @@ -68,8 +68,15 @@ public ElasticsearchWatcherClient withTransportOptions(@Nullable TransportOption // ----- Endpoint: watcher.ack_watch /** - * Acknowledges a watch, manually throttling the execution of the watch's - * actions. + * Acknowledge a watch. Acknowledging a watch enables you to manually throttle + * the execution of the watch's actions. + *

+ * The acknowledgement state of an action is stored in the + * status.actions.<id>.ack.state structure. + *

+ * IMPORTANT: If the specified watch is currently being executed, this API will + * return an error The reason for this behavior is to prevent overwriting the + * watch status from a watch execution. * * @see Documentation @@ -84,8 +91,15 @@ public AckWatchResponse ackWatch(AckWatchRequest request) throws IOException, El } /** - * Acknowledges a watch, manually throttling the execution of the watch's - * actions. + * Acknowledge a watch. Acknowledging a watch enables you to manually throttle + * the execution of the watch's actions. + *

+ * The acknowledgement state of an action is stored in the + * status.actions.<id>.ack.state structure. + *

+ * IMPORTANT: If the specified watch is currently being executed, this API will + * return an error The reason for this behavior is to prevent overwriting the + * watch status from a watch execution. * * @param fn * a function that initializes a builder to create the @@ -103,7 +117,7 @@ public final AckWatchResponse ackWatch(FunctionDocumentation @@ -119,7 +133,7 @@ public ActivateWatchResponse activateWatch(ActivateWatchRequest request) } /** - * Activates a currently inactive watch. + * Activate a watch. A watch can be either active or inactive. * * @param fn * a function that initializes a builder to create the @@ -138,7 +152,7 @@ public final ActivateWatchResponse activateWatch( // ----- Endpoint: watcher.deactivate_watch /** - * Deactivates a currently active watch. + * Deactivate a watch. A watch can be either active or inactive. * * @see Documentation @@ -154,7 +168,7 @@ public DeactivateWatchResponse deactivateWatch(DeactivateWatchRequest request) } /** - * Deactivates a currently active watch. + * Deactivate a watch. A watch can be either active or inactive. * * @param fn * a function that initializes a builder to create the @@ -173,7 +187,18 @@ public final DeactivateWatchResponse deactivateWatch( // ----- Endpoint: watcher.delete_watch /** - * Removes a watch from Watcher. + * Delete a watch. When the watch is removed, the document representing the + * watch in the .watches index is gone and it will never be run + * again. + *

+ * Deleting a watch does not delete any watch execution records related to this + * watch from the watch history. + *

+ * IMPORTANT: Deleting a watch must be done by using only this API. Do not + * delete the watch directly from the .watches index using the + * Elasticsearch delete document API When Elasticsearch security features are + * enabled, make sure no write privileges are granted to anyone for the + * .watches index. * * @see Documentation @@ -188,7 +213,18 @@ public DeleteWatchResponse deleteWatch(DeleteWatchRequest request) throws IOExce } /** - * Removes a watch from Watcher. + * Delete a watch. When the watch is removed, the document representing the + * watch in the .watches index is gone and it will never be run + * again. + *

+ * Deleting a watch does not delete any watch execution records related to this + * watch from the watch history. + *

+ * IMPORTANT: Deleting a watch must be done by using only this API. Do not + * delete the watch directly from the .watches index using the + * Elasticsearch delete document API When Elasticsearch security features are + * enabled, make sure no write privileges are granted to anyone for the + * .watches index. * * @param fn * a function that initializes a builder to create the @@ -207,13 +243,19 @@ public final DeleteWatchResponse deleteWatch( // ----- Endpoint: watcher.execute_watch /** - * This API can be used to force execution of the watch outside of its - * triggering logic or to simulate the watch execution for debugging purposes. + * Run a watch. This API can be used to force execution of the watch outside of + * its triggering logic or to simulate the watch execution for debugging + * purposes. + *

* For testing and debugging purposes, you also have fine-grained control on how - * the watch runs. You can execute the watch without executing all of its - * actions or alternatively by simulating them. You can also force execution by - * ignoring the watch condition and control whether a watch record would be - * written to the watch history after execution. + * the watch runs. You can run the watch without running all of its actions or + * alternatively by simulating them. You can also force execution by ignoring + * the watch condition and control whether a watch record would be written to + * the watch history after it runs. + *

+ * You can use the run watch API to run watches that are not yet registered by + * specifying the watch definition inline. This serves as great tool for testing + * and debugging your watches prior to adding them to Watcher. * * @see Documentation @@ -228,13 +270,19 @@ public ExecuteWatchResponse executeWatch(ExecuteWatchRequest request) throws IOE } /** - * This API can be used to force execution of the watch outside of its - * triggering logic or to simulate the watch execution for debugging purposes. + * Run a watch. This API can be used to force execution of the watch outside of + * its triggering logic or to simulate the watch execution for debugging + * purposes. + *

* For testing and debugging purposes, you also have fine-grained control on how - * the watch runs. You can execute the watch without executing all of its - * actions or alternatively by simulating them. You can also force execution by - * ignoring the watch condition and control whether a watch record would be - * written to the watch history after execution. + * the watch runs. You can run the watch without running all of its actions or + * alternatively by simulating them. You can also force execution by ignoring + * the watch condition and control whether a watch record would be written to + * the watch history after it runs. + *

+ * You can use the run watch API to run watches that are not yet registered by + * specifying the watch definition inline. This serves as great tool for testing + * and debugging your watches prior to adding them to Watcher. * * @param fn * a function that initializes a builder to create the @@ -251,13 +299,19 @@ public final ExecuteWatchResponse executeWatch( } /** - * This API can be used to force execution of the watch outside of its - * triggering logic or to simulate the watch execution for debugging purposes. + * Run a watch. This API can be used to force execution of the watch outside of + * its triggering logic or to simulate the watch execution for debugging + * purposes. + *

* For testing and debugging purposes, you also have fine-grained control on how - * the watch runs. You can execute the watch without executing all of its - * actions or alternatively by simulating them. You can also force execution by - * ignoring the watch condition and control whether a watch record would be - * written to the watch history after execution. + * the watch runs. You can run the watch without running all of its actions or + * alternatively by simulating them. You can also force execution by ignoring + * the watch condition and control whether a watch record would be written to + * the watch history after it runs. + *

+ * You can use the run watch API to run watches that are not yet registered by + * specifying the watch definition inline. This serves as great tool for testing + * and debugging your watches prior to adding them to Watcher. * * @see Documentation @@ -272,7 +326,7 @@ public ExecuteWatchResponse executeWatch() throws IOException, ElasticsearchExce // ----- Endpoint: watcher.get_watch /** - * Retrieves a watch by its ID. + * Get a watch. * * @see Documentation @@ -287,7 +341,7 @@ public GetWatchResponse getWatch(GetWatchRequest request) throws IOException, El } /** - * Retrieves a watch by its ID. + * Get a watch. * * @param fn * a function that initializes a builder to create the @@ -305,7 +359,23 @@ public final GetWatchResponse getWatch(Function.watches index and its + * trigger is immediately registered with the relevant trigger engine. Typically + * for the schedule trigger, the scheduler is the trigger engine. + *

+ * IMPORTANT: You must use Kibana or this API to create a watch. Do not add a + * watch directly to the .watches index by using the Elasticsearch + * index API. If Elasticsearch security features are enabled, do not give users + * write privileges on the .watches index. + *

+ * When you add a watch you can also define its initial active state by setting + * the active parameter. + *

+ * When Elasticsearch security features are enabled, your watch can index or + * search only on indices for which the user that stored the watch has + * privileges. If the user is able to read index a, but not index + * b, the same will apply when the watch runs. * * @see Documentation @@ -320,7 +390,23 @@ public PutWatchResponse putWatch(PutWatchRequest request) throws IOException, El } /** - * Creates a new watch, or updates an existing one. + * Create or update a watch. When a watch is registered, a new document that + * represents the watch is added to the .watches index and its + * trigger is immediately registered with the relevant trigger engine. Typically + * for the schedule trigger, the scheduler is the trigger engine. + *

+ * IMPORTANT: You must use Kibana or this API to create a watch. Do not add a + * watch directly to the .watches index by using the Elasticsearch + * index API. If Elasticsearch security features are enabled, do not give users + * write privileges on the .watches index. + *

+ * When you add a watch you can also define its initial active state by setting + * the active parameter. + *

+ * When Elasticsearch security features are enabled, your watch can index or + * search only on indices for which the user that stored the watch has + * privileges. If the user is able to read index a, but not index + * b, the same will apply when the watch runs. * * @param fn * a function that initializes a builder to create the @@ -338,7 +424,8 @@ public final PutWatchResponse putWatch(FunctionDocumentation @@ -353,7 +440,8 @@ public QueryWatchesResponse queryWatches(QueryWatchesRequest request) throws IOE } /** - * Retrieves stored watches. + * Query watches. Get all registered watches in a paginated manner and + * optionally filter watches by a query. * * @param fn * a function that initializes a builder to create the @@ -370,7 +458,8 @@ public final QueryWatchesResponse queryWatches( } /** - * Retrieves stored watches. + * Query watches. Get all registered watches in a paginated manner and + * optionally filter watches by a query. * * @see Documentation @@ -385,7 +474,8 @@ public QueryWatchesResponse queryWatches() throws IOException, ElasticsearchExce // ----- Endpoint: watcher.start /** - * Starts Watcher if it is not already running. + * Start the watch service. Start the Watcher service if it is not already + * running. * * @see Documentation @@ -399,7 +489,7 @@ public StartWatcherResponse start() throws IOException, ElasticsearchException { // ----- Endpoint: watcher.stats /** - * Retrieves the current Watcher metrics. + * Get Watcher statistics. * * @see Documentation @@ -414,7 +504,7 @@ public WatcherStatsResponse stats(WatcherStatsRequest request) throws IOExceptio } /** - * Retrieves the current Watcher metrics. + * Get Watcher statistics. * * @param fn * a function that initializes a builder to create the @@ -431,7 +521,7 @@ public final WatcherStatsResponse stats( } /** - * Retrieves the current Watcher metrics. + * Get Watcher statistics. * * @see Documentation @@ -446,7 +536,7 @@ public WatcherStatsResponse stats() throws IOException, ElasticsearchException { // ----- Endpoint: watcher.stop /** - * Stops Watcher if it is running. + * Stop the watch service. Stop the Watcher service if it is running. * * @see Documentation diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/ExecuteWatchRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/ExecuteWatchRequest.java index abaa69831..d9a914e09 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/ExecuteWatchRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/ExecuteWatchRequest.java @@ -59,13 +59,19 @@ // typedef: watcher.execute_watch.Request /** - * This API can be used to force execution of the watch outside of its - * triggering logic or to simulate the watch execution for debugging purposes. + * Run a watch. This API can be used to force execution of the watch outside of + * its triggering logic or to simulate the watch execution for debugging + * purposes. + *

* For testing and debugging purposes, you also have fine-grained control on how - * the watch runs. You can execute the watch without executing all of its - * actions or alternatively by simulating them. You can also force execution by - * ignoring the watch condition and control whether a watch record would be - * written to the watch history after execution. + * the watch runs. You can run the watch without running all of its actions or + * alternatively by simulating them. You can also force execution by ignoring + * the watch condition and control whether a watch record would be written to + * the watch history after it runs. + *

+ * You can use the run watch API to run watches that are not yet registered by + * specifying the watch definition inline. This serves as great tool for testing + * and debugging your watches prior to adding them to Watcher. * * @see API * specification diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/GetWatchRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/GetWatchRequest.java index e5d78074f..4c2d9e7c7 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/GetWatchRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/GetWatchRequest.java @@ -56,7 +56,7 @@ // typedef: watcher.get_watch.Request /** - * Retrieves a watch by its ID. + * Get a watch. * * @see API * specification diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/PutWatchRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/PutWatchRequest.java index ad1add11e..9ff18f4de 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/PutWatchRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/PutWatchRequest.java @@ -61,7 +61,23 @@ // typedef: watcher.put_watch.Request /** - * Creates a new watch, or updates an existing one. + * Create or update a watch. When a watch is registered, a new document that + * represents the watch is added to the .watches index and its + * trigger is immediately registered with the relevant trigger engine. Typically + * for the schedule trigger, the scheduler is the trigger engine. + *

+ * IMPORTANT: You must use Kibana or this API to create a watch. Do not add a + * watch directly to the .watches index by using the Elasticsearch + * index API. If Elasticsearch security features are enabled, do not give users + * write privileges on the .watches index. + *

+ * When you add a watch you can also define its initial active state by setting + * the active parameter. + *

+ * When Elasticsearch security features are enabled, your watch can index or + * search only on indices for which the user that stored the watch has + * privileges. If the user is able to read index a, but not index + * b, the same will apply when the watch runs. * * @see API * specification diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/QueryWatchesRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/QueryWatchesRequest.java index f9f2a8da9..75f7c2a46 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/QueryWatchesRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/QueryWatchesRequest.java @@ -61,7 +61,8 @@ // typedef: watcher.query_watches.Request /** - * Retrieves stored watches. + * Query watches. Get all registered watches in a paginated manner and + * optionally filter watches by a query. * * @see API * specification diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/StartWatcherRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/StartWatcherRequest.java index cedaadac6..a220fde45 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/StartWatcherRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/StartWatcherRequest.java @@ -50,7 +50,8 @@ // typedef: watcher.start.Request /** - * Starts Watcher if it is not already running. + * Start the watch service. Start the Watcher service if it is not already + * running. * * @see API * specification diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/StopWatcherRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/StopWatcherRequest.java index 2458b25c7..a0e87e75b 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/StopWatcherRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/StopWatcherRequest.java @@ -50,7 +50,7 @@ // typedef: watcher.stop.Request /** - * Stops Watcher if it is running. + * Stop the watch service. Stop the Watcher service if it is running. * * @see API * specification diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/WatcherStatsRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/WatcherStatsRequest.java index 0c7fccd37..c6c40a9d0 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/WatcherStatsRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/watcher/WatcherStatsRequest.java @@ -58,7 +58,7 @@ // typedef: watcher.stats.Request /** - * Retrieves the current Watcher metrics. + * Get Watcher statistics. * * @see API * specification diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/ElasticsearchXpackAsyncClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/ElasticsearchXpackAsyncClient.java index c29569deb..567859792 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/ElasticsearchXpackAsyncClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/ElasticsearchXpackAsyncClient.java @@ -68,8 +68,14 @@ public ElasticsearchXpackAsyncClient withTransportOptions(@Nullable TransportOpt // ----- Endpoint: xpack.info /** - * Provides general information about the installed X-Pack features. - * + * Get information. The information provided by the API includes: + *

    + *
  • Build information including the build number and timestamp.
  • + *
  • License information about the currently installed license.
  • + *
  • Feature information for the features that are currently enabled and + * available under the current license.
  • + *
+ * * @see Documentation * on elastic.co @@ -83,8 +89,14 @@ public CompletableFuture info(XpackInfoRequest request) { } /** - * Provides general information about the installed X-Pack features. - * + * Get information. The information provided by the API includes: + *
    + *
  • Build information including the build number and timestamp.
  • + *
  • License information about the currently installed license.
  • + *
  • Feature information for the features that are currently enabled and + * available under the current license.
  • + *
+ * * @param fn * a function that initializes a builder to create the * {@link XpackInfoRequest} @@ -99,8 +111,14 @@ public final CompletableFuture info( } /** - * Provides general information about the installed X-Pack features. - * + * Get information. The information provided by the API includes: + *
    + *
  • Build information including the build number and timestamp.
  • + *
  • License information about the currently installed license.
  • + *
  • Feature information for the features that are currently enabled and + * available under the current license.
  • + *
+ * * @see Documentation * on elastic.co @@ -114,8 +132,9 @@ public CompletableFuture info() { // ----- Endpoint: xpack.usage /** - * This API provides information about which features are currently enabled and - * available under the current license and some usage statistics. + * Get usage information. Get information about the features that are currently + * enabled and available under the current license. The API also provides some + * usage statistics. * * @see Documentation @@ -130,8 +149,9 @@ public CompletableFuture usage(XpackUsageRequest request) { } /** - * This API provides information about which features are currently enabled and - * available under the current license and some usage statistics. + * Get usage information. Get information about the features that are currently + * enabled and available under the current license. The API also provides some + * usage statistics. * * @param fn * a function that initializes a builder to create the @@ -147,8 +167,9 @@ public final CompletableFuture usage( } /** - * This API provides information about which features are currently enabled and - * available under the current license and some usage statistics. + * Get usage information. Get information about the features that are currently + * enabled and available under the current license. The API also provides some + * usage statistics. * * @see Documentation diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/ElasticsearchXpackClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/ElasticsearchXpackClient.java index 890bd6d1d..5502d5c43 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/ElasticsearchXpackClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/ElasticsearchXpackClient.java @@ -68,8 +68,14 @@ public ElasticsearchXpackClient withTransportOptions(@Nullable TransportOptions // ----- Endpoint: xpack.info /** - * Provides general information about the installed X-Pack features. - * + * Get information. The information provided by the API includes: + *
    + *
  • Build information including the build number and timestamp.
  • + *
  • License information about the currently installed license.
  • + *
  • Feature information for the features that are currently enabled and + * available under the current license.
  • + *
+ * * @see
Documentation * on elastic.co @@ -83,8 +89,14 @@ public XpackInfoResponse info(XpackInfoRequest request) throws IOException, Elas } /** - * Provides general information about the installed X-Pack features. - * + * Get information. The information provided by the API includes: + *
    + *
  • Build information including the build number and timestamp.
  • + *
  • License information about the currently installed license.
  • + *
  • Feature information for the features that are currently enabled and + * available under the current license.
  • + *
+ * * @param fn * a function that initializes a builder to create the * {@link XpackInfoRequest} @@ -99,8 +111,14 @@ public final XpackInfoResponse info(Function + *
  • Build information including the build number and timestamp.
  • + *
  • License information about the currently installed license.
  • + *
  • Feature information for the features that are currently enabled and + * available under the current license.
  • + * + * * @see Documentation * on elastic.co @@ -114,8 +132,9 @@ public XpackInfoResponse info() throws IOException, ElasticsearchException { // ----- Endpoint: xpack.usage /** - * This API provides information about which features are currently enabled and - * available under the current license and some usage statistics. + * Get usage information. Get information about the features that are currently + * enabled and available under the current license. The API also provides some + * usage statistics. * * @see Documentation @@ -130,8 +149,9 @@ public XpackUsageResponse usage(XpackUsageRequest request) throws IOException, E } /** - * This API provides information about which features are currently enabled and - * available under the current license and some usage statistics. + * Get usage information. Get information about the features that are currently + * enabled and available under the current license. The API also provides some + * usage statistics. * * @param fn * a function that initializes a builder to create the @@ -147,8 +167,9 @@ public final XpackUsageResponse usage(FunctionDocumentation diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/XpackInfoRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/XpackInfoRequest.java index 09787d0d0..b94596875 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/XpackInfoRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/XpackInfoRequest.java @@ -59,8 +59,14 @@ // typedef: xpack.info.Request /** - * Provides general information about the installed X-Pack features. - * + * Get information. The information provided by the API includes: + *
      + *
    • Build information including the build number and timestamp.
    • + *
    • License information about the currently installed license.
    • + *
    • Feature information for the features that are currently enabled and + * available under the current license.
    • + *
    + * * @see
    API * specification */ diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/XpackUsageRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/XpackUsageRequest.java index 4d44ca92f..ac5675e3f 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/XpackUsageRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/XpackUsageRequest.java @@ -55,8 +55,9 @@ // typedef: xpack.usage.Request /** - * This API provides information about which features are currently enabled and - * available under the current license and some usage statistics. + * Get usage information. Get information about the features that are currently + * enabled and available under the current license. The API also provides some + * usage statistics. * * @see API * specification