Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.11] [Fleet] Modify bulk unenroll to include inactive agents (#170249…
…) (#170825) # Backport This will backport the following commits from `main` to `8.11`: - [[Fleet] Modify bulk unenroll to include inactive agents (#170249)](#170249) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Cristina Amico","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-11-08T08:29:23Z","message":"[Fleet] Modify bulk unenroll to include inactive agents (#170249)\n\nFixes https://github.com/elastic/kibana/issues/169977\r\n## Summary\r\n[Fleet] Modify bulk unenroll to include inactive agents when passing\r\n`\"includeInactive\": true`.\r\n\r\n- This flag only works when the agents are selected by query.\r\n- Updated the hook in the UI to include the new flag.\r\n\r\n\r\n### Testing\r\n\r\n#### API\r\n- Enroll some agents and make them inactive\r\n- From dev tools, run the bulk_unenroll api with option\r\n`includeInactive`:\r\n```\r\nPOST kbn:/api/fleet/agents/bulk_unenroll\r\n{\r\n \"agents\": \"last_checkin<=2023-11-06\",\r\n \"revoke\": true,\r\n \"includeInactive\": true\r\n}\r\n```\r\nThis should remove all the agents selected in the kuery, also the\r\ninactive ones.\r\n\r\n#### UI\r\n- Enroll some agents and make them inactive\r\n- Select all agents on all pages, from the bulk actions click on\r\n\"unenroll agents\"\r\n- It should remove all the agents, inactive ones too.\r\n\r\n\r\n### Checklist\r\n- [ ]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas added for features that require explanation or tutorials\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n\r\n### For maintainers\r\n\r\n- [ ] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"b2e3284d0f64fa73d807eaf33c951fa21416674a","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Fleet","backport:prev-minor","v8.12.0"],"number":170249,"url":"https://github.com/elastic/kibana/pull/170249","mergeCommit":{"message":"[Fleet] Modify bulk unenroll to include inactive agents (#170249)\n\nFixes https://github.com/elastic/kibana/issues/169977\r\n## Summary\r\n[Fleet] Modify bulk unenroll to include inactive agents when passing\r\n`\"includeInactive\": true`.\r\n\r\n- This flag only works when the agents are selected by query.\r\n- Updated the hook in the UI to include the new flag.\r\n\r\n\r\n### Testing\r\n\r\n#### API\r\n- Enroll some agents and make them inactive\r\n- From dev tools, run the bulk_unenroll api with option\r\n`includeInactive`:\r\n```\r\nPOST kbn:/api/fleet/agents/bulk_unenroll\r\n{\r\n \"agents\": \"last_checkin<=2023-11-06\",\r\n \"revoke\": true,\r\n \"includeInactive\": true\r\n}\r\n```\r\nThis should remove all the agents selected in the kuery, also the\r\ninactive ones.\r\n\r\n#### UI\r\n- Enroll some agents and make them inactive\r\n- Select all agents on all pages, from the bulk actions click on\r\n\"unenroll agents\"\r\n- It should remove all the agents, inactive ones too.\r\n\r\n\r\n### Checklist\r\n- [ ]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas added for features that require explanation or tutorials\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n\r\n### For maintainers\r\n\r\n- [ ] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"b2e3284d0f64fa73d807eaf33c951fa21416674a"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/170249","number":170249,"mergeCommit":{"message":"[Fleet] Modify bulk unenroll to include inactive agents (#170249)\n\nFixes https://github.com/elastic/kibana/issues/169977\r\n## Summary\r\n[Fleet] Modify bulk unenroll to include inactive agents when passing\r\n`\"includeInactive\": true`.\r\n\r\n- This flag only works when the agents are selected by query.\r\n- Updated the hook in the UI to include the new flag.\r\n\r\n\r\n### Testing\r\n\r\n#### API\r\n- Enroll some agents and make them inactive\r\n- From dev tools, run the bulk_unenroll api with option\r\n`includeInactive`:\r\n```\r\nPOST kbn:/api/fleet/agents/bulk_unenroll\r\n{\r\n \"agents\": \"last_checkin<=2023-11-06\",\r\n \"revoke\": true,\r\n \"includeInactive\": true\r\n}\r\n```\r\nThis should remove all the agents selected in the kuery, also the\r\ninactive ones.\r\n\r\n#### UI\r\n- Enroll some agents and make them inactive\r\n- Select all agents on all pages, from the bulk actions click on\r\n\"unenroll agents\"\r\n- It should remove all the agents, inactive ones too.\r\n\r\n\r\n### Checklist\r\n- [ ]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas added for features that require explanation or tutorials\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n\r\n### For maintainers\r\n\r\n- [ ] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"b2e3284d0f64fa73d807eaf33c951fa21416674a"}}]}] BACKPORT--> Co-authored-by: Cristina Amico <[email protected]>
- Loading branch information