Updated the get_policy API in the index_management plugin to allow the policy_id argument as optional (#633)
Signed-off-by: saimedhi <[email protected]>
This commit is contained in:
@@ -8,6 +8,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|||||||
- Added a log collection guide ([#579](https://github.com/opensearch-project/opensearch-py/pull/579))
|
- Added a log collection guide ([#579](https://github.com/opensearch-project/opensearch-py/pull/579))
|
||||||
- Added GHA release ([#614](https://github.com/opensearch-project/opensearch-py/pull/614))
|
- Added GHA release ([#614](https://github.com/opensearch-project/opensearch-py/pull/614))
|
||||||
### Changed
|
### Changed
|
||||||
|
- Updated the `get_policy` API in the index_management plugin to allow the policy_id argument as optional ([#633](https://github.com/opensearch-project/opensearch-py/pull/633))
|
||||||
### Deprecated
|
### Deprecated
|
||||||
### Removed
|
### Removed
|
||||||
- Removed unnecessary `# -*- coding: utf-8 -*-` headers from .py files ([#615](https://github.com/opensearch-project/opensearch-py/pull/615), [#617](https://github.com/opensearch-project/opensearch-py/pull/617))
|
- Removed unnecessary `# -*- coding: utf-8 -*-` headers from .py files ([#615](https://github.com/opensearch-project/opensearch-py/pull/615), [#617](https://github.com/opensearch-project/opensearch-py/pull/617))
|
||||||
|
|||||||
@@ -56,15 +56,13 @@ class IndexManagementClient(NamespacedClient):
|
|||||||
|
|
||||||
@query_params()
|
@query_params()
|
||||||
async def get_policy(
|
async def get_policy(
|
||||||
self, policy: Any, params: Any = None, headers: Any = None
|
self, policy: Any = None, params: Any = None, headers: Any = None
|
||||||
) -> Any:
|
) -> Any:
|
||||||
"""
|
"""
|
||||||
Gets the policy by `policy_id`.
|
Gets the policy by `policy_id`; returns all policies if no policy_id is provided.
|
||||||
|
|
||||||
:arg policy: The name of the policy
|
:arg policy: The name of the policy
|
||||||
"""
|
"""
|
||||||
if policy in SKIP_IN_PATH:
|
|
||||||
raise ValueError("Empty value passed for a required argument 'policy'.")
|
|
||||||
|
|
||||||
return await self.transport.perform_request(
|
return await self.transport.perform_request(
|
||||||
"GET",
|
"GET",
|
||||||
|
|||||||
@@ -55,14 +55,14 @@ class IndexManagementClient(NamespacedClient):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@query_params()
|
@query_params()
|
||||||
def get_policy(self, policy: Any, params: Any = None, headers: Any = None) -> Any:
|
def get_policy(
|
||||||
|
self, policy: Any = None, params: Any = None, headers: Any = None
|
||||||
|
) -> Any:
|
||||||
"""
|
"""
|
||||||
Gets the policy by `policy_id`.
|
Gets the policy by `policy_id`; returns all policies if no policy_id is provided.
|
||||||
|
|
||||||
:arg policy: The name of the policy
|
:arg policy: The name of the policy
|
||||||
"""
|
"""
|
||||||
if policy in SKIP_IN_PATH:
|
|
||||||
raise ValueError("Empty value passed for a required argument 'policy'.")
|
|
||||||
|
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
"GET",
|
"GET",
|
||||||
|
|||||||
Reference in New Issue
Block a user