@@ -14,6 +14,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|||||||
### Fixed
|
### Fixed
|
||||||
- Updated code generator to use native OpenAPI specification ([#721](https://github.com/opensearch-project/opensearch-py/pull/721))
|
- Updated code generator to use native OpenAPI specification ([#721](https://github.com/opensearch-project/opensearch-py/pull/721))
|
||||||
### Updated APIs
|
### Updated APIs
|
||||||
|
- Updated opensearch-py APIs to reflect [opensearch-api-specification@d3783f1](https://github.com/opensearch-project/opensearch-api-specification/commit/d3783f1200fdc5799eba861842ee611f2c7e30e7)
|
||||||
- Updated opensearch-py APIs to reflect [opensearch-api-specification@3ed6aaf](https://github.com/opensearch-project/opensearch-api-specification/commit/3ed6aaff0ce51af3aad00fe57c34d1a7056bd6d1)
|
- Updated opensearch-py APIs to reflect [opensearch-api-specification@3ed6aaf](https://github.com/opensearch-project/opensearch-api-specification/commit/3ed6aaff0ce51af3aad00fe57c34d1a7056bd6d1)
|
||||||
- Updated opensearch-py APIs to reflect [opensearch-api-specification@af4a34f](https://github.com/opensearch-project/opensearch-api-specification/commit/af4a34f9847d36709b5a394be7c76fda4649ccc8)
|
- Updated opensearch-py APIs to reflect [opensearch-api-specification@af4a34f](https://github.com/opensearch-project/opensearch-api-specification/commit/af4a34f9847d36709b5a394be7c76fda4649ccc8)
|
||||||
- Updated opensearch-py APIs to reflect [opensearch-api-specification@e02c076](https://github.com/opensearch-project/opensearch-api-specification/commit/e02c076ef63f7a9b650ca1416380120cc640620a)
|
- Updated opensearch-py APIs to reflect [opensearch-api-specification@e02c076](https://github.com/opensearch-project/opensearch-api-specification/commit/e02c076ef63f7a9b650ca1416380120cc640620a)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
from .utils import SKIP_IN_PATH, NamespacedClient, _bulk_body, _make_path, query_params
|
||||||
|
|
||||||
|
|
||||||
class SecurityClient(NamespacedClient):
|
class SecurityClient(NamespacedClient):
|
||||||
@@ -244,6 +244,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if param in SKIP_IN_PATH:
|
if param in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument.")
|
raise ValueError("Empty value passed for a required argument.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return await self.transport.perform_request(
|
return await self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
_make_path("_plugins", "_security", "api", "actiongroups", action_group),
|
_make_path("_plugins", "_security", "api", "actiongroups", action_group),
|
||||||
@@ -277,6 +278,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if body in SKIP_IN_PATH:
|
if body in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return await self.transport.perform_request(
|
return await self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
"/_plugins/_security/api/actiongroups",
|
"/_plugins/_security/api/actiongroups",
|
||||||
@@ -439,6 +441,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if param in SKIP_IN_PATH:
|
if param in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument.")
|
raise ValueError("Empty value passed for a required argument.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return await self.transport.perform_request(
|
return await self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
_make_path("_plugins", "_security", "api", "internalusers", username),
|
_make_path("_plugins", "_security", "api", "internalusers", username),
|
||||||
@@ -472,6 +475,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if body in SKIP_IN_PATH:
|
if body in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return await self.transport.perform_request(
|
return await self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
"/_plugins/_security/api/internalusers",
|
"/_plugins/_security/api/internalusers",
|
||||||
@@ -631,6 +635,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if param in SKIP_IN_PATH:
|
if param in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument.")
|
raise ValueError("Empty value passed for a required argument.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return await self.transport.perform_request(
|
return await self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
_make_path("_plugins", "_security", "api", "roles", role),
|
_make_path("_plugins", "_security", "api", "roles", role),
|
||||||
@@ -664,6 +669,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if body in SKIP_IN_PATH:
|
if body in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return await self.transport.perform_request(
|
return await self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
"/_plugins/_security/api/roles",
|
"/_plugins/_security/api/roles",
|
||||||
@@ -826,6 +832,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if param in SKIP_IN_PATH:
|
if param in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument.")
|
raise ValueError("Empty value passed for a required argument.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return await self.transport.perform_request(
|
return await self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
_make_path("_plugins", "_security", "api", "rolesmapping", role),
|
_make_path("_plugins", "_security", "api", "rolesmapping", role),
|
||||||
@@ -859,6 +866,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if body in SKIP_IN_PATH:
|
if body in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return await self.transport.perform_request(
|
return await self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
"/_plugins/_security/api/rolesmapping",
|
"/_plugins/_security/api/rolesmapping",
|
||||||
@@ -1018,6 +1026,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if param in SKIP_IN_PATH:
|
if param in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument.")
|
raise ValueError("Empty value passed for a required argument.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return await self.transport.perform_request(
|
return await self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
_make_path("_plugins", "_security", "api", "tenants", tenant),
|
_make_path("_plugins", "_security", "api", "tenants", tenant),
|
||||||
@@ -1051,6 +1060,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if body in SKIP_IN_PATH:
|
if body in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return await self.transport.perform_request(
|
return await self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
"/_plugins/_security/api/tenants/",
|
"/_plugins/_security/api/tenants/",
|
||||||
@@ -1145,6 +1155,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if body in SKIP_IN_PATH:
|
if body in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return await self.transport.perform_request(
|
return await self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
"/_plugins/_security/api/securityconfig",
|
"/_plugins/_security/api/securityconfig",
|
||||||
@@ -1468,6 +1479,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if body in SKIP_IN_PATH:
|
if body in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return await self.transport.perform_request(
|
return await self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
"/_plugins/_security/api/audit",
|
"/_plugins/_security/api/audit",
|
||||||
@@ -1501,6 +1513,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if body in SKIP_IN_PATH:
|
if body in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return await self.transport.perform_request(
|
return await self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
"/_plugins/_security/api/nodesdn",
|
"/_plugins/_security/api/nodesdn",
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
|
from .utils import SKIP_IN_PATH, NamespacedClient, _bulk_body, _make_path, query_params
|
||||||
|
|
||||||
|
|
||||||
class SecurityClient(NamespacedClient):
|
class SecurityClient(NamespacedClient):
|
||||||
@@ -244,6 +244,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if param in SKIP_IN_PATH:
|
if param in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument.")
|
raise ValueError("Empty value passed for a required argument.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
_make_path("_plugins", "_security", "api", "actiongroups", action_group),
|
_make_path("_plugins", "_security", "api", "actiongroups", action_group),
|
||||||
@@ -277,6 +278,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if body in SKIP_IN_PATH:
|
if body in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
"/_plugins/_security/api/actiongroups",
|
"/_plugins/_security/api/actiongroups",
|
||||||
@@ -439,6 +441,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if param in SKIP_IN_PATH:
|
if param in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument.")
|
raise ValueError("Empty value passed for a required argument.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
_make_path("_plugins", "_security", "api", "internalusers", username),
|
_make_path("_plugins", "_security", "api", "internalusers", username),
|
||||||
@@ -472,6 +475,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if body in SKIP_IN_PATH:
|
if body in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
"/_plugins/_security/api/internalusers",
|
"/_plugins/_security/api/internalusers",
|
||||||
@@ -631,6 +635,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if param in SKIP_IN_PATH:
|
if param in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument.")
|
raise ValueError("Empty value passed for a required argument.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
_make_path("_plugins", "_security", "api", "roles", role),
|
_make_path("_plugins", "_security", "api", "roles", role),
|
||||||
@@ -664,6 +669,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if body in SKIP_IN_PATH:
|
if body in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
"/_plugins/_security/api/roles",
|
"/_plugins/_security/api/roles",
|
||||||
@@ -826,6 +832,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if param in SKIP_IN_PATH:
|
if param in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument.")
|
raise ValueError("Empty value passed for a required argument.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
_make_path("_plugins", "_security", "api", "rolesmapping", role),
|
_make_path("_plugins", "_security", "api", "rolesmapping", role),
|
||||||
@@ -859,6 +866,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if body in SKIP_IN_PATH:
|
if body in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
"/_plugins/_security/api/rolesmapping",
|
"/_plugins/_security/api/rolesmapping",
|
||||||
@@ -1018,6 +1026,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if param in SKIP_IN_PATH:
|
if param in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument.")
|
raise ValueError("Empty value passed for a required argument.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
_make_path("_plugins", "_security", "api", "tenants", tenant),
|
_make_path("_plugins", "_security", "api", "tenants", tenant),
|
||||||
@@ -1051,6 +1060,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if body in SKIP_IN_PATH:
|
if body in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
"/_plugins/_security/api/tenants/",
|
"/_plugins/_security/api/tenants/",
|
||||||
@@ -1145,6 +1155,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if body in SKIP_IN_PATH:
|
if body in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
"/_plugins/_security/api/securityconfig",
|
"/_plugins/_security/api/securityconfig",
|
||||||
@@ -1468,6 +1479,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if body in SKIP_IN_PATH:
|
if body in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
"/_plugins/_security/api/audit",
|
"/_plugins/_security/api/audit",
|
||||||
@@ -1501,6 +1513,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
if body in SKIP_IN_PATH:
|
if body in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||||
|
|
||||||
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
"PATCH",
|
"PATCH",
|
||||||
"/_plugins/_security/api/nodesdn",
|
"/_plugins/_security/api/nodesdn",
|
||||||
|
|||||||
+18
-9
@@ -731,15 +731,24 @@ def read_modules() -> Any:
|
|||||||
]["required"]
|
]["required"]
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
q = data["components"]["requestBodies"][requestbody_ref]["content"][
|
|
||||||
"application/json"
|
if (
|
||||||
][
|
"application/x-ndjson"
|
||||||
"schema"
|
in data["components"]["requestBodies"][requestbody_ref][
|
||||||
] # pylint: disable=invalid-name
|
"content"
|
||||||
if "description" in q:
|
]
|
||||||
body.update({"description": q["description"]})
|
):
|
||||||
if "x-serialize" in q:
|
requestbody_schema = data["components"]["requestBodies"][
|
||||||
body.update({"serialize": q["x-serialize"]})
|
requestbody_ref
|
||||||
|
]["content"]["application/x-ndjson"]["schema"]
|
||||||
|
body.update({"serialize": True})
|
||||||
|
else:
|
||||||
|
requestbody_schema = data["components"]["requestBodies"][
|
||||||
|
requestbody_ref
|
||||||
|
]["content"]["application/json"]["schema"]
|
||||||
|
|
||||||
|
if "description" in requestbody_schema:
|
||||||
|
body.update({"description": requestbody_schema["description"]})
|
||||||
|
|
||||||
api.update({"body": body})
|
api.update({"body": body})
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% include "substitutions" %}
|
{% include "substitutions" %}
|
||||||
{% include "required" %}
|
{% include "required" %}
|
||||||
{% if api.body.serialize == "bulk" %}
|
{% if api.body.serialize %}
|
||||||
body = _bulk_body(self.transport.serializer, body)
|
body = _bulk_body(self.transport.serializer, body)
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% block request %}
|
{% block request %}
|
||||||
|
|||||||
Reference in New Issue
Block a user