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:
Sai Medhini Reddy Maryada
2024-01-10 23:08:41 -08:00
committed by GitHub
parent 33c2060f6b
commit 2ab3a40307
3 changed files with 7 additions and 8 deletions
@@ -56,15 +56,13 @@ class IndexManagementClient(NamespacedClient):
@query_params()
async def get_policy(
self, policy: Any, params: Any = None, headers: Any = None
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
"""
if policy in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'policy'.")
return await self.transport.perform_request(
"GET",