From db691e2efb24cbffd1d6c408753a8e4e3d4cb8a9 Mon Sep 17 00:00:00 2001 From: Tarun Kishore <75606327+Tarun-kishore@users.noreply.github.com> Date: Mon, 29 Sep 2025 21:26:35 +0530 Subject: [PATCH 1/2] Update sm-api.md to include snapshot pattern deletion feature Signed-off-by: Tarun Kishore <75606327+Tarun-kishore@users.noreply.github.com> --- .../availability-and-recovery/snapshots/sm-api.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/_tuning-your-cluster/availability-and-recovery/snapshots/sm-api.md b/_tuning-your-cluster/availability-and-recovery/snapshots/sm-api.md index deb269832e5..5a3bb4d9787 100644 --- a/_tuning-your-cluster/availability-and-recovery/snapshots/sm-api.md +++ b/_tuning-your-cluster/availability-and-recovery/snapshots/sm-api.md @@ -71,7 +71,8 @@ POST _plugins/_sm/policies/daily-policy "max_count": 21, "min_count": 7 }, - "time_limit": "1h" + "time_limit": "1h", + "snapshot_pattern": "external-backup-*" }, "snapshot_config": { "date_format": "yyyy-MM-dd-HH:mm", @@ -132,7 +133,8 @@ POST _plugins/_sm/policies/daily-policy "min_count" : 7, "max_count" : 21 }, - "time_limit" : "1h" + "time_limit" : "1h", + "snapshot_pattern" : "external-backup-*" }, "snapshot_config" : { "indices" : "*", @@ -188,7 +190,7 @@ Parameter | Type | Description `snapshot_config.include_global_state` | Boolean | Do you want to include cluster state? Optional. Default is `true` because of [Security plugin considerations]({{site.url}}{{site.baseurl}}/tuning-your-cluster/availability-and-recovery/snapshots/snapshot-restore#security-considerations). `snapshot_config.partial` | Boolean | Do you want to allow partial snapshots? Optional. Default is `false`. `snapshot_config.metadata` | Object | Metadata in the form of key/value pairs. Optional. -`creation` | Object | Configuration for snapshot creation. Required. +`creation` | Object | Configuration for snapshot creation. Optional. (This parameter is optional only for OpenSearch 3.3 and later; it should not be left unset until all nodes are upgraded to 3.3 or later.) `creation.schedule` | String | The cron schedule used to create snapshots. Required. `creation.time_limit` | String | Sets the maximum time to wait for snapshot creation to finish. If time_limit is longer than the scheduled time interval for taking snapshots, no scheduled snapshots are taken until time_limit elapses. For example, if time_limit is set to 35 minutes and snapshots are taken every 30 minutes starting at midnight, the snapshots at 00:00 and 01:00 are taken, but the snapshot at 00:30 is skipped. Optional. `deletion` | Object | Configuration for snapshot deletion. Optional. Default is to retain all snapshots. @@ -198,6 +200,7 @@ Parameter | Type | Description `deletion.delete_condition.max_count` | Integer | The maximum number of snapshots to be retained. Optional. `deletion.delete_condition.max_age` | String | The maximum time a snapshot is retained. Optional. `deletion.delete_condition.min_count` | Integer | The minimum number of snapshots to be retained. Optional. Default is `1`. +`deletion.snapshot_pattern` | String | Additional snapshot patterns to include in deletion. This allows deletion of snapshots that match the specified pattern in addition to the policy's own snapshots. Supports wildcards (`*`). Optional. `notification` | Object | Defines notifications for SM events. Optional. `notification.channel` | Object | Defines a channel for notifications. You must [create and configure a notification channel]({{site.url}}{{site.baseurl}}/notifications-plugin/api) before setting up SM notifications. Required. `notification.channel.id` | String | The channel ID of the channel used for notifications. To get the channel IDs of all created channels, use `GET _plugins/_notifications/configs`. Required. @@ -271,7 +274,8 @@ GET _plugins/_sm/policies/daily-policy "min_count" : 7, "max_count" : 21 }, - "time_limit" : "1h" + "time_limit" : "1h", + "snapshot_pattern" : "external-backup-*" }, "snapshot_config" : { "metadata" : { @@ -460,4 +464,4 @@ DELETE _plugins/_sm/policies/daily-policy "_seq_no" : 45366, "_primary_term" : 20 } -``` \ No newline at end of file +``` From fbc08312557403c1fc7b12f4193a10f7fae15a3c Mon Sep 17 00:00:00 2001 From: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Date: Mon, 29 Sep 2025 16:36:02 -0400 Subject: [PATCH 2/2] Update _tuning-your-cluster/availability-and-recovery/snapshots/sm-api.md Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> --- .../availability-and-recovery/snapshots/sm-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_tuning-your-cluster/availability-and-recovery/snapshots/sm-api.md b/_tuning-your-cluster/availability-and-recovery/snapshots/sm-api.md index 5a3bb4d9787..a4d0a918a89 100644 --- a/_tuning-your-cluster/availability-and-recovery/snapshots/sm-api.md +++ b/_tuning-your-cluster/availability-and-recovery/snapshots/sm-api.md @@ -190,7 +190,7 @@ Parameter | Type | Description `snapshot_config.include_global_state` | Boolean | Do you want to include cluster state? Optional. Default is `true` because of [Security plugin considerations]({{site.url}}{{site.baseurl}}/tuning-your-cluster/availability-and-recovery/snapshots/snapshot-restore#security-considerations). `snapshot_config.partial` | Boolean | Do you want to allow partial snapshots? Optional. Default is `false`. `snapshot_config.metadata` | Object | Metadata in the form of key/value pairs. Optional. -`creation` | Object | Configuration for snapshot creation. Optional. (This parameter is optional only for OpenSearch 3.3 and later; it should not be left unset until all nodes are upgraded to 3.3 or later.) +`creation` | Object | Configuration for snapshot creation. Optional in OpenSearch 3.3 and later. **Important**: Do not leave this unset until all nodes are upgraded to OpenSearch 3.3 or later. `creation.schedule` | String | The cron schedule used to create snapshots. Required. `creation.time_limit` | String | Sets the maximum time to wait for snapshot creation to finish. If time_limit is longer than the scheduled time interval for taking snapshots, no scheduled snapshots are taken until time_limit elapses. For example, if time_limit is set to 35 minutes and snapshots are taken every 30 minutes starting at midnight, the snapshots at 00:00 and 01:00 are taken, but the snapshot at 00:30 is skipped. Optional. `deletion` | Object | Configuration for snapshot deletion. Optional. Default is to retain all snapshots.