Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Add support for returning all index policy objects #629

Closed
spapadop opened this issue Dec 14, 2023 · 2 comments · Fixed by #633
Closed

[FEATURE] Add support for returning all index policy objects #629

spapadop opened this issue Dec 14, 2023 · 2 comments · Fixed by #633
Labels
enhancement New feature or request

Comments

@spapadop
Copy link

Is your feature request related to a problem?

Currently there is a nice integration for the index management plugin supporting APIs like get_policy. However, that get_policy() API has "policy" as required positional argument.

As a result, there is no way to request all the policies that live in a cluster.

What solution would you like?

Make "policy" an optional argument and return all policies whenever it is not given (or maybe also when policy is set to *, in case we wanna go down that path).
Alternatively, add a new API get_policies, which will behave like the alerting plugin's get_alerts.

In any case, the call should behave like running GET _plugins/_ism/policies on the cluster, thus returning:

{
  "policies": [
      { },
      ...
      { }
  ],
  "total_policies": 7
}

What alternatives have you considered?

Can't find a way that could fetch all policies of a cluster.

Do you have any additional context?

N/A

@spapadop spapadop added enhancement New feature or request untriaged Need triage labels Dec 14, 2023
@saimedhi saimedhi removed the untriaged Need triage label Dec 14, 2023
@saimedhi
Copy link
Collaborator

Hi @spapadop,

Opensearch server works fine without the "policy" argument at GET https://localhost:9200/_plugins/_ism/policies. Making it optional in opensearch-py would be helpful. If you have some time, could you please give it a try and consider raising a PR?

Thanks a bunch!

@spapadop
Copy link
Author

Hello @saimedhi,

I see you've raised already the PR, thanks! I'll follow it up there, in case any help is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants