From 230a92cf3bf2d13015cd08b93a6d5b5094caa039 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 17:29:55 +1200 Subject: [PATCH] Re-generate client code using latest OpenSearch API specification (2024-09-23) (#1113) Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../client/opensearch/ml/Action.java | 289 +++++ .../client/opensearch/ml/ClientConfig.java | 282 +++++ .../opensearch/ml/CreateConnectorRequest.java | 368 ++++++ .../ml/CreateConnectorResponse.java | 114 ++ .../client/opensearch/ml/Credential.java | 217 ++++ .../opensearch/ml/DeleteAgentRequest.java | 101 ++ .../opensearch/ml/DeleteAgentResponse.java | 76 ++ .../opensearch/ml/DeleteConnectorRequest.java | 101 ++ .../ml/DeleteConnectorResponse.java | 76 ++ .../client/opensearch/ml/Headers.java | 161 +++ .../opensearch/client/opensearch/ml/LLM.java | 161 +++ .../client/opensearch/ml/Memory.java | 114 ++ .../ml/OpenSearchMlAsyncClient.java | 82 ++ .../opensearch/ml/OpenSearchMlClient.java | 76 ++ .../opensearch/ml/RegisterAgentsRequest.java | 389 ++++++ .../opensearch/ml/RegisterAgentsResponse.java | 114 ++ .../client/opensearch/ml/ToolItems.java | 236 ++++ java-codegen/opensearch-openapi.yaml | 1085 ++++++++++++++++- 18 files changed, 3980 insertions(+), 62 deletions(-) create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/Action.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/ClientConfig.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateConnectorRequest.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateConnectorResponse.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/Credential.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgentRequest.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgentResponse.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorRequest.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorResponse.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/Headers.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/LLM.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/Memory.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsRequest.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsResponse.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/ToolItems.java diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Action.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Action.java new file mode 100644 index 0000000000..e9912634cc --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Action.java @@ -0,0 +1,289 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: ml.Action + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class Action implements PlainJsonSerializable { + + @Nullable + private final String actionType; + + @Nullable + private final Headers headers; + + @Nullable + private final String method; + + @Nullable + private final String postProcessFunction; + + @Nullable + private final String preProcessFunction; + + @Nullable + private final String requestBody; + + @Nullable + private final String url; + + // --------------------------------------------------------------------------------------------- + + private Action(Builder builder) { + this.actionType = builder.actionType; + this.headers = builder.headers; + this.method = builder.method; + this.postProcessFunction = builder.postProcessFunction; + this.preProcessFunction = builder.preProcessFunction; + this.requestBody = builder.requestBody; + this.url = builder.url; + } + + public static Action of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code action_type} + */ + @Nullable + public final String actionType() { + return this.actionType; + } + + /** + * API name: {@code headers} + */ + @Nullable + public final Headers headers() { + return this.headers; + } + + /** + * API name: {@code method} + */ + @Nullable + public final String method() { + return this.method; + } + + /** + * API name: {@code post_process_function} + */ + @Nullable + public final String postProcessFunction() { + return this.postProcessFunction; + } + + /** + * API name: {@code pre_process_function} + */ + @Nullable + public final String preProcessFunction() { + return this.preProcessFunction; + } + + /** + * API name: {@code request_body} + */ + @Nullable + public final String requestBody() { + return this.requestBody; + } + + /** + * API name: {@code url} + */ + @Nullable + public final String url() { + return this.url; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.actionType != null) { + generator.writeKey("action_type"); + generator.write(this.actionType); + } + + if (this.headers != null) { + generator.writeKey("headers"); + this.headers.serialize(generator, mapper); + } + + if (this.method != null) { + generator.writeKey("method"); + generator.write(this.method); + } + + if (this.postProcessFunction != null) { + generator.writeKey("post_process_function"); + generator.write(this.postProcessFunction); + } + + if (this.preProcessFunction != null) { + generator.writeKey("pre_process_function"); + generator.write(this.preProcessFunction); + } + + if (this.requestBody != null) { + generator.writeKey("request_body"); + generator.write(this.requestBody); + } + + if (this.url != null) { + generator.writeKey("url"); + generator.write(this.url); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link Action}. + */ + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private String actionType; + @Nullable + private Headers headers; + @Nullable + private String method; + @Nullable + private String postProcessFunction; + @Nullable + private String preProcessFunction; + @Nullable + private String requestBody; + @Nullable + private String url; + + /** + * API name: {@code action_type} + */ + public final Builder actionType(@Nullable String value) { + this.actionType = value; + return this; + } + + /** + * API name: {@code headers} + */ + public final Builder headers(@Nullable Headers value) { + this.headers = value; + return this; + } + + /** + * API name: {@code headers} + */ + public final Builder headers(Function> fn) { + return headers(fn.apply(new Headers.Builder()).build()); + } + + /** + * API name: {@code method} + */ + public final Builder method(@Nullable String value) { + this.method = value; + return this; + } + + /** + * API name: {@code post_process_function} + */ + public final Builder postProcessFunction(@Nullable String value) { + this.postProcessFunction = value; + return this; + } + + /** + * API name: {@code pre_process_function} + */ + public final Builder preProcessFunction(@Nullable String value) { + this.preProcessFunction = value; + return this; + } + + /** + * API name: {@code request_body} + */ + public final Builder requestBody(@Nullable String value) { + this.requestBody = value; + return this; + } + + /** + * API name: {@code url} + */ + public final Builder url(@Nullable String value) { + this.url = value; + return this; + } + + /** + * Builds a {@link Action}. + * + * @throws NullPointerException if some of the required fields are null. + */ + public Action build() { + _checkSingleUse(); + + return new Action(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link Action} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + Action::setupActionDeserializer + ); + + protected static void setupActionDeserializer(ObjectDeserializer op) { + op.add(Builder::actionType, JsonpDeserializer.stringDeserializer(), "action_type"); + op.add(Builder::headers, Headers._DESERIALIZER, "headers"); + op.add(Builder::method, JsonpDeserializer.stringDeserializer(), "method"); + op.add(Builder::postProcessFunction, JsonpDeserializer.stringDeserializer(), "post_process_function"); + op.add(Builder::preProcessFunction, JsonpDeserializer.stringDeserializer(), "pre_process_function"); + op.add(Builder::requestBody, JsonpDeserializer.stringDeserializer(), "request_body"); + op.add(Builder::url, JsonpDeserializer.stringDeserializer(), "url"); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ClientConfig.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ClientConfig.java new file mode 100644 index 0000000000..e3907e7f59 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ClientConfig.java @@ -0,0 +1,282 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: ml.ClientConfig + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class ClientConfig implements PlainJsonSerializable { + + @Nullable + private final Integer connectionTimeout; + + @Nullable + private final Integer maxConnection; + + @Nullable + private final Integer maxRetryTimes; + + @Nullable + private final Integer readTimeout; + + @Nullable + private final Integer retryBackoffMillis; + + @Nullable + private final String retryBackoffPolicy; + + @Nullable + private final Integer retryTimeoutSeconds; + + // --------------------------------------------------------------------------------------------- + + private ClientConfig(Builder builder) { + this.connectionTimeout = builder.connectionTimeout; + this.maxConnection = builder.maxConnection; + this.maxRetryTimes = builder.maxRetryTimes; + this.readTimeout = builder.readTimeout; + this.retryBackoffMillis = builder.retryBackoffMillis; + this.retryBackoffPolicy = builder.retryBackoffPolicy; + this.retryTimeoutSeconds = builder.retryTimeoutSeconds; + } + + public static ClientConfig of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code connection_timeout} + */ + @Nullable + public final Integer connectionTimeout() { + return this.connectionTimeout; + } + + /** + * API name: {@code max_connection} + */ + @Nullable + public final Integer maxConnection() { + return this.maxConnection; + } + + /** + * API name: {@code max_retry_times} + */ + @Nullable + public final Integer maxRetryTimes() { + return this.maxRetryTimes; + } + + /** + * API name: {@code read_timeout} + */ + @Nullable + public final Integer readTimeout() { + return this.readTimeout; + } + + /** + * API name: {@code retry_backoff_millis} + */ + @Nullable + public final Integer retryBackoffMillis() { + return this.retryBackoffMillis; + } + + /** + * API name: {@code retry_backoff_policy} + */ + @Nullable + public final String retryBackoffPolicy() { + return this.retryBackoffPolicy; + } + + /** + * API name: {@code retry_timeout_seconds} + */ + @Nullable + public final Integer retryTimeoutSeconds() { + return this.retryTimeoutSeconds; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.connectionTimeout != null) { + generator.writeKey("connection_timeout"); + generator.write(this.connectionTimeout); + } + + if (this.maxConnection != null) { + generator.writeKey("max_connection"); + generator.write(this.maxConnection); + } + + if (this.maxRetryTimes != null) { + generator.writeKey("max_retry_times"); + generator.write(this.maxRetryTimes); + } + + if (this.readTimeout != null) { + generator.writeKey("read_timeout"); + generator.write(this.readTimeout); + } + + if (this.retryBackoffMillis != null) { + generator.writeKey("retry_backoff_millis"); + generator.write(this.retryBackoffMillis); + } + + if (this.retryBackoffPolicy != null) { + generator.writeKey("retry_backoff_policy"); + generator.write(this.retryBackoffPolicy); + } + + if (this.retryTimeoutSeconds != null) { + generator.writeKey("retry_timeout_seconds"); + generator.write(this.retryTimeoutSeconds); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ClientConfig}. + */ + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private Integer connectionTimeout; + @Nullable + private Integer maxConnection; + @Nullable + private Integer maxRetryTimes; + @Nullable + private Integer readTimeout; + @Nullable + private Integer retryBackoffMillis; + @Nullable + private String retryBackoffPolicy; + @Nullable + private Integer retryTimeoutSeconds; + + /** + * API name: {@code connection_timeout} + */ + public final Builder connectionTimeout(@Nullable Integer value) { + this.connectionTimeout = value; + return this; + } + + /** + * API name: {@code max_connection} + */ + public final Builder maxConnection(@Nullable Integer value) { + this.maxConnection = value; + return this; + } + + /** + * API name: {@code max_retry_times} + */ + public final Builder maxRetryTimes(@Nullable Integer value) { + this.maxRetryTimes = value; + return this; + } + + /** + * API name: {@code read_timeout} + */ + public final Builder readTimeout(@Nullable Integer value) { + this.readTimeout = value; + return this; + } + + /** + * API name: {@code retry_backoff_millis} + */ + public final Builder retryBackoffMillis(@Nullable Integer value) { + this.retryBackoffMillis = value; + return this; + } + + /** + * API name: {@code retry_backoff_policy} + */ + public final Builder retryBackoffPolicy(@Nullable String value) { + this.retryBackoffPolicy = value; + return this; + } + + /** + * API name: {@code retry_timeout_seconds} + */ + public final Builder retryTimeoutSeconds(@Nullable Integer value) { + this.retryTimeoutSeconds = value; + return this; + } + + /** + * Builds a {@link ClientConfig}. + * + * @throws NullPointerException if some of the required fields are null. + */ + public ClientConfig build() { + _checkSingleUse(); + + return new ClientConfig(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ClientConfig} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + ClientConfig::setupClientConfigDeserializer + ); + + protected static void setupClientConfigDeserializer(ObjectDeserializer op) { + op.add(Builder::connectionTimeout, JsonpDeserializer.integerDeserializer(), "connection_timeout"); + op.add(Builder::maxConnection, JsonpDeserializer.integerDeserializer(), "max_connection"); + op.add(Builder::maxRetryTimes, JsonpDeserializer.integerDeserializer(), "max_retry_times"); + op.add(Builder::readTimeout, JsonpDeserializer.integerDeserializer(), "read_timeout"); + op.add(Builder::retryBackoffMillis, JsonpDeserializer.integerDeserializer(), "retry_backoff_millis"); + op.add(Builder::retryBackoffPolicy, JsonpDeserializer.stringDeserializer(), "retry_backoff_policy"); + op.add(Builder::retryTimeoutSeconds, JsonpDeserializer.integerDeserializer(), "retry_timeout_seconds"); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateConnectorRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateConnectorRequest.java new file mode 100644 index 0000000000..f9233dd6a9 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateConnectorRequest.java @@ -0,0 +1,368 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonData; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.RequestBase; +import org.opensearch.client.transport.Endpoint; +import org.opensearch.client.transport.endpoints.SimpleEndpoint; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: ml.create_connector.Request + +/** + * Creates a standalone connector. + */ +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class CreateConnectorRequest extends RequestBase implements PlainJsonSerializable { + + private final List actions; + + @Nullable + private final ClientConfig clientConfig; + + private final Credential credential; + + private final String description; + + private final String name; + + private final Map parameters; + + private final String protocol; + + private final int version; + + // --------------------------------------------------------------------------------------------- + + private CreateConnectorRequest(Builder builder) { + this.actions = ApiTypeHelper.unmodifiableRequired(builder.actions, this, "actions"); + this.clientConfig = builder.clientConfig; + this.credential = ApiTypeHelper.requireNonNull(builder.credential, this, "credential"); + this.description = ApiTypeHelper.requireNonNull(builder.description, this, "description"); + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.parameters = ApiTypeHelper.unmodifiableRequired(builder.parameters, this, "parameters"); + this.protocol = ApiTypeHelper.requireNonNull(builder.protocol, this, "protocol"); + this.version = ApiTypeHelper.requireNonNull(builder.version, this, "version"); + } + + public static CreateConnectorRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code actions} + */ + public final List actions() { + return this.actions; + } + + /** + * API name: {@code client_config} + */ + @Nullable + public final ClientConfig clientConfig() { + return this.clientConfig; + } + + /** + * Required - API name: {@code credential} + */ + public final Credential credential() { + return this.credential; + } + + /** + * Required - API name: {@code description} + */ + public final String description() { + return this.description; + } + + /** + * Required - API name: {@code name} + */ + public final String name() { + return this.name; + } + + /** + * Required - API name: {@code parameters} + */ + public final Map parameters() { + return this.parameters; + } + + /** + * Required - API name: {@code protocol} + */ + public final String protocol() { + return this.protocol; + } + + /** + * Required - API name: {@code version} + */ + public final int version() { + return this.version; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + generator.writeKey("actions"); + generator.writeStartArray(); + for (Action item0 : this.actions) { + item0.serialize(generator, mapper); + } + generator.writeEnd(); + + if (this.clientConfig != null) { + generator.writeKey("client_config"); + this.clientConfig.serialize(generator, mapper); + } + + generator.writeKey("credential"); + this.credential.serialize(generator, mapper); + + generator.writeKey("description"); + generator.write(this.description); + + generator.writeKey("name"); + generator.write(this.name); + + generator.writeKey("parameters"); + generator.writeStartObject(); + for (Map.Entry item0 : this.parameters.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + + generator.writeKey("protocol"); + generator.write(this.protocol); + + generator.writeKey("version"); + generator.write(this.version); + } + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link CreateConnectorRequest}. + */ + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + private List actions; + @Nullable + private ClientConfig clientConfig; + private Credential credential; + private String description; + private String name; + private Map parameters; + private String protocol; + private Integer version; + + /** + * Required - API name: {@code actions} + * + *

+ * Adds all elements of list to actions. + *

+ */ + public final Builder actions(List list) { + this.actions = _listAddAll(this.actions, list); + return this; + } + + /** + * Required - API name: {@code actions} + * + *

+ * Adds one or more values to actions. + *

+ */ + public final Builder actions(Action value, Action... values) { + this.actions = _listAdd(this.actions, value, values); + return this; + } + + /** + * Required - API name: {@code actions} + * + *

+ * Adds a value to actions using a builder lambda. + *

+ */ + public final Builder actions(Function> fn) { + return actions(fn.apply(new Action.Builder()).build()); + } + + /** + * API name: {@code client_config} + */ + public final Builder clientConfig(@Nullable ClientConfig value) { + this.clientConfig = value; + return this; + } + + /** + * API name: {@code client_config} + */ + public final Builder clientConfig(Function> fn) { + return clientConfig(fn.apply(new ClientConfig.Builder()).build()); + } + + /** + * Required - API name: {@code credential} + */ + public final Builder credential(Credential value) { + this.credential = value; + return this; + } + + /** + * Required - API name: {@code credential} + */ + public final Builder credential(Function> fn) { + return credential(fn.apply(new Credential.Builder()).build()); + } + + /** + * Required - API name: {@code description} + */ + public final Builder description(String value) { + this.description = value; + return this; + } + + /** + * Required - API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + /** + * Required - API name: {@code parameters} + * + *

+ * Adds all elements of map to parameters. + *

+ */ + public final Builder parameters(Map map) { + this.parameters = _mapPutAll(this.parameters, map); + return this; + } + + /** + * Required - API name: {@code parameters} + * + *

+ * Adds an entry to parameters. + *

+ */ + public final Builder parameters(String key, JsonData value) { + this.parameters = _mapPut(this.parameters, key, value); + return this; + } + + /** + * Required - API name: {@code protocol} + */ + public final Builder protocol(String value) { + this.protocol = value; + return this; + } + + /** + * Required - API name: {@code version} + */ + public final Builder version(int value) { + this.version = value; + return this; + } + + /** + * Builds a {@link CreateConnectorRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + public CreateConnectorRequest build() { + _checkSingleUse(); + + return new CreateConnectorRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link CreateConnectorRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + CreateConnectorRequest::setupCreateConnectorRequestDeserializer + ); + + protected static void setupCreateConnectorRequestDeserializer(ObjectDeserializer op) { + op.add(Builder::actions, JsonpDeserializer.arrayDeserializer(Action._DESERIALIZER), "actions"); + op.add(Builder::clientConfig, ClientConfig._DESERIALIZER, "client_config"); + op.add(Builder::credential, Credential._DESERIALIZER, "credential"); + op.add(Builder::description, JsonpDeserializer.stringDeserializer(), "description"); + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::parameters, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "parameters"); + op.add(Builder::protocol, JsonpDeserializer.stringDeserializer(), "protocol"); + op.add(Builder::version, JsonpDeserializer.integerDeserializer(), "version"); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code ml.create_connector}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "POST", + // Request path + request -> "/_plugins/_ml/connectors/_create", + // Request parameters + SimpleEndpoint.emptyMap(), + SimpleEndpoint.emptyMap(), + true, + CreateConnectorResponse._DESERIALIZER + ); +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateConnectorResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateConnectorResponse.java new file mode 100644 index 0000000000..5bed16c40a --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateConnectorResponse.java @@ -0,0 +1,114 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: ml.create_connector.Response + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class CreateConnectorResponse implements PlainJsonSerializable { + + @Nullable + private final String connectorId; + + // --------------------------------------------------------------------------------------------- + + private CreateConnectorResponse(Builder builder) { + this.connectorId = builder.connectorId; + } + + public static CreateConnectorResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code connector_id} + */ + @Nullable + public final String connectorId() { + return this.connectorId; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.connectorId != null) { + generator.writeKey("connector_id"); + generator.write(this.connectorId); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link CreateConnectorResponse}. + */ + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private String connectorId; + + /** + * API name: {@code connector_id} + */ + public final Builder connectorId(@Nullable String value) { + this.connectorId = value; + return this; + } + + /** + * Builds a {@link CreateConnectorResponse}. + * + * @throws NullPointerException if some of the required fields are null. + */ + public CreateConnectorResponse build() { + _checkSingleUse(); + + return new CreateConnectorResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link CreateConnectorResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + CreateConnectorResponse::setupCreateConnectorResponseDeserializer + ); + + protected static void setupCreateConnectorResponseDeserializer(ObjectDeserializer op) { + op.add(Builder::connectorId, JsonpDeserializer.stringDeserializer(), "connector_id"); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Credential.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Credential.java new file mode 100644 index 0000000000..8e32830e5e --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Credential.java @@ -0,0 +1,217 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonData; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: ml.Credential + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class Credential implements PlainJsonSerializable { + + @Nullable + private final String accessKey; + + @Nullable + private final String secretKey; + + @Nullable + private final String sessionToken; + + private final Map metadata; + + // --------------------------------------------------------------------------------------------- + + private Credential(Builder builder) { + this.accessKey = builder.accessKey; + this.secretKey = builder.secretKey; + this.sessionToken = builder.sessionToken; + this.metadata = ApiTypeHelper.unmodifiable(builder.metadata); + } + + public static Credential of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code access_key} + */ + @Nullable + public final String accessKey() { + return this.accessKey; + } + + /** + * API name: {@code secret_key} + */ + @Nullable + public final String secretKey() { + return this.secretKey; + } + + /** + * API name: {@code session_token} + */ + @Nullable + public final String sessionToken() { + return this.sessionToken; + } + + /** + */ + public final Map metadata() { + return this.metadata; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + for (Map.Entry item0 : this.metadata.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + if (this.accessKey != null) { + generator.writeKey("access_key"); + generator.write(this.accessKey); + } + + if (this.secretKey != null) { + generator.writeKey("secret_key"); + generator.write(this.secretKey); + } + + if (this.sessionToken != null) { + generator.writeKey("session_token"); + generator.write(this.sessionToken); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link Credential}. + */ + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private String accessKey; + @Nullable + private String secretKey; + @Nullable + private String sessionToken; + @Nullable + private Map metadata; + + /** + * API name: {@code access_key} + */ + public final Builder accessKey(@Nullable String value) { + this.accessKey = value; + return this; + } + + /** + * API name: {@code secret_key} + */ + public final Builder secretKey(@Nullable String value) { + this.secretKey = value; + return this; + } + + /** + * API name: {@code session_token} + */ + public final Builder sessionToken(@Nullable String value) { + this.sessionToken = value; + return this; + } + + /** + * + *

+ * Adds all elements of map to metadata. + *

+ */ + public final Builder metadata(Map map) { + this.metadata = _mapPutAll(this.metadata, map); + return this; + } + + /** + * + *

+ * Adds an entry to metadata. + *

+ */ + public final Builder metadata(String key, JsonData value) { + this.metadata = _mapPut(this.metadata, key, value); + return this; + } + + /** + * Builds a {@link Credential}. + * + * @throws NullPointerException if some of the required fields are null. + */ + public Credential build() { + _checkSingleUse(); + + return new Credential(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link Credential} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + Credential::setupCredentialDeserializer + ); + + protected static void setupCredentialDeserializer(ObjectDeserializer op) { + op.add(Builder::accessKey, JsonpDeserializer.stringDeserializer(), "access_key"); + op.add(Builder::secretKey, JsonpDeserializer.stringDeserializer(), "secret_key"); + op.add(Builder::sessionToken, JsonpDeserializer.stringDeserializer(), "session_token"); + op.setUnknownFieldHandler((builder, name, parser, mapper) -> { + if (builder.metadata == null) { + builder.metadata = new HashMap<>(); + } + builder.metadata.put(name, JsonData._DESERIALIZER.deserialize(parser, mapper)); + }); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgentRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgentRequest.java new file mode 100644 index 0000000000..74f9771997 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgentRequest.java @@ -0,0 +1,101 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import java.util.function.Function; +import javax.annotation.Generated; +import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.RequestBase; +import org.opensearch.client.transport.Endpoint; +import org.opensearch.client.transport.endpoints.SimpleEndpoint; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: ml.delete_agent.Request + +/** + * Delete an agent. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class DeleteAgentRequest extends RequestBase { + + private final String agentId; + + // --------------------------------------------------------------------------------------------- + + private DeleteAgentRequest(Builder builder) { + this.agentId = ApiTypeHelper.requireNonNull(builder.agentId, this, "agentId"); + } + + public static DeleteAgentRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code agent_id} + */ + public final String agentId() { + return this.agentId; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DeleteAgentRequest}. + */ + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + private String agentId; + + /** + * Required - API name: {@code agent_id} + */ + public final Builder agentId(String value) { + this.agentId = value; + return this; + } + + /** + * Builds a {@link DeleteAgentRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + public DeleteAgentRequest build() { + _checkSingleUse(); + + return new DeleteAgentRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code ml.delete_agent}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "DELETE", + // Request path + request -> { + StringBuilder buf = new StringBuilder(); + buf.append("/_plugins/_ml/agents/"); + SimpleEndpoint.pathEncode(request.agentId, buf); + return buf.toString(); + }, + // Request parameters + SimpleEndpoint.emptyMap(), + SimpleEndpoint.emptyMap(), + false, + DeleteAgentResponse._DESERIALIZER + ); +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgentResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgentResponse.java new file mode 100644 index 0000000000..8624845cc7 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgentResponse.java @@ -0,0 +1,76 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import java.util.function.Function; +import javax.annotation.Generated; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.opensearch._types.WriteResponseBase; +import org.opensearch.client.util.ObjectBuilder; + +// typedef: ml.delete_agent.Response + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class DeleteAgentResponse extends WriteResponseBase { + + // --------------------------------------------------------------------------------------------- + + private DeleteAgentResponse(Builder builder) { + super(builder); + } + + public static DeleteAgentResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DeleteAgentResponse}. + */ + public static class Builder extends WriteResponseBase.AbstractBuilder implements ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DeleteAgentResponse}. + * + * @throws NullPointerException if some of the required fields are null. + */ + public DeleteAgentResponse build() { + _checkSingleUse(); + + return new DeleteAgentResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DeleteAgentResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + DeleteAgentResponse::setupDeleteAgentResponseDeserializer + ); + + protected static void setupDeleteAgentResponseDeserializer(ObjectDeserializer op) { + WriteResponseBase.setupWriteResponseBaseDeserializer(op); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorRequest.java new file mode 100644 index 0000000000..30e0f7d202 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorRequest.java @@ -0,0 +1,101 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import java.util.function.Function; +import javax.annotation.Generated; +import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.RequestBase; +import org.opensearch.client.transport.Endpoint; +import org.opensearch.client.transport.endpoints.SimpleEndpoint; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: ml.delete_connector.Request + +/** + * Deletes a standalone connector. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class DeleteConnectorRequest extends RequestBase { + + private final String connectorId; + + // --------------------------------------------------------------------------------------------- + + private DeleteConnectorRequest(Builder builder) { + this.connectorId = ApiTypeHelper.requireNonNull(builder.connectorId, this, "connectorId"); + } + + public static DeleteConnectorRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code connector_id} + */ + public final String connectorId() { + return this.connectorId; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DeleteConnectorRequest}. + */ + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + private String connectorId; + + /** + * Required - API name: {@code connector_id} + */ + public final Builder connectorId(String value) { + this.connectorId = value; + return this; + } + + /** + * Builds a {@link DeleteConnectorRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + public DeleteConnectorRequest build() { + _checkSingleUse(); + + return new DeleteConnectorRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code ml.delete_connector}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "DELETE", + // Request path + request -> { + StringBuilder buf = new StringBuilder(); + buf.append("/_plugins/_ml/connectors/"); + SimpleEndpoint.pathEncode(request.connectorId, buf); + return buf.toString(); + }, + // Request parameters + SimpleEndpoint.emptyMap(), + SimpleEndpoint.emptyMap(), + false, + DeleteConnectorResponse._DESERIALIZER + ); +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorResponse.java new file mode 100644 index 0000000000..1ba0900cc8 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorResponse.java @@ -0,0 +1,76 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import java.util.function.Function; +import javax.annotation.Generated; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.opensearch._types.WriteResponseBase; +import org.opensearch.client.util.ObjectBuilder; + +// typedef: ml.delete_connector.Response + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class DeleteConnectorResponse extends WriteResponseBase { + + // --------------------------------------------------------------------------------------------- + + private DeleteConnectorResponse(Builder builder) { + super(builder); + } + + public static DeleteConnectorResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DeleteConnectorResponse}. + */ + public static class Builder extends WriteResponseBase.AbstractBuilder implements ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DeleteConnectorResponse}. + * + * @throws NullPointerException if some of the required fields are null. + */ + public DeleteConnectorResponse build() { + _checkSingleUse(); + + return new DeleteConnectorResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DeleteConnectorResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + DeleteConnectorResponse::setupDeleteConnectorResponseDeserializer + ); + + protected static void setupDeleteConnectorResponseDeserializer(ObjectDeserializer op) { + WriteResponseBase.setupWriteResponseBaseDeserializer(op); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Headers.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Headers.java new file mode 100644 index 0000000000..837e3b4332 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Headers.java @@ -0,0 +1,161 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonData; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: ml.Headers + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class Headers implements PlainJsonSerializable { + + @Nullable + private final String contentType; + + private final Map metadata; + + // --------------------------------------------------------------------------------------------- + + private Headers(Builder builder) { + this.contentType = builder.contentType; + this.metadata = ApiTypeHelper.unmodifiable(builder.metadata); + } + + public static Headers of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code content_type} + */ + @Nullable + public final String contentType() { + return this.contentType; + } + + /** + */ + public final Map metadata() { + return this.metadata; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + for (Map.Entry item0 : this.metadata.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + if (this.contentType != null) { + generator.writeKey("content_type"); + generator.write(this.contentType); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link Headers}. + */ + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private String contentType; + @Nullable + private Map metadata; + + /** + * API name: {@code content_type} + */ + public final Builder contentType(@Nullable String value) { + this.contentType = value; + return this; + } + + /** + * + *

+ * Adds all elements of map to metadata. + *

+ */ + public final Builder metadata(Map map) { + this.metadata = _mapPutAll(this.metadata, map); + return this; + } + + /** + * + *

+ * Adds an entry to metadata. + *

+ */ + public final Builder metadata(String key, JsonData value) { + this.metadata = _mapPut(this.metadata, key, value); + return this; + } + + /** + * Builds a {@link Headers}. + * + * @throws NullPointerException if some of the required fields are null. + */ + public Headers build() { + _checkSingleUse(); + + return new Headers(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link Headers} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + Headers::setupHeadersDeserializer + ); + + protected static void setupHeadersDeserializer(ObjectDeserializer op) { + op.add(Builder::contentType, JsonpDeserializer.stringDeserializer(), "content_type"); + op.setUnknownFieldHandler((builder, name, parser, mapper) -> { + if (builder.metadata == null) { + builder.metadata = new HashMap<>(); + } + builder.metadata.put(name, JsonData._DESERIALIZER.deserialize(parser, mapper)); + }); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/LLM.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/LLM.java new file mode 100644 index 0000000000..77a786f256 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/LLM.java @@ -0,0 +1,161 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.Map; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonData; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: ml.LLM + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class LLM implements PlainJsonSerializable { + + @Nullable + private final String modelId; + + private final Map parameters; + + // --------------------------------------------------------------------------------------------- + + private LLM(Builder builder) { + this.modelId = builder.modelId; + this.parameters = ApiTypeHelper.unmodifiable(builder.parameters); + } + + public static LLM of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code model_id} + */ + @Nullable + public final String modelId() { + return this.modelId; + } + + /** + * API name: {@code parameters} + */ + public final Map parameters() { + return this.parameters; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.modelId != null) { + generator.writeKey("model_id"); + generator.write(this.modelId); + } + + if (ApiTypeHelper.isDefined(this.parameters)) { + generator.writeKey("parameters"); + generator.writeStartObject(); + for (Map.Entry item0 : this.parameters.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link LLM}. + */ + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private String modelId; + @Nullable + private Map parameters; + + /** + * API name: {@code model_id} + */ + public final Builder modelId(@Nullable String value) { + this.modelId = value; + return this; + } + + /** + * API name: {@code parameters} + * + *

+ * Adds all elements of map to parameters. + *

+ */ + public final Builder parameters(Map map) { + this.parameters = _mapPutAll(this.parameters, map); + return this; + } + + /** + * API name: {@code parameters} + * + *

+ * Adds an entry to parameters. + *

+ */ + public final Builder parameters(String key, JsonData value) { + this.parameters = _mapPut(this.parameters, key, value); + return this; + } + + /** + * Builds a {@link LLM}. + * + * @throws NullPointerException if some of the required fields are null. + */ + public LLM build() { + _checkSingleUse(); + + return new LLM(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link LLM} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, LLM::setupLLMDeserializer); + + protected static void setupLLMDeserializer(ObjectDeserializer op) { + op.add(Builder::modelId, JsonpDeserializer.stringDeserializer(), "model_id"); + op.add(Builder::parameters, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "parameters"); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Memory.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Memory.java new file mode 100644 index 0000000000..dfc0a9083c --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Memory.java @@ -0,0 +1,114 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: ml.Memory + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class Memory implements PlainJsonSerializable { + + @Nullable + private final String type; + + // --------------------------------------------------------------------------------------------- + + private Memory(Builder builder) { + this.type = builder.type; + } + + public static Memory of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code type} + */ + @Nullable + public final String type() { + return this.type; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.type != null) { + generator.writeKey("type"); + generator.write(this.type); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link Memory}. + */ + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private String type; + + /** + * API name: {@code type} + */ + public final Builder type(@Nullable String value) { + this.type = value; + return this; + } + + /** + * Builds a {@link Memory}. + * + * @throws NullPointerException if some of the required fields are null. + */ + public Memory build() { + _checkSingleUse(); + + return new Memory(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link Memory} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + Memory::setupMemoryDeserializer + ); + + protected static void setupMemoryDeserializer(ObjectDeserializer op) { + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/OpenSearchMlAsyncClient.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/OpenSearchMlAsyncClient.java index e4199fca36..4f5332eb7f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/OpenSearchMlAsyncClient.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/OpenSearchMlAsyncClient.java @@ -41,6 +41,68 @@ public OpenSearchMlAsyncClient withTransportOptions(@Nullable TransportOptions t return new OpenSearchMlAsyncClient(this.transport, transportOptions); } + // ----- Endpoint: ml.create_connector + + /** + * Creates a standalone connector. + */ + public CompletableFuture createConnector(CreateConnectorRequest request) throws IOException, + OpenSearchException { + return this.transport.performRequestAsync(request, CreateConnectorRequest._ENDPOINT, this.transportOptions); + } + + /** + * Creates a standalone connector. + * + * @param fn a function that initializes a builder to create the {@link CreateConnectorRequest} + */ + public final CompletableFuture createConnector( + Function> fn + ) throws IOException, OpenSearchException { + return createConnector(fn.apply(new CreateConnectorRequest.Builder()).build()); + } + + // ----- Endpoint: ml.delete_agent + + /** + * Delete an agent. + */ + public CompletableFuture deleteAgent(DeleteAgentRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, DeleteAgentRequest._ENDPOINT, this.transportOptions); + } + + /** + * Delete an agent. + * + * @param fn a function that initializes a builder to create the {@link DeleteAgentRequest} + */ + public final CompletableFuture deleteAgent( + Function> fn + ) throws IOException, OpenSearchException { + return deleteAgent(fn.apply(new DeleteAgentRequest.Builder()).build()); + } + + // ----- Endpoint: ml.delete_connector + + /** + * Deletes a standalone connector. + */ + public CompletableFuture deleteConnector(DeleteConnectorRequest request) throws IOException, + OpenSearchException { + return this.transport.performRequestAsync(request, DeleteConnectorRequest._ENDPOINT, this.transportOptions); + } + + /** + * Deletes a standalone connector. + * + * @param fn a function that initializes a builder to create the {@link DeleteConnectorRequest} + */ + public final CompletableFuture deleteConnector( + Function> fn + ) throws IOException, OpenSearchException { + return deleteConnector(fn.apply(new DeleteConnectorRequest.Builder()).build()); + } + // ----- Endpoint: ml.delete_model /** @@ -160,6 +222,26 @@ public final CompletableFuture getTask(Function registerAgents(RegisterAgentsRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, RegisterAgentsRequest._ENDPOINT, this.transportOptions); + } + + /** + * Register an agent. + * + * @param fn a function that initializes a builder to create the {@link RegisterAgentsRequest} + */ + public final CompletableFuture registerAgents( + Function> fn + ) throws IOException, OpenSearchException { + return registerAgents(fn.apply(new RegisterAgentsRequest.Builder()).build()); + } + // ----- Endpoint: ml.register_model /** diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/OpenSearchMlClient.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/OpenSearchMlClient.java index 7e6fa317c2..a93402b689 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/OpenSearchMlClient.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/OpenSearchMlClient.java @@ -40,6 +40,63 @@ public OpenSearchMlClient withTransportOptions(@Nullable TransportOptions transp return new OpenSearchMlClient(this.transport, transportOptions); } + // ----- Endpoint: ml.create_connector + + /** + * Creates a standalone connector. + */ + public CreateConnectorResponse createConnector(CreateConnectorRequest request) throws IOException, OpenSearchException { + return this.transport.performRequest(request, CreateConnectorRequest._ENDPOINT, this.transportOptions); + } + + /** + * Creates a standalone connector. + * + * @param fn a function that initializes a builder to create the {@link CreateConnectorRequest} + */ + public final CreateConnectorResponse createConnector(Function> fn) + throws IOException, OpenSearchException { + return createConnector(fn.apply(new CreateConnectorRequest.Builder()).build()); + } + + // ----- Endpoint: ml.delete_agent + + /** + * Delete an agent. + */ + public DeleteAgentResponse deleteAgent(DeleteAgentRequest request) throws IOException, OpenSearchException { + return this.transport.performRequest(request, DeleteAgentRequest._ENDPOINT, this.transportOptions); + } + + /** + * Delete an agent. + * + * @param fn a function that initializes a builder to create the {@link DeleteAgentRequest} + */ + public final DeleteAgentResponse deleteAgent(Function> fn) + throws IOException, OpenSearchException { + return deleteAgent(fn.apply(new DeleteAgentRequest.Builder()).build()); + } + + // ----- Endpoint: ml.delete_connector + + /** + * Deletes a standalone connector. + */ + public DeleteConnectorResponse deleteConnector(DeleteConnectorRequest request) throws IOException, OpenSearchException { + return this.transport.performRequest(request, DeleteConnectorRequest._ENDPOINT, this.transportOptions); + } + + /** + * Deletes a standalone connector. + * + * @param fn a function that initializes a builder to create the {@link DeleteConnectorRequest} + */ + public final DeleteConnectorResponse deleteConnector(Function> fn) + throws IOException, OpenSearchException { + return deleteConnector(fn.apply(new DeleteConnectorRequest.Builder()).build()); + } + // ----- Endpoint: ml.delete_model /** @@ -155,6 +212,25 @@ public final GetTaskResponse getTask(Function> fn) + throws IOException, OpenSearchException { + return registerAgents(fn.apply(new RegisterAgentsRequest.Builder()).build()); + } + // ----- Endpoint: ml.register_model /** diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsRequest.java new file mode 100644 index 0000000000..155e0de881 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsRequest.java @@ -0,0 +1,389 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonData; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.RequestBase; +import org.opensearch.client.transport.Endpoint; +import org.opensearch.client.transport.endpoints.SimpleEndpoint; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: ml.register_agents.Request + +/** + * Register an agent. + */ +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class RegisterAgentsRequest extends RequestBase implements PlainJsonSerializable { + + @Nullable + private final String appType; + + @Nullable + private final String description; + + @Nullable + private final LLM llm; + + @Nullable + private final Memory memory; + + private final String name; + + private final Map parameters; + + private final List tools; + + private final String type; + + // --------------------------------------------------------------------------------------------- + + private RegisterAgentsRequest(Builder builder) { + this.appType = builder.appType; + this.description = builder.description; + this.llm = builder.llm; + this.memory = builder.memory; + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.parameters = ApiTypeHelper.unmodifiable(builder.parameters); + this.tools = ApiTypeHelper.unmodifiable(builder.tools); + this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); + } + + public static RegisterAgentsRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code app_type} + */ + @Nullable + public final String appType() { + return this.appType; + } + + /** + * API name: {@code description} + */ + @Nullable + public final String description() { + return this.description; + } + + /** + * API name: {@code llm} + */ + @Nullable + public final LLM llm() { + return this.llm; + } + + /** + * API name: {@code memory} + */ + @Nullable + public final Memory memory() { + return this.memory; + } + + /** + * Required - API name: {@code name} + */ + public final String name() { + return this.name; + } + + /** + * API name: {@code parameters} + */ + public final Map parameters() { + return this.parameters; + } + + /** + * API name: {@code tools} + */ + public final List tools() { + return this.tools; + } + + /** + * Required - API name: {@code type} + */ + public final String type() { + return this.type; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.appType != null) { + generator.writeKey("app_type"); + generator.write(this.appType); + } + + if (this.description != null) { + generator.writeKey("description"); + generator.write(this.description); + } + + if (this.llm != null) { + generator.writeKey("llm"); + this.llm.serialize(generator, mapper); + } + + if (this.memory != null) { + generator.writeKey("memory"); + this.memory.serialize(generator, mapper); + } + + generator.writeKey("name"); + generator.write(this.name); + + if (ApiTypeHelper.isDefined(this.parameters)) { + generator.writeKey("parameters"); + generator.writeStartObject(); + for (Map.Entry item0 : this.parameters.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (ApiTypeHelper.isDefined(this.tools)) { + generator.writeKey("tools"); + generator.writeStartArray(); + for (ToolItems item0 : this.tools) { + item0.serialize(generator, mapper); + } + generator.writeEnd(); + } + + generator.writeKey("type"); + generator.write(this.type); + } + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link RegisterAgentsRequest}. + */ + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private String appType; + @Nullable + private String description; + @Nullable + private LLM llm; + @Nullable + private Memory memory; + private String name; + @Nullable + private Map parameters; + @Nullable + private List tools; + private String type; + + /** + * API name: {@code app_type} + */ + public final Builder appType(@Nullable String value) { + this.appType = value; + return this; + } + + /** + * API name: {@code description} + */ + public final Builder description(@Nullable String value) { + this.description = value; + return this; + } + + /** + * API name: {@code llm} + */ + public final Builder llm(@Nullable LLM value) { + this.llm = value; + return this; + } + + /** + * API name: {@code llm} + */ + public final Builder llm(Function> fn) { + return llm(fn.apply(new LLM.Builder()).build()); + } + + /** + * API name: {@code memory} + */ + public final Builder memory(@Nullable Memory value) { + this.memory = value; + return this; + } + + /** + * API name: {@code memory} + */ + public final Builder memory(Function> fn) { + return memory(fn.apply(new Memory.Builder()).build()); + } + + /** + * Required - API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + /** + * API name: {@code parameters} + * + *

+ * Adds all elements of map to parameters. + *

+ */ + public final Builder parameters(Map map) { + this.parameters = _mapPutAll(this.parameters, map); + return this; + } + + /** + * API name: {@code parameters} + * + *

+ * Adds an entry to parameters. + *

+ */ + public final Builder parameters(String key, JsonData value) { + this.parameters = _mapPut(this.parameters, key, value); + return this; + } + + /** + * API name: {@code tools} + * + *

+ * Adds all elements of list to tools. + *

+ */ + public final Builder tools(List list) { + this.tools = _listAddAll(this.tools, list); + return this; + } + + /** + * API name: {@code tools} + * + *

+ * Adds one or more values to tools. + *

+ */ + public final Builder tools(ToolItems value, ToolItems... values) { + this.tools = _listAdd(this.tools, value, values); + return this; + } + + /** + * API name: {@code tools} + * + *

+ * Adds a value to tools using a builder lambda. + *

+ */ + public final Builder tools(Function> fn) { + return tools(fn.apply(new ToolItems.Builder()).build()); + } + + /** + * Required - API name: {@code type} + */ + public final Builder type(String value) { + this.type = value; + return this; + } + + /** + * Builds a {@link RegisterAgentsRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + public RegisterAgentsRequest build() { + _checkSingleUse(); + + return new RegisterAgentsRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link RegisterAgentsRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + RegisterAgentsRequest::setupRegisterAgentsRequestDeserializer + ); + + protected static void setupRegisterAgentsRequestDeserializer(ObjectDeserializer op) { + op.add(Builder::appType, JsonpDeserializer.stringDeserializer(), "app_type"); + op.add(Builder::description, JsonpDeserializer.stringDeserializer(), "description"); + op.add(Builder::llm, LLM._DESERIALIZER, "llm"); + op.add(Builder::memory, Memory._DESERIALIZER, "memory"); + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::parameters, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "parameters"); + op.add(Builder::tools, JsonpDeserializer.arrayDeserializer(ToolItems._DESERIALIZER), "tools"); + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code ml.register_agents}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "POST", + // Request path + request -> "/_plugins/_ml/agents/_register", + // Request parameters + SimpleEndpoint.emptyMap(), + SimpleEndpoint.emptyMap(), + true, + RegisterAgentsResponse._DESERIALIZER + ); +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsResponse.java new file mode 100644 index 0000000000..e69ff9e0de --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsResponse.java @@ -0,0 +1,114 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: ml.register_agents.Response + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class RegisterAgentsResponse implements PlainJsonSerializable { + + @Nullable + private final String agentId; + + // --------------------------------------------------------------------------------------------- + + private RegisterAgentsResponse(Builder builder) { + this.agentId = builder.agentId; + } + + public static RegisterAgentsResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code agent_id} + */ + @Nullable + public final String agentId() { + return this.agentId; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.agentId != null) { + generator.writeKey("agent_id"); + generator.write(this.agentId); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link RegisterAgentsResponse}. + */ + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private String agentId; + + /** + * API name: {@code agent_id} + */ + public final Builder agentId(@Nullable String value) { + this.agentId = value; + return this; + } + + /** + * Builds a {@link RegisterAgentsResponse}. + * + * @throws NullPointerException if some of the required fields are null. + */ + public RegisterAgentsResponse build() { + _checkSingleUse(); + + return new RegisterAgentsResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link RegisterAgentsResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + RegisterAgentsResponse::setupRegisterAgentsResponseDeserializer + ); + + protected static void setupRegisterAgentsResponseDeserializer(ObjectDeserializer op) { + op.add(Builder::agentId, JsonpDeserializer.stringDeserializer(), "agent_id"); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ToolItems.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ToolItems.java new file mode 100644 index 0000000000..b52d7fae3a --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ToolItems.java @@ -0,0 +1,236 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonData; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: ml.ToolItems + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class ToolItems implements PlainJsonSerializable { + + @Nullable + private final String name; + + private final Map parameters; + + @Nullable + private final String type; + + private final Map metadata; + + // --------------------------------------------------------------------------------------------- + + private ToolItems(Builder builder) { + this.name = builder.name; + this.parameters = ApiTypeHelper.unmodifiable(builder.parameters); + this.type = builder.type; + this.metadata = ApiTypeHelper.unmodifiable(builder.metadata); + } + + public static ToolItems of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code name} + */ + @Nullable + public final String name() { + return this.name; + } + + /** + * API name: {@code parameters} + */ + public final Map parameters() { + return this.parameters; + } + + /** + * API name: {@code type} + */ + @Nullable + public final String type() { + return this.type; + } + + /** + */ + public final Map metadata() { + return this.metadata; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + for (Map.Entry item0 : this.metadata.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + if (this.name != null) { + generator.writeKey("name"); + generator.write(this.name); + } + + if (ApiTypeHelper.isDefined(this.parameters)) { + generator.writeKey("parameters"); + generator.writeStartObject(); + for (Map.Entry item0 : this.parameters.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (this.type != null) { + generator.writeKey("type"); + generator.write(this.type); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ToolItems}. + */ + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private String name; + @Nullable + private Map parameters; + @Nullable + private String type; + @Nullable + private Map metadata; + + /** + * API name: {@code name} + */ + public final Builder name(@Nullable String value) { + this.name = value; + return this; + } + + /** + * API name: {@code parameters} + * + *

+ * Adds all elements of map to parameters. + *

+ */ + public final Builder parameters(Map map) { + this.parameters = _mapPutAll(this.parameters, map); + return this; + } + + /** + * API name: {@code parameters} + * + *

+ * Adds an entry to parameters. + *

+ */ + public final Builder parameters(String key, JsonData value) { + this.parameters = _mapPut(this.parameters, key, value); + return this; + } + + /** + * API name: {@code type} + */ + public final Builder type(@Nullable String value) { + this.type = value; + return this; + } + + /** + * + *

+ * Adds all elements of map to metadata. + *

+ */ + public final Builder metadata(Map map) { + this.metadata = _mapPutAll(this.metadata, map); + return this; + } + + /** + * + *

+ * Adds an entry to metadata. + *

+ */ + public final Builder metadata(String key, JsonData value) { + this.metadata = _mapPut(this.metadata, key, value); + return this; + } + + /** + * Builds a {@link ToolItems}. + * + * @throws NullPointerException if some of the required fields are null. + */ + public ToolItems build() { + _checkSingleUse(); + + return new ToolItems(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ToolItems} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + ToolItems::setupToolItemsDeserializer + ); + + protected static void setupToolItemsDeserializer(ObjectDeserializer op) { + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::parameters, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "parameters"); + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + op.setUnknownFieldHandler((builder, name, parser, mapper) -> { + if (builder.metadata == null) { + builder.metadata = new HashMap<>(); + } + builder.metadata.put(name, JsonData._DESERIALIZER.deserialize(parser, mapper)); + }); + } +} diff --git a/java-codegen/opensearch-openapi.yaml b/java-codegen/opensearch-openapi.yaml index 8eb4f6063f..e9e4e42740 100644 --- a/java-codegen/opensearch-openapi.yaml +++ b/java-codegen/opensearch-openapi.yaml @@ -3737,15 +3737,35 @@ paths: - $ref: '#/components/parameters/_global::query.error_trace' - $ref: '#/components/parameters/_global::query.source' - $ref: '#/components/parameters/_global::query.filter_path' - /_plugins/_ism/add/{index}: + /_plugins/_ism/add: post: operationId: ism.add_policy.0 x-operation-group: ism.add_policy description: Adds a policy to an index. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#add-policy + parameters: + - $ref: '#/components/parameters/ism.add_policy::query.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ism.add_policy' + responses: + '200': + $ref: '#/components/responses/ism.add_policy@200' + /_plugins/_ism/add/{index}: + post: + operationId: ism.add_policy.1 + x-operation-group: ism.add_policy + description: Adds a policy to an index. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#add-policy parameters: - $ref: '#/components/parameters/ism.add_policy::path.index' + - $ref: '#/components/parameters/ism.add_policy::query.index' - $ref: '#/components/parameters/_global::query.pretty' - $ref: '#/components/parameters/_global::query.human' - $ref: '#/components/parameters/_global::query.error_trace' @@ -3756,15 +3776,35 @@ paths: responses: '200': $ref: '#/components/responses/ism.add_policy@200' - /_plugins/_ism/change_policy/{index}: + /_plugins/_ism/change_policy: post: operationId: ism.change_policy.0 x-operation-group: ism.change_policy description: Updates the managed index policy to a new policy. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#update-managed-index-policy + parameters: + - $ref: '#/components/parameters/ism.change_policy::query.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ism.change_policy' + responses: + '200': + $ref: '#/components/responses/ism.change_policy@200' + /_plugins/_ism/change_policy/{index}: + post: + operationId: ism.change_policy.1 + x-operation-group: ism.change_policy + description: Updates the managed index policy to a new policy. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#update-managed-index-policy parameters: - $ref: '#/components/parameters/ism.change_policy::path.index' + - $ref: '#/components/parameters/ism.change_policy::query.index' - $ref: '#/components/parameters/_global::query.pretty' - $ref: '#/components/parameters/_global::query.human' - $ref: '#/components/parameters/_global::query.error_trace' @@ -3775,23 +3815,114 @@ paths: responses: '200': $ref: '#/components/responses/ism.change_policy@200' + /_plugins/_ism/explain: + get: + operationId: ism.explain_policy.0 + x-operation-group: ism.explain_policy + description: Gets the currently applied policy on indices. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index + requestBody: + $ref: '#/components/requestBodies/ism.explain_policy' + responses: + '200': + $ref: '#/components/responses/ism.explain_policy@200' + parameters: + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + post: + operationId: ism.explain_policy.0 + x-operation-group: ism.explain_policy + description: Gets the currently applied policy on indices. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index + requestBody: + $ref: '#/components/requestBodies/ism.explain_policy' + responses: + '200': + $ref: '#/components/responses/ism.explain_policy@200' + parameters: + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' /_plugins/_ism/explain/{index}: get: - operationId: ism.explain_index.0 - x-operation-group: ism.explain_index - description: Gets the currently applied policy on an index. + operationId: ism.explain_policy.1 + x-operation-group: ism.explain_policy + description: Gets the currently applied policy on indices. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index parameters: - - $ref: '#/components/parameters/ism.explain_index::path.index' + - $ref: '#/components/parameters/ism.explain_policy::path.index' - $ref: '#/components/parameters/_global::query.pretty' - $ref: '#/components/parameters/_global::query.human' - $ref: '#/components/parameters/_global::query.error_trace' - $ref: '#/components/parameters/_global::query.source' - $ref: '#/components/parameters/_global::query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ism.explain_policy' + responses: + '200': + $ref: '#/components/responses/ism.explain_policy@200' + post: + operationId: ism.explain_policy.1 + x-operation-group: ism.explain_policy + description: Gets the currently applied policy on indices. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index + parameters: + - $ref: '#/components/parameters/ism.explain_policy::path.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ism.explain_policy' + responses: + '200': + $ref: '#/components/responses/ism.explain_policy@200' + /_plugins/_ism/policies: + get: + operationId: ism.get_policies.0 + x-operation-group: ism.get_policies + description: Gets the policies. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#get-policy responses: '200': - $ref: '#/components/responses/ism.explain_index@200' + $ref: '#/components/responses/ism.get_policies@200' + parameters: + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + put: + operationId: ism.put_policies.0 + x-operation-group: ism.put_policies + description: Gets the policies. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#create-policy + requestBody: + $ref: '#/components/requestBodies/ism.put_policies' + parameters: + - $ref: '#/components/parameters/ism.put_policies::query.if_primary_term' + - $ref: '#/components/parameters/ism.put_policies::query.if_seq_no' + - $ref: '#/components/parameters/ism.put_policies::query.policyID' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + responses: + '200': + $ref: '#/components/responses/ism.put_policies@200' /_plugins/_ism/policies/{policy_id}: delete: operationId: ism.delete_policy.0 @@ -3812,9 +3943,9 @@ paths: get: operationId: ism.get_policy.0 x-operation-group: ism.get_policy - description: Gets the policy. + description: Gets a policy. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#get-policy + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#put-policy parameters: - $ref: '#/components/parameters/ism.get_policy::path.policy_id' - $ref: '#/components/parameters/_global::query.pretty' @@ -3825,6 +3956,24 @@ paths: responses: '200': $ref: '#/components/responses/ism.get_policy@200' + head: + operationId: ism.exists_policy.0 + x-operation-group: ism.exists_policy + description: Checks whether the policy exists. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#get-policy + parameters: + - $ref: '#/components/parameters/ism.exists_policy::path.policy_id' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + responses: + '200': + $ref: '#/components/responses/ism.exists_policy@200' + '404': + $ref: '#/components/responses/ism.exists_policy@404' put: operationId: ism.put_policy.0 x-operation-group: ism.put_policy @@ -3847,15 +3996,33 @@ paths: $ref: '#/components/responses/ism.put_policy@200' '201': $ref: '#/components/responses/ism.put_policy@201' - /_plugins/_ism/remove/{index}: + /_plugins/_ism/remove: post: operationId: ism.remove_policy.0 x-operation-group: ism.remove_policy description: Removes a policy from an index. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#remove-policy + parameters: + - $ref: '#/components/parameters/ism.remove_policy::query.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + responses: + '200': + $ref: '#/components/responses/ism.remove_policy@200' + /_plugins/_ism/remove/{index}: + post: + operationId: ism.remove_policy.1 + x-operation-group: ism.remove_policy + description: Removes a policy from an index. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#remove-policy parameters: - $ref: '#/components/parameters/ism.remove_policy::path.index' + - $ref: '#/components/parameters/ism.remove_policy::query.index' - $ref: '#/components/parameters/_global::query.pretty' - $ref: '#/components/parameters/_global::query.human' - $ref: '#/components/parameters/_global::query.error_trace' @@ -3864,6 +4031,45 @@ paths: responses: '200': $ref: '#/components/responses/ism.remove_policy@200' + /_plugins/_ism/retry: + post: + operationId: ism.retry_index.0 + x-operation-group: ism.retry_index + description: Retry the failed action for an index. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#retry-failed-index + parameters: + - $ref: '#/components/parameters/ism.retry_index::query.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ism.retry_index' + responses: + '200': + $ref: '#/components/responses/ism.retry_index@200' + /_plugins/_ism/retry/{index}: + post: + operationId: ism.retry_index.1 + x-operation-group: ism.retry_index + description: Retry the failed action for an index. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#retry-failed-index + parameters: + - $ref: '#/components/parameters/ism.retry_index::path.index' + - $ref: '#/components/parameters/ism.retry_index::query.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ism.retry_index' + responses: + '200': + $ref: '#/components/responses/ism.retry_index@200' /_plugins/_knn/{node_id}/stats: get: operationId: knn.stats.2 @@ -4155,6 +4361,68 @@ paths: responses: '200': $ref: '#/components/responses/knn.warmup@200' + /_plugins/_ml/agents/_register: + post: + operationId: ml.register_agents.0 + x-operation-group: ml.register_agents + description: Register an agent. + requestBody: + $ref: '#/components/requestBodies/ml.register_agents' + responses: + '200': + $ref: '#/components/responses/ml.register_agents@200' + parameters: + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + /_plugins/_ml/agents/{agent_id}: + delete: + operationId: ml.delete_agent.0 + x-operation-group: ml.delete_agent + description: Delete an agent. + parameters: + - $ref: '#/components/parameters/ml.delete_agent::path.agent_id' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + responses: + '200': + $ref: '#/components/responses/ml.delete_agent@200' + /_plugins/_ml/connectors/_create: + post: + operationId: ml.create_connector.0 + x-operation-group: ml.create_connector + description: Creates a standalone connector. + requestBody: + $ref: '#/components/requestBodies/ml.create_connector' + responses: + '200': + $ref: '#/components/responses/ml.create_connector@200' + parameters: + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + /_plugins/_ml/connectors/{connector_id}: + delete: + operationId: ml.delete_connector.0 + x-operation-group: ml.delete_connector + description: Deletes a standalone connector. + parameters: + - $ref: '#/components/parameters/ml.delete_connector::path.connector_id' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + responses: + '200': + $ref: '#/components/responses/ml.delete_connector@200' /_plugins/_ml/model_groups/_register: post: operationId: ml.register_model_group.0 @@ -4826,6 +5094,23 @@ paths: responses: '200': $ref: '#/components/responses/sql.settings@200' + /_plugins/_refresh_search_analyzers/{index}: + post: + operationId: ism.refresh_search_analyzers.0 + x-operation-group: ism.refresh_search_analyzers + description: Refresh search analyzers in real time. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/refresh-analyzer/ + parameters: + - $ref: '#/components/parameters/ism.refresh_search_analyzers::path.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + responses: + '200': + $ref: '#/components/responses/ism.refresh_search_analyzers@200' /_plugins/_rollup/jobs/{id}: delete: operationId: rollups.delete.0 @@ -7334,6 +7619,7 @@ paths: parameters: - $ref: '#/components/parameters/put_script::path.id' - $ref: '#/components/parameters/put_script::query.cluster_manager_timeout' + - $ref: '#/components/parameters/put_script::query.context' - $ref: '#/components/parameters/put_script::query.master_timeout' - $ref: '#/components/parameters/put_script::query.timeout' - $ref: '#/components/parameters/_global::query.pretty' @@ -7356,6 +7642,7 @@ paths: parameters: - $ref: '#/components/parameters/put_script::path.id' - $ref: '#/components/parameters/put_script::query.cluster_manager_timeout' + - $ref: '#/components/parameters/put_script::query.context' - $ref: '#/components/parameters/put_script::query.master_timeout' - $ref: '#/components/parameters/put_script::query.timeout' - $ref: '#/components/parameters/_global::query.pretty' @@ -7380,6 +7667,7 @@ paths: - $ref: '#/components/parameters/put_script::path.context' - $ref: '#/components/parameters/put_script::path.id' - $ref: '#/components/parameters/put_script::query.cluster_manager_timeout' + - $ref: '#/components/parameters/put_script::query.context' - $ref: '#/components/parameters/put_script::query.master_timeout' - $ref: '#/components/parameters/put_script::query.timeout' - $ref: '#/components/parameters/_global::query.pretty' @@ -7403,6 +7691,7 @@ paths: - $ref: '#/components/parameters/put_script::path.context' - $ref: '#/components/parameters/put_script::path.id' - $ref: '#/components/parameters/put_script::query.cluster_manager_timeout' + - $ref: '#/components/parameters/put_script::query.context' - $ref: '#/components/parameters/put_script::query.master_timeout' - $ref: '#/components/parameters/put_script::query.timeout' - $ref: '#/components/parameters/_global::query.pretty' @@ -11482,15 +11771,37 @@ paths: $ref: '#/components/responses/asynchronous_search.delete@200' deprecated: true x-ignorable: true - /_opendistro/_ism/add/{index}: + /_opendistro/_ism/add: post: operationId: ism.add_policy.0_superseded x-operation-group: ism.add_policy description: Adds a policy to an index. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#add-policy + parameters: + - $ref: '#/components/parameters/ism.add_policy::query.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ism.add_policy' + responses: + '200': + $ref: '#/components/responses/ism.add_policy@200' + deprecated: true + x-ignorable: true + /_opendistro/_ism/add/{index}: + post: + operationId: ism.add_policy.1_superseded + x-operation-group: ism.add_policy + description: Adds a policy to an index. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#add-policy parameters: - $ref: '#/components/parameters/ism.add_policy::path.index' + - $ref: '#/components/parameters/ism.add_policy::query.index' - $ref: '#/components/parameters/_global::query.pretty' - $ref: '#/components/parameters/_global::query.human' - $ref: '#/components/parameters/_global::query.error_trace' @@ -11503,15 +11814,37 @@ paths: $ref: '#/components/responses/ism.add_policy@200' deprecated: true x-ignorable: true - /_opendistro/_ism/change_policy/{index}: + /_opendistro/_ism/change_policy: post: operationId: ism.change_policy.0_superseded x-operation-group: ism.change_policy description: Updates the managed index policy to a new policy. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#update-managed-index-policy + parameters: + - $ref: '#/components/parameters/ism.change_policy::query.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ism.change_policy' + responses: + '200': + $ref: '#/components/responses/ism.change_policy@200' + deprecated: true + x-ignorable: true + /_opendistro/_ism/change_policy/{index}: + post: + operationId: ism.change_policy.1_superseded + x-operation-group: ism.change_policy + description: Updates the managed index policy to a new policy. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#update-managed-index-policy parameters: - $ref: '#/components/parameters/ism.change_policy::path.index' + - $ref: '#/components/parameters/ism.change_policy::query.index' - $ref: '#/components/parameters/_global::query.pretty' - $ref: '#/components/parameters/_global::query.human' - $ref: '#/components/parameters/_global::query.error_trace' @@ -11524,15 +11857,116 @@ paths: $ref: '#/components/responses/ism.change_policy@200' deprecated: true x-ignorable: true + /_opendistro/_ism/explain: + get: + operationId: ism.explain_policy.0_superseded + x-operation-group: ism.explain_policy + description: Gets the currently applied policy on indices. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index + requestBody: + $ref: '#/components/requestBodies/ism.explain_policy' + responses: + '200': + $ref: '#/components/responses/ism.explain_policy@200' + parameters: + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + deprecated: true + x-ignorable: true + post: + operationId: ism.explain_policy.0_superseded + x-operation-group: ism.explain_policy + description: Gets the currently applied policy on indices. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index + requestBody: + $ref: '#/components/requestBodies/ism.explain_policy' + responses: + '200': + $ref: '#/components/responses/ism.explain_policy@200' + parameters: + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + deprecated: true + x-ignorable: true /_opendistro/_ism/explain/{index}: get: - operationId: ism.explain_index.0_superseded - x-operation-group: ism.explain_index - description: Gets the currently applied policy on an index. + operationId: ism.explain_policy.1_superseded + x-operation-group: ism.explain_policy + description: Gets the currently applied policy on indices. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index parameters: - - $ref: '#/components/parameters/ism.explain_index::path.index' + - $ref: '#/components/parameters/ism.explain_policy::path.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ism.explain_policy' + responses: + '200': + $ref: '#/components/responses/ism.explain_policy@200' + deprecated: true + x-ignorable: true + post: + operationId: ism.explain_policy.1_superseded + x-operation-group: ism.explain_policy + description: Gets the currently applied policy on indices. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index + parameters: + - $ref: '#/components/parameters/ism.explain_policy::path.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ism.explain_policy' + responses: + '200': + $ref: '#/components/responses/ism.explain_policy@200' + deprecated: true + x-ignorable: true + /_opendistro/_ism/policies: + get: + operationId: ism.get_policies.0_superseded + x-operation-group: ism.get_policies + description: Gets the policies. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#get-policy + responses: + '200': + $ref: '#/components/responses/ism.get_policies@200' + parameters: + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + deprecated: true + x-ignorable: true + put: + operationId: ism.put_policies.0_superseded + x-operation-group: ism.put_policies + description: Gets the policies. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#create-policy + requestBody: + $ref: '#/components/requestBodies/ism.put_policies' + parameters: + - $ref: '#/components/parameters/ism.put_policies::query.if_primary_term' + - $ref: '#/components/parameters/ism.put_policies::query.if_seq_no' + - $ref: '#/components/parameters/ism.put_policies::query.policyID' - $ref: '#/components/parameters/_global::query.pretty' - $ref: '#/components/parameters/_global::query.human' - $ref: '#/components/parameters/_global::query.error_trace' @@ -11540,16 +11974,16 @@ paths: - $ref: '#/components/parameters/_global::query.filter_path' responses: '200': - $ref: '#/components/responses/ism.explain_index@200' + $ref: '#/components/responses/ism.put_policies@200' deprecated: true x-ignorable: true /_opendistro/_ism/policies/{policyID}: get: operationId: ism.get_policy.0_superseded x-operation-group: ism.get_policy - description: Gets the policy. + description: Gets a policy. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#get-policy + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#put-policy parameters: - $ref: '#/components/parameters/ism.get_policy::path.policy_id' - $ref: '#/components/parameters/_global::query.pretty' @@ -11562,6 +11996,26 @@ paths: $ref: '#/components/responses/ism.get_policy@200' deprecated: true x-ignorable: true + head: + operationId: ism.exists_policy.0_superseded + x-operation-group: ism.exists_policy + description: Checks whether the policy exists. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#get-policy + parameters: + - $ref: '#/components/parameters/ism.exists_policy::path.policy_id' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + responses: + '200': + $ref: '#/components/responses/ism.exists_policy@200' + '404': + $ref: '#/components/responses/ism.exists_policy@404' + deprecated: true + x-ignorable: true put: operationId: ism.put_policy.0_superseded x-operation-group: ism.put_policy @@ -11604,15 +12058,35 @@ paths: $ref: '#/components/responses/ism.delete_policy@200' deprecated: true x-ignorable: true - /_opendistro/_ism/remove/{index}: + /_opendistro/_ism/remove: post: operationId: ism.remove_policy.0_superseded x-operation-group: ism.remove_policy description: Removes a policy from an index. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#remove-policy + parameters: + - $ref: '#/components/parameters/ism.remove_policy::query.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + responses: + '200': + $ref: '#/components/responses/ism.remove_policy@200' + deprecated: true + x-ignorable: true + /_opendistro/_ism/remove/{index}: + post: + operationId: ism.remove_policy.1_superseded + x-operation-group: ism.remove_policy + description: Removes a policy from an index. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#remove-policy parameters: - $ref: '#/components/parameters/ism.remove_policy::path.index' + - $ref: '#/components/parameters/ism.remove_policy::query.index' - $ref: '#/components/parameters/_global::query.pretty' - $ref: '#/components/parameters/_global::query.human' - $ref: '#/components/parameters/_global::query.error_trace' @@ -11623,6 +12097,49 @@ paths: $ref: '#/components/responses/ism.remove_policy@200' deprecated: true x-ignorable: true + /_opendistro/_ism/retry: + post: + operationId: ism.retry_index.0_superseded + x-operation-group: ism.retry_index + description: Retry the failed action for an index. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#retry-failed-index + parameters: + - $ref: '#/components/parameters/ism.retry_index::query.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ism.retry_index' + responses: + '200': + $ref: '#/components/responses/ism.retry_index@200' + deprecated: true + x-ignorable: true + /_opendistro/_ism/retry/{index}: + post: + operationId: ism.retry_index.1_superseded + x-operation-group: ism.retry_index + description: Retry the failed action for an index. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#retry-failed-index + parameters: + - $ref: '#/components/parameters/ism.retry_index::path.index' + - $ref: '#/components/parameters/ism.retry_index::query.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ism.retry_index' + responses: + '200': + $ref: '#/components/responses/ism.retry_index@200' + deprecated: true + x-ignorable: true /_opendistro/_knn/stats/{stat}: get: operationId: knn.stats.1_superseded @@ -11775,6 +12292,25 @@ paths: $ref: '#/components/responses/ppl.post_stats@200' deprecated: true x-ignorable: true + /_opendistro/_refresh_search_analyzers/{index}: + post: + operationId: ism.refresh_search_analyzers.0_superseded + x-operation-group: ism.refresh_search_analyzers + description: Refresh search analyzers in real time. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/refresh-analyzer/ + parameters: + - $ref: '#/components/parameters/ism.refresh_search_analyzers::path.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + responses: + '200': + $ref: '#/components/responses/ism.refresh_search_analyzers@200' + deprecated: true + x-ignorable: true /_opendistro/_rollup/jobs/{rollupID}: get: operationId: rollups.get.0_superseded @@ -16111,7 +16647,11 @@ components: name: metric description: Limits the information returned to the specified metrics. schema: - $ref: '#/components/schemas/_common:Metrics' + oneOf: + - $ref: '#/components/schemas/cluster.reroute:Metric' + - type: array + items: + $ref: '#/components/schemas/cluster.reroute:Metric' style: form cluster.reroute::query.retry_failed: in: query @@ -16411,10 +16951,7 @@ components: description: Comma-separated list of specific routing values. style: form schema: - type: array - items: - type: string - description: Comma-separated list of specific routing values. + $ref: '#/components/schemas/_common:Routing' explode: true create::path.id: in: path @@ -19777,10 +20314,10 @@ components: description: List of shard health statuses used to limit the request. schema: oneOf: - - $ref: '#/components/schemas/indices.shard_stores:ShardStoreStatus' + - $ref: '#/components/schemas/indices.shard_stores:Status' - type: array items: - $ref: '#/components/schemas/indices.shard_stores:ShardStoreStatus' + $ref: '#/components/schemas/indices.shard_stores:Status' style: form indices.shrink::path.index: in: path @@ -20039,7 +20576,11 @@ components: description: Limit the information returned the specific metrics. required: true schema: - $ref: '#/components/schemas/_common:Metrics' + oneOf: + - $ref: '#/components/schemas/indices.stats:Metric' + - type: array + items: + $ref: '#/components/schemas/indices.stats:Metric' style: simple indices.stats::query.completion_fields: in: query @@ -20422,6 +20963,15 @@ components: schema: $ref: '#/components/schemas/_common:IndexName' style: simple + ism.add_policy::query.index: + name: index + in: query + description: |- + Comma-separated list of data streams, indices, and aliases. + Supports wildcards (`*`). + required: true + schema: + $ref: '#/components/schemas/_common:IndexName' ism.change_policy::path.index: name: index in: path @@ -20432,13 +20982,28 @@ components: schema: $ref: '#/components/schemas/_common:IndexName' style: simple + ism.change_policy::query.index: + name: index + in: query + description: |- + Comma-separated list of data streams, indices, and aliases. + Supports wildcards (`*`). + required: true + schema: + $ref: '#/components/schemas/_common:IndexName' ism.delete_policy::path.policy_id: name: policy_id in: path required: true schema: type: string - ism.explain_index::path.index: + ism.exists_policy::path.policy_id: + name: policy_id + in: path + required: true + schema: + type: string + ism.explain_policy::path.index: name: index in: path description: |- @@ -20454,6 +21019,27 @@ components: required: true schema: type: string + ism.put_policies::query.if_primary_term: + name: if_primary_term + in: query + description: Only perform the operation if the document has this primary term. + schema: + type: number + style: form + ism.put_policies::query.if_seq_no: + name: if_seq_no + in: query + description: Only perform the operation if the document has this sequence number. + schema: + $ref: '#/components/schemas/_common:SequenceNumber' + style: form + ism.put_policies::query.policyID: + name: policyID + in: query + required: true + schema: + type: string + style: form ism.put_policy::path.policy_id: name: policy_id in: path @@ -20474,6 +21060,16 @@ components: schema: $ref: '#/components/schemas/_common:SequenceNumber' style: form + ism.refresh_search_analyzers::path.index: + name: index + in: path + description: |- + Comma-separated list of data streams, indices, and aliases. + Supports wildcards (`*`). + required: true + schema: + $ref: '#/components/schemas/_common:IndexName' + style: simple ism.remove_policy::path.index: name: index in: path @@ -20484,6 +21080,34 @@ components: schema: $ref: '#/components/schemas/_common:IndexName' style: simple + ism.remove_policy::query.index: + name: index + in: query + description: |- + Comma-separated list of data streams, indices, and aliases. + Supports wildcards (`*`). + required: true + schema: + $ref: '#/components/schemas/_common:IndexName' + ism.retry_index::path.index: + name: index + in: path + description: |- + Comma-separated list of data streams, indices, and aliases. + Supports wildcards (`*`). + required: true + schema: + $ref: '#/components/schemas/_common:IndexName' + style: simple + ism.retry_index::query.index: + name: index + in: query + description: |- + Comma-separated list of data streams, indices, and aliases. + Supports wildcards (`*`). + required: true + schema: + $ref: '#/components/schemas/_common:IndexName' knn.delete_model::path.model_id: name: model_id in: path @@ -20700,10 +21324,7 @@ components: description: Comma-separated list of specific routing values. style: form schema: - type: array - items: - type: string - description: Comma-separated list of specific routing values. + $ref: '#/components/schemas/_common:Routing' explode: true knn.search_models::query.scroll: name: scroll @@ -20986,6 +21607,18 @@ components: schema: $ref: '#/components/schemas/_common:Fields' style: form + ml.delete_agent::path.agent_id: + name: agent_id + in: path + required: true + schema: + type: string + ml.delete_connector::path.connector_id: + name: connector_id + in: path + required: true + schema: + type: string ml.delete_model_group::path.model_group_id: name: model_group_id in: path @@ -21833,6 +22466,14 @@ components: schema: $ref: '#/components/schemas/_common:Duration' x-version-added: '2.0' + put_script::query.context: + name: context + in: query + description: |- + Context in which the script or search template should run. + To prevent errors, the API immediately compiles the script or template in this context. + schema: + type: string put_script::query.master_timeout: in: query name: master_timeout @@ -21904,7 +22545,7 @@ components: name: search_type description: Search operation type schema: - type: string + $ref: '#/components/schemas/_common:SearchType' style: form reindex_rethrottle::path.task_id: in: path @@ -24942,11 +25583,25 @@ components: application/json: schema: $ref: '#/components/schemas/ism._common:ChangePolicyRequest' + ism.explain_policy: + content: + application/json: + schema: {} + ism.put_policies: + content: + application/json: + schema: + $ref: '#/components/schemas/ism._common:PutPolicyRequest' ism.put_policy: content: application/json: schema: $ref: '#/components/schemas/ism._common:PutPolicyRequest' + ism.retry_index: + content: + application/json: + schema: + $ref: '#/components/schemas/ism._common:RetryIndexRequest' knn.search_models: content: application/json: @@ -24996,6 +25651,16 @@ components: $ref: '#/components/schemas/_common:Ids' description: Document identifiers; can be either `docs` (containing full document information) or `ids` (when index is provided in the URL. required: true + ml.create_connector: + content: + application/json: + schema: + $ref: '#/components/schemas/ml._common:CreateConnectorRequest' + ml.register_agents: + content: + application/json: + schema: + $ref: '#/components/schemas/ml._common:RegisterAgentsRequest' ml.register_model: content: application/json: @@ -26562,6 +27227,10 @@ components: - $ref: '#/components/schemas/flow_framework.errors:ParameterConflictError' - $ref: '#/components/schemas/flow_framework.errors:MaxWorkflowsLimitError' - $ref: '#/components/schemas/flow_framework.errors:WorkflowSaveError' + - $ref: '#/components/schemas/flow_framework.errors:WorkflowParsingError' + - $ref: '#/components/schemas/flow_framework.errors:UnsupportedFieldUpdateError' + - $ref: '#/components/schemas/flow_framework.errors:InvalidTemplateVersionError' + - $ref: '#/components/schemas/flow_framework.errors:TemplateNameRequiredError' flow_framework.create@403: content: application/json: @@ -26704,6 +27373,9 @@ components: - $ref: '#/components/schemas/flow_framework.errors:ParameterConflictError' - $ref: '#/components/schemas/flow_framework.errors:MaxWorkflowsLimitError' - $ref: '#/components/schemas/flow_framework.errors:WorkflowSaveError' + - $ref: '#/components/schemas/flow_framework.errors:InvalidTemplateVersionError' + - $ref: '#/components/schemas/flow_framework.errors:UnsupportedFieldUpdateError' + - $ref: '#/components/schemas/flow_framework.errors:WorkflowParsingError' flow_framework.update@404: description: Template Not Found Error content: @@ -27340,16 +28012,34 @@ components: application/json: schema: $ref: '#/components/schemas/ism._common:DeletePolicyResponse' - ism.explain_index@200: + ism.exists_policy@200: + content: + application/json: + schema: {} + ism.exists_policy@404: + content: + application/json: + schema: {} + ism.explain_policy@200: content: application/json: schema: $ref: '#/components/schemas/ism._common:ExplainIndexResponse' + ism.get_policies@200: + content: + application/json: + schema: + $ref: '#/components/schemas/ism._common:GetPoliciesResponse' ism.get_policy@200: content: application/json: schema: $ref: '#/components/schemas/ism._common:GetPolicyResponse' + ism.put_policies@200: + content: + application/json: + schema: + $ref: '#/components/schemas/ism._common:PutPolicyResponse' ism.put_policy@200: content: application/json: @@ -27360,11 +28050,21 @@ components: application/json: schema: $ref: '#/components/schemas/ism._common:PutPolicyResponse' + ism.refresh_search_analyzers@200: + content: + application/json: + schema: + $ref: '#/components/schemas/ism._common:RefreshSearchAnalyzersResponse' ism.remove_policy@200: content: application/json: schema: $ref: '#/components/schemas/ism._common:RemovePolicyResponse' + ism.retry_index@200: + content: + application/json: + schema: + $ref: '#/components/schemas/ism._common:RetryIndexResponse' knn.delete_model@200: {} knn.get_model@200: {} knn.search_models@200: {} @@ -27383,6 +28083,24 @@ components: $ref: '#/components/schemas/_core.mget:ResponseItem' required: - docs + ml.create_connector@200: + content: + application/json: + schema: + type: object + properties: + connector_id: + type: string + ml.delete_agent@200: + content: + application/json: + schema: + $ref: '#/components/schemas/_common:WriteResponseBase' + ml.delete_connector@200: + content: + application/json: + schema: + $ref: '#/components/schemas/_common:WriteResponseBase' ml.delete_model_group@200: content: application/json: @@ -27423,6 +28141,14 @@ components: application/json: schema: $ref: '#/components/schemas/ml._common:Task' + ml.register_agents@200: + content: + application/json: + schema: + type: object + properties: + agent_id: + type: string ml.register_model_group@200: content: application/json: @@ -29727,12 +30453,6 @@ components: _common:Metadata: type: object additionalProperties: true - _common:Metrics: - oneOf: - - type: string - - type: array - items: - type: string _common:MinimumShouldMatch: description: The minimum number of terms that should match as integer, percentage or range. oneOf: @@ -30334,7 +31054,11 @@ components: - bulk - search _common:Routing: - type: string + oneOf: + - type: string + - type: array + items: + type: string _common:RrfRank: allOf: - $ref: '#/components/schemas/_common:RankBase' @@ -44605,6 +45329,18 @@ components: - index - shard - to_node + cluster.reroute:Metric: + type: string + enum: + - _all + - blocks + - cluster_manager_node + - master_node + - metadata + - nodes + - routing_nodes + - routing_table + - version cluster.reroute:RerouteDecision: type: object properties: @@ -45532,6 +46268,8 @@ components: use_case: type: string description: A use case, which can be used with the Search Workflow API to find related workflows. + workflows: + type: object version: $ref: '#/components/schemas/flow_framework.common:version' minProperties: 1 @@ -45832,7 +46570,7 @@ components: application/json: type: object properties: - message: + error: type: string example: You cannot use both the 'provision_workflow' and 'update_workflow_fields' parameters in the same request. status: @@ -45870,7 +46608,7 @@ components: application/json: type: object properties: - message: + error: type: string example: This API is disabled. To enable it, set [flow_framework.enabled] to true. status: @@ -45880,7 +46618,7 @@ components: application/json: type: object properties: - message: + error: type: string example: Only the parameters [param1, param2] are permitted unless the provision parameter is set to true. status: @@ -45894,12 +46632,21 @@ components: status: type: integer description: HTTP status code for the error. + flow_framework.errors:InvalidTemplateVersionError: + content: + application/json: + type: object + properties: + error: + type: string + description: Error message when the template version is invalid or missing. + example: Unable to parse field [version] in a version object. flow_framework.errors:MaxWorkflowsLimitError: content: application/json: type: object properties: - message: + error: type: string example: Maximum workflows limit reached 50 code: @@ -45909,7 +46656,7 @@ components: application/json: type: object properties: - message: + error: type: string example: You cannot use the 'reprovision_workflow' parameter to create a new template. status: @@ -45919,7 +46666,7 @@ components: application/json: type: object properties: - message: + error: type: string example: You cannot use the 'reprovision_workflow' and 'use_case' parameters in the same request. status: @@ -45944,32 +46691,56 @@ components: type: integer description: HTTP status code for the error. example: 408 + flow_framework.errors:TemplateNameRequiredError: + type: object + properties: + error: + type: string + description: Error message when the template name is missing. flow_framework.errors:TemplateNotFoundError: content: application/json: type: object properties: - message: + error: type: string example: Failed to retrieve template (12345) from global context. code: type: integer + flow_framework.errors:UnsupportedFieldUpdateError: + content: + application/json: + type: object + properties: + error: + type: string + description: Error message when trying to update an unsupported field in a template. + example: You can not update the field [fieldName] without updating the whole template. flow_framework.errors:WorkFlowIdNullError: content: application/json: type: object properties: - message: + error: type: string example: Workflow ID can not be null status: type: integer + flow_framework.errors:WorkflowParsingError: + content: + application/json: + type: object + properties: + error: + type: string + description: Error message when workflow parsing fails. + example: Unable to parse field [workflow] in a template object. flow_framework.errors:WorkflowSaveError: content: application/json: type: object properties: - message: + error: type: string example: Failed to save workflow state status: @@ -45979,7 +46750,7 @@ components: application/json: type: object properties: - message: + error: type: string example: Failed to retrieve workflow step json. code: @@ -47623,13 +48394,6 @@ components: required: - reason - type - indices.shard_stores:ShardStoreStatus: - type: string - enum: - - all - - green - - red - - yellow indices.shard_stores:ShardStoreWrapper: type: object properties: @@ -47639,6 +48403,13 @@ components: $ref: '#/components/schemas/indices.shard_stores:ShardStore' required: - stores + indices.shard_stores:Status: + type: string + enum: + - all + - green + - red + - yellow indices.simulate_template:Overlapping: type: object properties: @@ -47749,6 +48520,27 @@ components: - primaries - total - uuid + indices.stats:Metric: + type: string + enum: + - _all + - completion + - docs + - fielddata + - flush + - get + - indexing + - merge + - query_cache + - recovery + - refresh + - request_cache + - search + - segments + - store + - suggest + - translog + - warmer indices.stats:ShardCommit: type: object properties: @@ -49064,6 +49856,8 @@ components: required: - policy_id ism._common:ChangePolicyResponse: + $ref: '#/components/schemas/ism._common:ChangeResponse' + ism._common:ChangeResponse: type: object properties: updated_indices: @@ -49145,10 +49939,17 @@ components: type: string reason: type: string + ism._common:GetPoliciesResponse: + type: object + properties: + total_policies: + type: number + policies: + type: array + items: + $ref: '#/components/schemas/ism._common:PolicyWithMetadata' ism._common:GetPolicyResponse: - allOf: - - $ref: '#/components/schemas/ism._common:Metadata' - - $ref: '#/components/schemas/ism._common:PolicyEnvelope' + $ref: '#/components/schemas/ism._common:PolicyWithMetadata' ism._common:IncludeState: type: object properties: @@ -49212,6 +50013,11 @@ components: properties: policy: $ref: '#/components/schemas/ism._common:Policy' + ism._common:PolicyWithMetadata: + type: object + allOf: + - $ref: '#/components/schemas/ism._common:Metadata' + - $ref: '#/components/schemas/ism._common:PolicyEnvelope' ism._common:PutPolicyRequest: $ref: '#/components/schemas/ism._common:PolicyEnvelope' ism._common:PutPolicyResponse: @@ -49221,8 +50027,35 @@ components: properties: policy: $ref: '#/components/schemas/ism._common:PolicyEnvelope' + ism._common:RefreshSearchAnalyzersResponse: + type: object + properties: + _shards: + $ref: '#/components/schemas/_common:ShardStatistics' + successful_refresh_details: + type: array + items: + $ref: '#/components/schemas/ism._common:RefreshSearchAnalyzersResponseDetails' + ism._common:RefreshSearchAnalyzersResponseDetails: + type: object + properties: + index: + type: string + refreshed_analyzers: + type: array + items: + type: string ism._common:RemovePolicyResponse: $ref: '#/components/schemas/ism._common:ChangePolicyResponse' + ism._common:RetryIndexRequest: + type: object + properties: + state: + type: string + required: + - state + ism._common:RetryIndexResponse: + $ref: '#/components/schemas/ism._common:ChangeResponse' ism._common:SlackCustomWebhook: type: object properties: @@ -49295,6 +50128,85 @@ components: - always - missing - popular + ml._common:Action: + type: object + properties: + action_type: + type: string + method: + type: string + headers: + $ref: '#/components/schemas/ml._common:Headers' + url: + type: string + request_body: + type: string + pre_process_function: + type: string + post_process_function: + type: string + ml._common:ClientConfig: + type: object + properties: + max_connection: + type: integer + connection_timeout: + type: integer + read_timeout: + type: integer + retry_backoff_policy: + type: string + max_retry_times: + type: integer + retry_backoff_millis: + type: integer + retry_timeout_seconds: + type: integer + ml._common:CreateConnectorRequest: + type: object + properties: + name: + type: string + description: + type: string + version: + type: integer + protocol: + type: string + credential: + $ref: '#/components/schemas/ml._common:Credential' + parameters: + $ref: '#/components/schemas/ml._common:Parameters' + client_config: + $ref: '#/components/schemas/ml._common:ClientConfig' + actions: + type: array + items: + $ref: '#/components/schemas/ml._common:Action' + required: + - actions + - credential + - description + - name + - parameters + - protocol + - version + ml._common:Credential: + type: object + properties: + access_key: + type: string + secret_key: + type: string + session_token: + type: string + additionalProperties: true + ml._common:Headers: + type: object + properties: + content_type: + type: string + additionalProperties: true ml._common:HitsTotal: type: object properties: @@ -49307,6 +50219,18 @@ components: required: - relation - value + ml._common:LLM: + type: object + properties: + model_id: + type: string + parameters: + $ref: '#/components/schemas/ml._common:Parameters' + ml._common:Memory: + type: object + properties: + type: + type: string ml._common:ModelGroup: type: object properties: @@ -49345,6 +50269,33 @@ components: required: - model_group_id - status + ml._common:Parameters: + type: object + additionalProperties: true + ml._common:RegisterAgentsRequest: + type: object + properties: + name: + type: string + type: + type: string + description: + type: string + tools: + type: array + items: + $ref: '#/components/schemas/ml._common:ToolItems' + parameters: + $ref: '#/components/schemas/ml._common:Parameters' + app_type: + type: string + memory: + $ref: '#/components/schemas/ml._common:Memory' + llm: + $ref: '#/components/schemas/ml._common:LLM' + required: + - name + - type ml._common:SearchModelsHits: type: object properties: @@ -49431,6 +50382,16 @@ components: type: string required: - state + ml._common:ToolItems: + type: object + properties: + name: + type: string + type: + type: string + parameters: + $ref: '#/components/schemas/ml._common:Parameters' + additionalProperties: true ml._common:UndeployModelNode: type: object properties: