From 87847db5f4c1957c7cd6dfe4fd82e69010b07ca1 Mon Sep 17 00:00:00 2001 From: Alen <78027095+aabeshov@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:23:48 +0500 Subject: [PATCH] SnapshotManagement namespace api (#701) * Created yaml structures Signed-off-by: alen_abeshov * Fixing errors while linting Signed-off-by: alen_abeshov * Changed CHANGELOG.md Signed-off-by: alen_abeshov * Tests Signed-off-by: alen_abeshov * Linted Signed-off-by: alen_abeshov * Fixed the tests. Moved each start,explain and stop API to separate file.Renamed snapshot managment to 'sm' Signed-off-by: alen_abeshov * Added version condition Signed-off-by: alen_abeshov * changed version.using quoting Signed-off-by: alen_abeshov * fixing validation failure Signed-off-by: alen_abeshov * Quote parameters with backticks. Signed-off-by: Daniel (dB.) Doubrovkine --------- Signed-off-by: alen_abeshov Signed-off-by: Daniel (dB.) Doubrovkine Co-authored-by: Daniel (dB.) Doubrovkine --- CHANGELOG.md | 1 + spec/namespaces/sm.yaml | 325 ++++++++++++++++++++ spec/schemas/sm._common.yaml | 391 +++++++++++++++++++++++++ tests/default/sm/policies.yaml | 110 +++++++ tests/default/sm/policies/explain.yaml | 64 ++++ tests/default/sm/policies/start.yaml | 64 ++++ tests/default/sm/policies/stop.yaml | 64 ++++ 7 files changed, 1019 insertions(+) create mode 100644 spec/namespaces/sm.yaml create mode 100644 spec/schemas/sm._common.yaml create mode 100644 tests/default/sm/policies.yaml create mode 100644 tests/default/sm/policies/explain.yaml create mode 100644 tests/default/sm/policies/start.yaml create mode 100644 tests/default/sm/policies/stop.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 150e384c9..7d6dc5979 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -164,6 +164,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added API spec for `adjust_pure_negative` for bool queries ([#641](https://github.com/opensearch-project/opensearch-api-specification/pull/641)) - Added a spec style checker [#620](https://github.com/opensearch-project/opensearch-api-specification/pull/620). - Added `remote_store` to node `Stats` ([#643](https://github.com/opensearch-project/opensearch-api-specification/pull/643)) +- Added `sm` namespace API specifications ([#701](https://github.com/opensearch-project/opensearch-api-specification/pull/701)) ### Changed diff --git a/spec/namespaces/sm.yaml b/spec/namespaces/sm.yaml new file mode 100644 index 000000000..1a7ed1654 --- /dev/null +++ b/spec/namespaces/sm.yaml @@ -0,0 +1,325 @@ +openapi: 3.1.0 +info: + title: OpenSearch Snapshot Management API + description: API for automating snapshot management tasks. + version: 1.0.0 + +paths: + /_plugins/_sm/policies: + get: + operationId: sm.get_policies.0 + x-operation-group: sm.get_policies + x-version-added: '2.1' + description: Retrieves all snapshot management policies with optional pagination and filtering. + parameters: + - $ref: '#/components/parameters/sm.get_policies::query.from' + - $ref: '#/components/parameters/sm.get_policies::query.queryString' + - $ref: '#/components/parameters/sm.get_policies::query.size' + - $ref: '#/components/parameters/sm.get_policies::query.sortField' + - $ref: '#/components/parameters/sm.get_policies::query.sortOrder' + responses: + '200': + $ref: '#/components/responses/sm.get_policies@200' + + /_plugins/_sm/policies/{policy_name}: + get: + operationId: sm.get_policy.0 + x-operation-group: sm.get_policy + x-version-added: '2.1' + description: Retrieves a specific snapshot management policy by name. + parameters: + - $ref: '#/components/parameters/sm.get_policy::path.policy_name' + responses: + '200': + $ref: '#/components/responses/sm.get_policy@200' + '404': + $ref: '#/components/responses/sm.get_policy@404' + post: + operationId: sm.create_policy.0 + x-operation-group: sm.create_policy + x-version-added: '2.1' + description: Creates a snapshot management policy. + parameters: + - $ref: '#/components/parameters/sm.create_policy::path.policy_name' + requestBody: + $ref: '#/components/requestBodies/sm.create_policy' + responses: + '201': + $ref: '#/components/responses/sm.create_policy@201' + '400': + $ref: '#/components/responses/sm.create_policy@400' + put: + operationId: sm.update_policy.0 + x-operation-group: sm.update_policy + x-version-added: '2.1' + description: Updates an existing snapshot management policy. Requires `if_seq_no` and `if_primary_term`. + parameters: + - $ref: '#/components/parameters/sm.update_policy::path.policy_name' + - $ref: '#/components/parameters/sm.update_policy::query.if_primary_term' + - $ref: '#/components/parameters/sm.update_policy::query.if_seq_no' + requestBody: + $ref: '#/components/requestBodies/sm.update_policy' + responses: + '200': + $ref: '#/components/responses/sm.update_policy@200' + '404': + $ref: '#/components/responses/sm.update_policy@404' + delete: + operationId: sm.delete_policy.0 + x-operation-group: sm.delete_policy + x-version-added: '2.1' + description: Deletes a snapshot management policy. + parameters: + - $ref: '#/components/parameters/sm.delete_policy::path.policy_name' + responses: + '200': + $ref: '#/components/responses/sm.delete_policy@200' + '404': + $ref: '#/components/responses/sm.delete_policy@404' + + /_plugins/_sm/policies/{policy_name}/_explain: + get: + operationId: sm.explain_policy.0 + x-operation-group: sm.explain_policy + x-version-added: '2.1' + description: Explains the state of the snapshot management policy. + parameters: + - $ref: '#/components/parameters/sm.explain_policy::path.policy_name' + responses: + '200': + $ref: '#/components/responses/sm.explain_policy@200' + + /_plugins/_sm/policies/{policy_name}/_start: + post: + operationId: sm.start_policy.0 + x-operation-group: sm.start_policy + x-version-added: '2.1' + description: Starts a snapshot management policy. + parameters: + - $ref: '#/components/parameters/sm.start_policy::path.policy_name' + responses: + '200': + $ref: '#/components/responses/sm.start_policy@200' + + /_plugins/_sm/policies/{policy_name}/_stop: + post: + operationId: sm.stop_policy.0 + x-operation-group: sm.stop_policy + x-version-added: '2.1' + description: Stops a snapshot management policy. + parameters: + - $ref: '#/components/parameters/sm.stop_policy::path.policy_name' + responses: + '200': + $ref: '#/components/responses/sm.stop_policy@200' + +components: + requestBodies: + sm.create_policy: + content: + application/json: + schema: + $ref: '../schemas/sm._common.yaml#/components/schemas/CreateUpdatePolicyRequest' + sm.update_policy: + content: + application/json: + schema: + $ref: '../schemas/sm._common.yaml#/components/schemas/CreateUpdatePolicyRequest' + + responses: + sm.get_policies@200: + description: Successfully retrieved the list of snapshot management policies. + content: + application/json: + schema: + $ref: '../schemas/sm._common.yaml#/components/schemas/GetPoliciesResponse' + + sm.create_policy@201: + description: Successfully created the snapshot management policy. + content: + application/json: + schema: + $ref: '../schemas/sm._common.yaml#/components/schemas/PolicyResponse' + sm.create_policy@400: + description: Bad request when creating the snapshot management policy. + content: + application/json: + schema: + $ref: '../schemas/sm._common.yaml#/components/schemas/BadRequestResponse' + + sm.get_policy@200: + description: Successfully retrieved the snapshot management policy. + content: + application/json: + schema: + $ref: '../schemas/sm._common.yaml#/components/schemas/PolicyResponse' + sm.get_policy@404: + description: Snapshot management policy not found. + content: + application/json: + schema: + $ref: '../schemas/sm._common.yaml#/components/schemas/NotFoundResponse' + + sm.update_policy@200: + description: Successfully updated the snapshot management policy. + content: + application/json: + schema: + $ref: '../schemas/sm._common.yaml#/components/schemas/PolicyResponse' + sm.update_policy@404: + description: Snapshot management policy not found. + content: + application/json: + schema: + $ref: '../schemas/sm._common.yaml#/components/schemas/NotFoundResponse' + + sm.delete_policy@200: + description: Successfully deleted the snapshot management policy. + content: + application/json: + schema: + $ref: '../schemas/sm._common.yaml#/components/schemas/DeletePolicyResponse' + sm.delete_policy@404: + description: Snapshot management policy not found. + content: + application/json: + schema: + $ref: '../schemas/sm._common.yaml#/components/schemas/NotFoundResponse' + + sm.explain_policy@200: + description: Successfully explained the state of the snapshot management policy. + content: + application/json: + schema: + $ref: '../schemas/sm._common.yaml#/components/schemas/PolicyExplanation' + + sm.start_policy@200: + description: Successfully started the snapshot management policy. + content: + application/json: + schema: + type: object + properties: + acknowledged: + type: boolean + + sm.stop_policy@200: + description: Successfully stopped the snapshot management policy. + content: + application/json: + schema: + type: object + properties: + acknowledged: + type: boolean + + parameters: + sm.create_policy::path.policy_name: + name: policy_name + in: path + description: The name of the snapshot management policy. + required: true + schema: + type: string + + sm.get_policy::path.policy_name: + name: policy_name + in: path + description: The name of the snapshot management policy. + required: true + schema: + type: string + + sm.get_policies::query.from: + name: from + in: query + description: 'The starting index (default: 0)' + schema: + type: integer + + sm.update_policy::path.policy_name: + name: policy_name + in: path + description: The name of the snapshot management policy. + required: true + schema: + type: string + + sm.update_policy::query.if_seq_no: + name: if_seq_no + in: query + description: The sequence number of the policy to update. + required: true + schema: + type: integer + + sm.update_policy::query.if_primary_term: + name: if_primary_term + in: query + description: The primary term of the policy to update. + required: true + schema: + type: integer + + sm.delete_policy::path.policy_name: + name: policy_name + in: path + description: The name of the snapshot management policy. + required: true + schema: + type: string + + sm.explain_policy::path.policy_name: + name: policy_name + in: path + description: The name of the snapshot management policy. + required: true + schema: + type: string + + sm.start_policy::path.policy_name: + name: policy_name + in: path + description: The name of the snapshot management policy. + required: true + schema: + type: string + + sm.stop_policy::path.policy_name: + name: policy_name + in: path + description: The name of the snapshot management policy. + required: true + schema: + type: string + + sm.get_policies::query.size: + name: size + in: query + description: + The number of policies to return. + schema: + type: integer + + sm.get_policies::query.queryString: + name: queryString + in: query + description: A query string to filter policies. + schema: + type: string + + sm.get_policies::query.sortField: + name: sortField + in: query + description: The field to sort on. + schema: + type: string + + sm.get_policies::query.sortOrder: + name: sortOrder + in: query + description: The order of sorting. + schema: + type: string + enum: [asc, desc] + default: asc diff --git a/spec/schemas/sm._common.yaml b/spec/schemas/sm._common.yaml new file mode 100644 index 000000000..5b2c85daf --- /dev/null +++ b/spec/schemas/sm._common.yaml @@ -0,0 +1,391 @@ +openapi: 3.1.0 +info: + title: Schemas for OpenSearch Snapshot Management API + description: Common schemas for Snapshot Management API + version: 1.0.0 +paths: {} +components: + schemas: + # The request body for creating/updating a policy + CreateUpdatePolicyRequest: + type: object + properties: + description: + type: string + creation: + $ref: '#/components/schemas/CreationConfig' + deletion: + $ref: '#/components/schemas/DeletionConfig' + snapshot_config: + $ref: '#/components/schemas/SnapshotConfig' + notification: + $ref: '#/components/schemas/NotificationConfig' + enabled: + type: boolean + description: 'Whether the policy should be enabled at creation. Default: true' + required: + - creation + - snapshot_config + + # The main returned policy response object after GET, POST, PUT + PolicyResponse: + type: object + properties: + _id: + type: string + _version: + type: integer + _seq_no: + type: integer + _primary_term: + type: integer + sm_policy: + $ref: '#/components/schemas/SMPolicy' + required: + - _id + - _primary_term + - _seq_no + - _version + - sm_policy + + # The internal structure of sm_policy + SMPolicy: + type: object + properties: + name: + type: string + description: + type: string + schema_version: + type: integer + creation: + $ref: '#/components/schemas/CreationConfig' + deletion: + $ref: '#/components/schemas/DeletionConfig' + description: Configuration for snapshot deletion, optional. + snapshot_config: + $ref: '#/components/schemas/SnapshotConfig' + notification: + $ref: '#/components/schemas/NotificationConfig' + schedule: + $ref: '#/components/schemas/IntervalSchedule' + description: System-generated schedule metadata returned by the API. + enabled: + type: boolean + last_updated_time: + type: integer + enabled_time: + type: integer + required: + - creation + - description + - name + - snapshot_config + + GetPoliciesResponse: + type: object + properties: + total_policies: + type: integer + policies: + type: array + items: + $ref: '#/components/schemas/ListedPolicy' + required: + - policies + - total_policies + + ListedPolicy: + type: object + properties: + _id: + type: string + _seq_no: + type: integer + _primary_term: + type: integer + sm_policy: + $ref: '#/components/schemas/SMPolicy' + required: + - _id + - sm_policy + + # Creation and Deletion Configurations + CreationConfig: + type: object + properties: + schedule: + $ref: '#/components/schemas/CronSchedule' + time_limit: + type: string + description: Maximum time for snapshot creation. + required: + - schedule + + DeletionConfig: + type: object + properties: + schedule: + $ref: '#/components/schemas/CronSchedule' + condition: + $ref: '#/components/schemas/DeletionCondition' + time_limit: + type: string + # deletion is optional as per docs, so no required block here. + + DeletionCondition: + type: object + properties: + max_age: + type: string + max_count: + type: integer + min_count: + type: integer + # Not all are mandatory according to the doc, min_count default 1 + # To align strictly with doc, remove required: + # required: + # - min_count + + SnapshotConfig: + type: object + properties: + date_format: + type: string + description: Default "yyyy-MM-dd'T'HH:mm:ss" + timezone: + type: string + description: Default UTC + indices: + type: string + description: Default "*" + repository: + type: string + ignore_unavailable: + type: boolean + description: Default false + include_global_state: + type: boolean + description: Default true + partial: + type: boolean + description: Default false + metadata: + type: object + additionalProperties: + type: string + required: + - repository + + NotificationConfig: + type: object + properties: + channel: + $ref: '#/components/schemas/NotificationChannel' + conditions: + $ref: '#/components/schemas/NotificationConditions' + + CronExpression: + type: object + properties: + expression: + type: string + timezone: + type: string + required: + - expression + - timezone + + CronSchedule: + type: object + properties: + cron: + $ref: '#/components/schemas/CronExpression' + + IntervalConfig: + type: object + properties: + start_time: + type: integer + period: + type: integer + unit: + type: string + enum: [Days, Hours, Minutes] + required: + - period + - start_time + - unit + + IntervalSchedule: + type: object + properties: + interval: + $ref: '#/components/schemas/IntervalConfig' + + NotificationChannel: + type: object + properties: + id: + type: string + required: + - id + + NotificationConditions: + type: object + properties: + creation: + type: boolean + default: true + deletion: + type: boolean + default: false + failure: + type: boolean + default: false + time_limit_exceeded: + type: boolean + default: false + + PolicyExplanation: + type: object + properties: + policies: + type: array + items: + $ref: '#/components/schemas/ExplainedPolicy' + + ExplainedPolicy: + type: object + properties: + name: + type: string + creation: + $ref: '#/components/schemas/StateMetadata' + deletion: + $ref: '#/components/schemas/StateMetadata' + policy_seq_no: + type: integer + policy_primary_term: + type: integer + enabled: + type: boolean + + StateMetadata: + type: object + properties: + current_state: + type: string + trigger: + $ref: '#/components/schemas/TriggerMetadata' + latest_execution: + $ref: '#/components/schemas/ExecutionMetadata' + retry: + $ref: '#/components/schemas/RetryMetadata' + + TriggerMetadata: + type: object + properties: + time: + type: integer + + ExecutionInfo: + type: object + properties: + message: + type: string + cause: + type: string + + ExecutionMetadata: + type: object + properties: + info: + $ref: '#/components/schemas/ExecutionInfo' + + RetryMetadata: + type: object + properties: + count: + type: integer + + ShardsInfo: + type: object + properties: + total: + type: integer + successful: + type: integer + failed: + type: integer + + DeletePolicyResponse: + type: object + properties: + _index: + type: string + _id: + type: string + _version: + type: integer + result: + type: string + forced_refresh: + type: boolean + _shards: + $ref: '#/components/schemas/ShardsInfo' + _seq_no: + type: integer + _primary_term: + type: integer + required: + - _id + - _index + - _primary_term + - _seq_no + - _shards + - _version + - forced_refresh + - result + + RootCause: + type: object + properties: + type: + type: string + reason: + type: string + + NotFoundError: + type: object + properties: + root_cause: + type: array + items: + $ref: '#/components/schemas/RootCause' + type: + type: string + reason: + type: string + required: + - reason + - type + + NotFoundResponse: + type: object + properties: + error: + $ref: '#/components/schemas/NotFoundError' + status: + type: integer + required: + - error + - status + + BadRequestResponse: + type: object + properties: + error: + type: string + status: + type: integer diff --git a/tests/default/sm/policies.yaml b/tests/default/sm/policies.yaml new file mode 100644 index 000000000..10abeb192 --- /dev/null +++ b/tests/default/sm/policies.yaml @@ -0,0 +1,110 @@ +$schema: ../../../json_schemas/test_story.schema.yaml +description: Test the lifecycle of a snapshot management policy, including creation, retrieval, listing, update, and deletion. +version: '>=2.1' + +chapters: + - synopsis: Create a new snapshot management policy. + path: /_plugins/_sm/policies/{policy_name} + method: POST + parameters: + policy_name: daily-policy + request: + payload: + description: Daily snapshot policy + creation: + schedule: + cron: + expression: '0 8 * * *' + timezone: UTC + time_limit: 1h + deletion: + schedule: + cron: + expression: '0 1 * * *' + timezone: America/Los_Angeles + condition: + max_age: 7d + max_count: 21 + min_count: 7 + time_limit: 1h + snapshot_config: + date_format: 'yyyy-MM-dd-HH:mm' + timezone: America/Los_Angeles + indices: '*' + repository: s3-repo + ignore_unavailable: true + include_global_state: false + partial: true + metadata: + any_key: any_value + notification: + channel: + id: NC3OpoEBzEoHMX183R3f + conditions: + creation: true + deletion: false + failure: false + time_limit_exceeded: false + enabled: true + response: + status: 201 + - id: retrieve_created_policy + synopsis: Retrieve the created snapshot management policy. + path: /_plugins/_sm/policies/{policy_name} + method: GET + parameters: + policy_name: daily-policy + response: + status: 200 + output: + seq_no: payload._seq_no + primary_term: payload._primary_term + - synopsis: List snapshot management policies. + path: /_plugins/_sm/policies + method: GET + parameters: + from: 0 + size: 20 + queryString: '*' + response: + status: 200 + - synopsis: Update the snapshot management policy with correct version. + path: /_plugins/_sm/policies/{policy_name} + method: PUT + parameters: + policy_name: daily-policy + if_seq_no: '${retrieve_created_policy.seq_no}' + if_primary_term: '${retrieve_created_policy.primary_term}' + request: + payload: + description: Updated daily snapshot policy + creation: + schedule: + cron: + expression: '0 9 * * *' + timezone: UTC + time_limit: 30m + snapshot_config: + date_format: yyyy-MM-dd + timezone: UTC + indices: 'my-index-*' + repository: s3-repo-updated + ignore_unavailable: false + include_global_state: true + partial: false + response: + status: 200 + - synopsis: Delete the snapshot management policy. + path: /_plugins/_sm/policies/{policy_name} + method: DELETE + parameters: + policy_name: daily-policy + response: + status: 200 + - synopsis: Attempt to retrieve the deleted snapshot management policy. + path: /_plugins/_sm/policies/{policy_name} + method: GET + parameters: + policy_name: daily-policy + response: + status: 404 diff --git a/tests/default/sm/policies/explain.yaml b/tests/default/sm/policies/explain.yaml new file mode 100644 index 000000000..c0b7c4b60 --- /dev/null +++ b/tests/default/sm/policies/explain.yaml @@ -0,0 +1,64 @@ +$schema: ../../../../json_schemas/test_story.schema.yaml +description: Test explaining a snapshot management policy. +version: '>=2.1' + +prologues: + - path: /_plugins/_sm/policies/{policy_name} + method: POST + parameters: + policy_name: daily-policy + request: + payload: + description: Daily snapshot policy + creation: + schedule: + cron: + expression: '0 8 * * *' + timezone: UTC + time_limit: 1h + deletion: + schedule: + cron: + expression: '0 1 * * *' + timezone: America/Los_Angeles + condition: + max_age: 7d + max_count: 21 + min_count: 7 + time_limit: 1h + snapshot_config: + date_format: 'yyyy-MM-dd-HH:mm' + timezone: America/Los_Angeles + indices: '*' + repository: s3-repo + ignore_unavailable: true + include_global_state: false + partial: true + metadata: + any_key: any_value + notification: + channel: + id: NC3OpoEBzEoHMX183R3f + conditions: + creation: true + deletion: false + failure: false + time_limit_exceeded: false + enabled: true + status: [201] + +chapters: + - synopsis: Explain the snapshot management policy. + path: /_plugins/_sm/policies/{policy_name}/_explain + method: GET + parameters: + policy_name: daily-policy + response: + status: 200 + +epilogues: + - path: /_plugins/_sm/policies/{policy_name} + method: DELETE + parameters: + policy_name: daily-policy + status: [200] diff --git a/tests/default/sm/policies/start.yaml b/tests/default/sm/policies/start.yaml new file mode 100644 index 000000000..25399af55 --- /dev/null +++ b/tests/default/sm/policies/start.yaml @@ -0,0 +1,64 @@ +$schema: ../../../../json_schemas/test_story.schema.yaml +description: Test starting a snapshot management policy. +version: '>=2.1' + +prologues: + - path: /_plugins/_sm/policies/{policy_name} + method: POST + parameters: + policy_name: daily-policy + request: + payload: + description: Daily snapshot policy + creation: + schedule: + cron: + expression: '0 8 * * *' + timezone: UTC + time_limit: 1h + deletion: + schedule: + cron: + expression: '0 1 * * *' + timezone: America/Los_Angeles + condition: + max_age: 7d + max_count: 21 + min_count: 7 + time_limit: 1h + snapshot_config: + date_format: 'yyyy-MM-dd-HH:mm' + timezone: America/Los_Angeles + indices: '*' + repository: s3-repo + ignore_unavailable: true + include_global_state: false + partial: true + metadata: + any_key: any_value + notification: + channel: + id: NC3OpoEBzEoHMX183R3f + conditions: + creation: true + deletion: false + failure: false + time_limit_exceeded: false + enabled: false + status: [201] + +chapters: + - synopsis: Start the snapshot management policy. + path: /_plugins/_sm/policies/{policy_name}/_start + method: POST + parameters: + policy_name: daily-policy + response: + status: 200 + +epilogues: + - path: /_plugins/_sm/policies/{policy_name} + method: DELETE + parameters: + policy_name: daily-policy + status: [200] diff --git a/tests/default/sm/policies/stop.yaml b/tests/default/sm/policies/stop.yaml new file mode 100644 index 000000000..41a0301ef --- /dev/null +++ b/tests/default/sm/policies/stop.yaml @@ -0,0 +1,64 @@ +$schema: ../../../../json_schemas/test_story.schema.yaml +description: Test stopping a snapshot management policy. +version: '>=2.1' + +prologues: + - path: /_plugins/_sm/policies/{policy_name} + method: POST + parameters: + policy_name: daily-policy + request: + payload: + description: Daily snapshot policy + creation: + schedule: + cron: + expression: '0 8 * * *' + timezone: UTC + time_limit: 1h + deletion: + schedule: + cron: + expression: '0 1 * * *' + timezone: America/Los_Angeles + condition: + max_age: 7d + max_count: 21 + min_count: 7 + time_limit: 1h + snapshot_config: + date_format: 'yyyy-MM-dd-HH:mm' + timezone: America/Los_Angeles + indices: '*' + repository: s3-repo + ignore_unavailable: true + include_global_state: false + partial: true + metadata: + any_key: any_value + notification: + channel: + id: NC3OpoEBzEoHMX183R3f + conditions: + creation: true + deletion: false + failure: false + time_limit_exceeded: false + enabled: true + status: [201] + +chapters: + - synopsis: Stop the snapshot management policy. + path: /_plugins/_sm/policies/{policy_name}/_stop + method: POST + parameters: + policy_name: daily-policy + response: + status: 200 + +epilogues: + - path: /_plugins/_sm/policies/{policy_name} + method: DELETE + parameters: + policy_name: daily-policy + status: [200]