Code generated using native OpenAPI specification (#724)

* Code generated using native OpenAPI specification

Signed-off-by: saimedhi <[email protected]>

* Code generated using native OpenAPI specification

Signed-off-by: saimedhi <[email protected]>

* Code generated using native OpenAPI specification

Signed-off-by: saimedhi <[email protected]>

---------

Signed-off-by: saimedhi <[email protected]>
This commit is contained in:
Sai Medhini Reddy Maryada
2024-04-17 16:22:14 -07:00
committed by GitHub
parent 0e28f5ffe9
commit b47edf906e
32 changed files with 11079 additions and 3117 deletions
+73 -6
View File
@@ -22,7 +22,7 @@ from ..client.utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_par
class KnnClient(NamespacedClient):
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def delete_model(
self,
model_id: Any,
@@ -34,6 +34,16 @@ class KnnClient(NamespacedClient):
:arg model_id: The id of the model.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if model_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'model_id'.")
@@ -45,7 +55,7 @@ class KnnClient(NamespacedClient):
headers=headers,
)
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def get_model(
self,
model_id: Any,
@@ -57,6 +67,16 @@ class KnnClient(NamespacedClient):
:arg model_id: The id of the model.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if model_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'model_id'.")
@@ -81,15 +101,19 @@ class KnnClient(NamespacedClient):
"default_operator",
"df",
"docvalue_fields",
"error_trace",
"expand_wildcards",
"explain",
"filter_path",
"from_",
"human",
"ignore_throttled",
"ignore_unavailable",
"lenient",
"max_concurrent_shard_requests",
"pre_filter_shard_size",
"preference",
"pretty",
"q",
"request_cache",
"rest_total_hits_as_int",
@@ -99,6 +123,7 @@ class KnnClient(NamespacedClient):
"seq_no_primary_term",
"size",
"sort",
"source",
"stats",
"stored_fields",
"suggest_field",
@@ -151,12 +176,18 @@ class KnnClient(NamespacedClient):
given in the query string.
:arg docvalue_fields: Comma-separated list of fields to return
as the docvalue representation of a field for each hit.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg expand_wildcards: Whether to expand wildcard expression to
concrete indices that are open, closed or both. Valid choices are all,
open, closed, hidden, none.
:arg explain: Specify whether to return detailed information
about score computation as part of a hit.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg from_: Starting offset. Default is 0.
:arg human: Whether to return human readable values for
statistics.
:arg ignore_throttled: Whether specified concrete, expanded or
aliased indices should be ignored when throttled.
:arg ignore_unavailable: Whether specified concrete indices
@@ -176,6 +207,8 @@ class KnnClient(NamespacedClient):
and the query are disjoint.
:arg preference: Specify the node or shard the operation should
be performed on. Default is random.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg q: Query in the Lucene query string syntax.
:arg request_cache: Specify if request cache should be used for
this request or not, defaults to index level setting.
@@ -191,6 +224,8 @@ class KnnClient(NamespacedClient):
number and primary term of the last modification of each hit.
:arg size: Number of hits to return. Default is 10.
:arg sort: Comma-separated list of <field>:<direction> pairs.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg stats: Specific 'tag' of the request for logging and
statistical purposes.
:arg stored_fields: Comma-separated list of stored fields to
@@ -226,7 +261,7 @@ class KnnClient(NamespacedClient):
body=body,
)
@query_params("timeout")
@query_params("error_trace", "filter_path", "human", "pretty", "source", "timeout")
async def stats(
self,
node_id: Any = None,
@@ -254,6 +289,16 @@ class KnnClient(NamespacedClient):
model_index_status, indexing_from_model_degraded, training_requests,
training_errors, training_memory_usage,
training_memory_usage_percentage.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
:arg timeout: Operation timeout.
"""
return await self.transport.perform_request(
@@ -263,7 +308,9 @@ class KnnClient(NamespacedClient):
headers=headers,
)
@query_params("preference")
@query_params(
"error_trace", "filter_path", "human", "preference", "pretty", "source"
)
async def train_model(
self,
body: Any,
@@ -277,7 +324,17 @@ class KnnClient(NamespacedClient):
:arg model_id: The id of the model.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg preference: Preferred node to execute training.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
@@ -290,7 +347,7 @@ class KnnClient(NamespacedClient):
body=body,
)
@query_params()
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def warmup(
self,
index: Any,
@@ -299,11 +356,21 @@ class KnnClient(NamespacedClient):
) -> Any:
"""
Preloads native library files into memory, reducing initial search latency for
specified indexes
specified indexes.
:arg index: Comma-separated list of indices; use `_all` or empty
string to perform the operation on all indices.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if index in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'index'.")
@@ -0,0 +1,326 @@
# 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.
#
# Modifications Copyright OpenSearch Contributors. See
# GitHub history for details.
# ------------------------------------------------------------------------------------------
# THIS CODE IS AUTOMATICALLY GENERATED AND MANUAL EDITS WILL BE LOST
#
# To contribute, kindly make modifications in the opensearch-py client generator
# or in the OpenSearch API specification, and run `nox -rs generate`. See DEVELOPER_GUIDE.md
# and https://github.com/opensearch-project/opensearch-api-specification for details.
# -----------------------------------------------------------------------------------------+
from typing import Any
from ..client.utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class NotificationsClient(NamespacedClient):
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def create_config(
self,
body: Any,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Create channel configuration.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
return await self.transport.perform_request(
"POST",
"/_plugins/_notifications/configs",
params=params,
headers=headers,
body=body,
)
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def delete_config(
self,
config_id: Any,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Delete a channel configuration.
:arg config_id: The ID of the channel configuration to delete.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if config_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'config_id'.")
return await self.transport.perform_request(
"DELETE",
_make_path("_plugins", "_notifications", "configs", config_id),
params=params,
headers=headers,
)
@query_params(
"config_id",
"config_id_list",
"error_trace",
"filter_path",
"human",
"pretty",
"source",
)
async def delete_configs(
self,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Delete multiple channel configurations.
:arg config_id: The ID of the channel configuration to delete.
:arg config_id_list: A comma-separated list of channel IDs to
delete.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
return await self.transport.perform_request(
"DELETE", "/_plugins/_notifications/configs", params=params, headers=headers
)
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def get_config(
self,
config_id: Any,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Get a specific channel configuration.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if config_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'config_id'.")
return await self.transport.perform_request(
"GET",
_make_path("_plugins", "_notifications", "configs", config_id),
params=params,
headers=headers,
)
@query_params(
"chime.url",
"chime.url.keyword",
"config_type",
"created_time_ms",
"description",
"description.keyword",
"email.email_account_id",
"email.email_group_id_list",
"email.recipient_list.recipient",
"email.recipient_list.recipient.keyword",
"email_group.recipient_list.recipient",
"email_group.recipient_list.recipient.keyword",
"error_trace",
"filter_path",
"human",
"is_enabled",
"last_updated_time_ms",
"microsoft_teams.url",
"microsoft_teams.url.keyword",
"name",
"name.keyword",
"pretty",
"query",
"ses_account.from_address",
"ses_account.from_address.keyword",
"ses_account.region",
"ses_account.role_arn",
"ses_account.role_arn.keyword",
"slack.url",
"slack.url.keyword",
"smtp_account.from_address",
"smtp_account.from_address.keyword",
"smtp_account.host",
"smtp_account.host.keyword",
"smtp_account.method",
"sns.role_arn",
"sns.role_arn.keyword",
"sns.topic_arn",
"sns.topic_arn.keyword",
"source",
"text_query",
"webhook.url",
"webhook.url.keyword",
)
async def get_configs(
self,
body: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Get multiple channel configurations with filtering.
:arg config_type: Type of notification configuration. Valid
choices are slack, chime, microsoft_teams, webhook, email, sns,
ses_account, smtp_account, email_group.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
return await self.transport.perform_request(
"GET",
"/_plugins/_notifications/configs",
params=params,
headers=headers,
body=body,
)
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def list_features(
self,
params: Any = None,
headers: Any = None,
) -> Any:
"""
List supported channel configurations.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
return await self.transport.perform_request(
"GET", "/_plugins/_notifications/features", params=params, headers=headers
)
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def send_test(
self,
config_id: Any,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Send a test notification.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
if config_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'config_id'.")
return await self.transport.perform_request(
"GET",
_make_path("_plugins", "_notifications", "feature", "test", config_id),
params=params,
headers=headers,
)
@query_params("error_trace", "filter_path", "human", "pretty", "source")
async def update_config(
self,
config_id: Any,
body: Any,
params: Any = None,
headers: Any = None,
) -> Any:
"""
Update channel configuration.
:arg error_trace: Whether to include the stack trace of returned
errors.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg human: Whether to return human readable values for
statistics.
:arg pretty: Whether to pretty format the returned JSON
response.
:arg source: The URL-encoded request definition. Useful for
libraries that do not accept a request body for non-POST requests.
"""
for param in (config_id, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return await self.transport.perform_request(
"PUT",
_make_path("_plugins", "_notifications", "configs", config_id),
params=params,
headers=headers,
body=body,
)