Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x] Snapshots: show slm and status (elastic#199622) (elastic#203372)
# Backport This will backport the following commits from `main` to `8.x`: - [Snapshots: show slm and status (elastic#199622)](elastic#199622) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Sonia Sanz Vivas","email":"sonia.sanzvivas@elastic.co"},"sourceCommit":{"committedDate":"2024-12-09T08:57:41Z","message":"Snapshots: show slm and status (elastic#199622)\n\nCloses [elastic#148241](https://github.com/elastic/kibana/issues/148241)\r\n\r\n## Summary\r\n\r\nThis PR introduces a few changes in the snapshot and restore plugin.\r\n\r\n#### Snapshots tab\r\n* The state column has been aded to the table\r\n* In the detail flyout, it has been changed the way in which the status\r\nis displayed (icon and text).\r\n* No new test needed since this info was already there. The related\r\ntests have been updated.\r\n\r\n<table>\r\n <tr>\r\n <td style=\"padding-right: 10px;\">\r\n\r\n\r\n<img alt=\"Screenshot 2024-11-27 at 15 17 03\"\r\nsrc=\"https://github.com/user-attachments/assets/92b5c5cf-d90b-454c-9cf7-2eb101562c5f\">\r\n\r\n\r\n </td>\r\n <td>\r\n<img alt=\"Screenshot 2024-11-27 at 15 54 32\"\r\nsrc=\"https://github.com/user-attachments/assets/62395bad-4c70-44bb-84b3-c8a30ae9278a\">\r\n\r\n \r\n\r\n </td>\r\n </tr>\r\n</table>\r\n\r\n\r\n#### Policies tab\r\n* The copy of the callout for warning that two or more policies have the\r\nsame schedule has been changed. For testing that, you need to have two\r\nor more policies that have the same time por execution. No test added\r\nfor this, is only a copy change\r\n[[code](https://github.com/elastic/kibana/pull/199622/files#diff-e8e12f0dfdc97e4e064f8a07965312c8c91ca66578bdcaf5ee807e879cebcb6eR207)]\r\n<img width=\"1249\" alt=\"Screenshot 2024-11-27 at 15 17 25\"\r\nsrc=\"https://github.com/user-attachments/assets/5417910f-573a-4c22-a5e2-44ec2ce256b3\">\r\n\r\n\r\n* A new callout has been added to warn that the SLM status is different\r\nfrom “running”. SLM status is \"running\" by default, but it could happen\r\nthat the user stop it for any reason and then does not restart it. This\r\ncauses policies not to run when they are scheduled. To known the SLM\r\nstatus a new api call has been introduced (`GET _slm/status`).\r\n* I've created a new doc link to\r\nhttps://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-start.html\r\n * I've added new tests for the new api call.\r\n \r\n<img width=\"1246\" alt=\"Screenshot 2024-11-27 at 15 59 56\"\r\nsrc=\"https://github.com/user-attachments/assets/cd5ae491-16a4-4a68-a223-f44ce398ac2f\">\r\n\r\n\r\n \r\n\r\n## Testing\r\nYou will need to have at least one policy to test this. For that, you\r\ncan run Elastic using the following:\r\n```\r\nyarn es snapshot --license=trial -E path.repo=/tmp/es-backups\r\n```\r\n\r\nFrom the console, you can add a repository (you can also do it from the\r\nUI):\r\n```\r\nPUT /_snapshot/my_backup\r\n{\r\n \"type\": \"fs\",\r\n \"settings\": {\r\n \"location\": \"/tmp/es-backups\",\r\n \"chunk_size\": \"10mb\"\r\n }\r\n}\r\n````\r\n\r\nAnd for creating a policy you can run this:\r\n```\r\nPUT _slm/policy/nightly-snapshots\r\n{\r\n \"schedule\": \"0 30 1 * * ?\", \r\n \"name\": \"<nightly-snap-{now/d}>\", \r\n \"repository\": \"my_backup1\",\r\n \"retention\": { \r\n \"expire_after\": \"30d\",\r\n \"min_count\": 5,\r\n \"max_count\": 50\r\n }\r\n}\r\n```\r\n\r\nSLM status should be started by default (unless you have stopped it).\r\nFor starting it you can use `POST /_slm/start` and for stop it `POST\r\n/_slm/stop`\r\n\r\n## Demo\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/b83cd3ba-4821-4295-87f2-ecf427ec46e0\r\n\r\n---------\r\n\r\nCo-authored-by: shainaraskas <58563081+shainaraskas@users.noreply.github.com>","sha":"6d3b5c264b771a0fec3eb29112286f032496cf5d","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Kibana Management","release_note:skip","Feature:Snapshot and Restore","v9.0.0","backport:prev-minor"],"title":"Snapshots: show slm and status","number":199622,"url":"https://github.com/elastic/kibana/pull/199622","mergeCommit":{"message":"Snapshots: show slm and status (elastic#199622)\n\nCloses [elastic#148241](https://github.com/elastic/kibana/issues/148241)\r\n\r\n## Summary\r\n\r\nThis PR introduces a few changes in the snapshot and restore plugin.\r\n\r\n#### Snapshots tab\r\n* The state column has been aded to the table\r\n* In the detail flyout, it has been changed the way in which the status\r\nis displayed (icon and text).\r\n* No new test needed since this info was already there. The related\r\ntests have been updated.\r\n\r\n<table>\r\n <tr>\r\n <td style=\"padding-right: 10px;\">\r\n\r\n\r\n<img alt=\"Screenshot 2024-11-27 at 15 17 03\"\r\nsrc=\"https://github.com/user-attachments/assets/92b5c5cf-d90b-454c-9cf7-2eb101562c5f\">\r\n\r\n\r\n </td>\r\n <td>\r\n<img alt=\"Screenshot 2024-11-27 at 15 54 32\"\r\nsrc=\"https://github.com/user-attachments/assets/62395bad-4c70-44bb-84b3-c8a30ae9278a\">\r\n\r\n \r\n\r\n </td>\r\n </tr>\r\n</table>\r\n\r\n\r\n#### Policies tab\r\n* The copy of the callout for warning that two or more policies have the\r\nsame schedule has been changed. For testing that, you need to have two\r\nor more policies that have the same time por execution. No test added\r\nfor this, is only a copy change\r\n[[code](https://github.com/elastic/kibana/pull/199622/files#diff-e8e12f0dfdc97e4e064f8a07965312c8c91ca66578bdcaf5ee807e879cebcb6eR207)]\r\n<img width=\"1249\" alt=\"Screenshot 2024-11-27 at 15 17 25\"\r\nsrc=\"https://github.com/user-attachments/assets/5417910f-573a-4c22-a5e2-44ec2ce256b3\">\r\n\r\n\r\n* A new callout has been added to warn that the SLM status is different\r\nfrom “running”. SLM status is \"running\" by default, but it could happen\r\nthat the user stop it for any reason and then does not restart it. This\r\ncauses policies not to run when they are scheduled. To known the SLM\r\nstatus a new api call has been introduced (`GET _slm/status`).\r\n* I've created a new doc link to\r\nhttps://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-start.html\r\n * I've added new tests for the new api call.\r\n \r\n<img width=\"1246\" alt=\"Screenshot 2024-11-27 at 15 59 56\"\r\nsrc=\"https://github.com/user-attachments/assets/cd5ae491-16a4-4a68-a223-f44ce398ac2f\">\r\n\r\n\r\n \r\n\r\n## Testing\r\nYou will need to have at least one policy to test this. For that, you\r\ncan run Elastic using the following:\r\n```\r\nyarn es snapshot --license=trial -E path.repo=/tmp/es-backups\r\n```\r\n\r\nFrom the console, you can add a repository (you can also do it from the\r\nUI):\r\n```\r\nPUT /_snapshot/my_backup\r\n{\r\n \"type\": \"fs\",\r\n \"settings\": {\r\n \"location\": \"/tmp/es-backups\",\r\n \"chunk_size\": \"10mb\"\r\n }\r\n}\r\n````\r\n\r\nAnd for creating a policy you can run this:\r\n```\r\nPUT _slm/policy/nightly-snapshots\r\n{\r\n \"schedule\": \"0 30 1 * * ?\", \r\n \"name\": \"<nightly-snap-{now/d}>\", \r\n \"repository\": \"my_backup1\",\r\n \"retention\": { \r\n \"expire_after\": \"30d\",\r\n \"min_count\": 5,\r\n \"max_count\": 50\r\n }\r\n}\r\n```\r\n\r\nSLM status should be started by default (unless you have stopped it).\r\nFor starting it you can use `POST /_slm/start` and for stop it `POST\r\n/_slm/stop`\r\n\r\n## Demo\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/b83cd3ba-4821-4295-87f2-ecf427ec46e0\r\n\r\n---------\r\n\r\nCo-authored-by: shainaraskas <58563081+shainaraskas@users.noreply.github.com>","sha":"6d3b5c264b771a0fec3eb29112286f032496cf5d"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199622","number":199622,"mergeCommit":{"message":"Snapshots: show slm and status (elastic#199622)\n\nCloses [elastic#148241](https://github.com/elastic/kibana/issues/148241)\r\n\r\n## Summary\r\n\r\nThis PR introduces a few changes in the snapshot and restore plugin.\r\n\r\n#### Snapshots tab\r\n* The state column has been aded to the table\r\n* In the detail flyout, it has been changed the way in which the status\r\nis displayed (icon and text).\r\n* No new test needed since this info was already there. The related\r\ntests have been updated.\r\n\r\n<table>\r\n <tr>\r\n <td style=\"padding-right: 10px;\">\r\n\r\n\r\n<img alt=\"Screenshot 2024-11-27 at 15 17 03\"\r\nsrc=\"https://github.com/user-attachments/assets/92b5c5cf-d90b-454c-9cf7-2eb101562c5f\">\r\n\r\n\r\n </td>\r\n <td>\r\n<img alt=\"Screenshot 2024-11-27 at 15 54 32\"\r\nsrc=\"https://github.com/user-attachments/assets/62395bad-4c70-44bb-84b3-c8a30ae9278a\">\r\n\r\n \r\n\r\n </td>\r\n </tr>\r\n</table>\r\n\r\n\r\n#### Policies tab\r\n* The copy of the callout for warning that two or more policies have the\r\nsame schedule has been changed. For testing that, you need to have two\r\nor more policies that have the same time por execution. No test added\r\nfor this, is only a copy change\r\n[[code](https://github.com/elastic/kibana/pull/199622/files#diff-e8e12f0dfdc97e4e064f8a07965312c8c91ca66578bdcaf5ee807e879cebcb6eR207)]\r\n<img width=\"1249\" alt=\"Screenshot 2024-11-27 at 15 17 25\"\r\nsrc=\"https://github.com/user-attachments/assets/5417910f-573a-4c22-a5e2-44ec2ce256b3\">\r\n\r\n\r\n* A new callout has been added to warn that the SLM status is different\r\nfrom “running”. SLM status is \"running\" by default, but it could happen\r\nthat the user stop it for any reason and then does not restart it. This\r\ncauses policies not to run when they are scheduled. To known the SLM\r\nstatus a new api call has been introduced (`GET _slm/status`).\r\n* I've created a new doc link to\r\nhttps://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-start.html\r\n * I've added new tests for the new api call.\r\n \r\n<img width=\"1246\" alt=\"Screenshot 2024-11-27 at 15 59 56\"\r\nsrc=\"https://github.com/user-attachments/assets/cd5ae491-16a4-4a68-a223-f44ce398ac2f\">\r\n\r\n\r\n \r\n\r\n## Testing\r\nYou will need to have at least one policy to test this. For that, you\r\ncan run Elastic using the following:\r\n```\r\nyarn es snapshot --license=trial -E path.repo=/tmp/es-backups\r\n```\r\n\r\nFrom the console, you can add a repository (you can also do it from the\r\nUI):\r\n```\r\nPUT /_snapshot/my_backup\r\n{\r\n \"type\": \"fs\",\r\n \"settings\": {\r\n \"location\": \"/tmp/es-backups\",\r\n \"chunk_size\": \"10mb\"\r\n }\r\n}\r\n````\r\n\r\nAnd for creating a policy you can run this:\r\n```\r\nPUT _slm/policy/nightly-snapshots\r\n{\r\n \"schedule\": \"0 30 1 * * ?\", \r\n \"name\": \"<nightly-snap-{now/d}>\", \r\n \"repository\": \"my_backup1\",\r\n \"retention\": { \r\n \"expire_after\": \"30d\",\r\n \"min_count\": 5,\r\n \"max_count\": 50\r\n }\r\n}\r\n```\r\n\r\nSLM status should be started by default (unless you have stopped it).\r\nFor starting it you can use `POST /_slm/start` and for stop it `POST\r\n/_slm/stop`\r\n\r\n## Demo\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/b83cd3ba-4821-4295-87f2-ecf427ec46e0\r\n\r\n---------\r\n\r\nCo-authored-by: shainaraskas <58563081+shainaraskas@users.noreply.github.com>","sha":"6d3b5c264b771a0fec3eb29112286f032496cf5d"}}]}] BACKPORT--> Co-authored-by: Sonia Sanz Vivas <sonia.sanzvivas@elastic.co>
- Loading branch information