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

[Fleet] Improve OpenAPI spec for agent bulk actions #135519

Closed
Tracked by #123150
juliaElastic opened this issue Jun 30, 2022 · 2 comments · Fixed by #137860
Closed
Tracked by #123150

[Fleet] Improve OpenAPI spec for agent bulk actions #135519

juliaElastic opened this issue Jun 30, 2022 · 2 comments · Fixed by #137860
Assignees
Labels
documentation Team:Fleet Team label for Observability Data Collection Fleet team

Comments

@juliaElastic
Copy link
Contributor

juliaElastic commented Jun 30, 2022

Improve OpenAPI spec for agent bulk actions:

  • bulk_reassign
  • bulk_enroll
  • bulk_upgrade

All of these endpoints support an agents parameter which can be either a list of agent ids or a query string.
Update the documentation so that it is clearer what is supported.

E.g. https://petstore.swagger.io/?url=https://raw.githubusercontent.com/elastic/kibana/main/x-pack/plugins/fleet/common/openapi/bundled.json#/default/bulk-reassign-agents

Some examples by triggering from UI:

Filtering on 2 agent policies:
POST http://localhost:5620/api/fleet/agents/bulk_reassign
{"policy_id":"e9d53200-f7b4-11ec-a9a9-0d6b33170dda","agents":" fleet-agents.policy_id : (\"9a00e890-f783-11ec-a9a9-0d6b33170dda\" or \"e9d53200-f7b4-11ec-a9a9-0d6b33170dda\")"}

No filters:
POST http://localhost:5620/api/fleet/agents/bulk_upgrade
{"version":"8.2.1","agents":"","rollout_duration_seconds":3600,"start_time":"2022-06-29T14:13:24.649Z"}

Filter on Updating only:
POST http://localhost:5620/api/fleet/agents/bulk_unenroll
{"agents":"((upgrade_started_at:*) and not (upgraded_at:*)) or (not (last_checkin:*)) or (unenrollment_started_at:*)","revoke":false}

Originally posted by @juliaElastic in #135425 (comment)

@juliaElastic juliaElastic added the Team:Fleet Team label for Observability Data Collection Fleet team label Jun 30, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@juliaElastic
Copy link
Contributor Author

@kpollich created this issue to improve OpenAPI spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Team:Fleet Team label for Observability Data Collection Fleet team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants