diff --git a/CHANGELOG.md b/CHANGELOG.md index 23e37961c..0129e440f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -92,9 +92,9 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added request and response schemas for `/_cluster/decommission/awareness` ([#524](https://github.com/opensearch-project/opensearch-api-specification/pull/524)) - Added `Bytes` component of type number ([#552](https://github.com/opensearch-project/opensearch-api-specification/pull/552)) - Added `xy_shape` query ([#531](https://github.com/opensearch-project/opensearch-api-specification/pull/531)) -- Added `/_plugins/_flow_framework/` ,`_search`,`state/_search`,`_provision`,`_deprovision`,`_steps`,`_status`([#508](https://github.com/opensearch-project/opensearch-api-specification/issues/508)) -- Added `/_plugins/_ism/policies`, `add`, `remove`, `change_policy`, `explain` ([#568](https://github.com/opensearch-project/opensearch-api-specification/pull/568)) -- Added more 4xx errors to `/_plugins/_flow_framework/` and added sample template test ([#833](https://github.com/opensearch-project/flow-framework/issues/833) +- Added `/_plugins/_flow_framework/`, `_search`, `state/_search`, `_provision`, `_deprovision`, `_steps`, and `_status` ([#508](https://github.com/opensearch-project/opensearch-api-specification/issues/508)) ([#833](https://github.com/opensearch-project/flow-framework/issues/833)) +- Added `/_plugins/_ism/policies`, `add`, `remove`, `change_policy`, `explain`, and `retry` ([#568](https://github.com/opensearch-project/opensearch-api-specification/pull/568)) ([#578](https://github.com/opensearch-project/opensearch-api-specification/pull/578)) +- Added `/_plugins/refresh_search_analyzers` ([#578](https://github.com/opensearch-project/opensearch-api-specification/pull/578)) ### Changed diff --git a/spec/_superseded_operations.yaml b/spec/_superseded_operations.yaml index e4170cc53..80e556067 100644 --- a/spec/_superseded_operations.yaml +++ b/spec/_superseded_operations.yaml @@ -189,10 +189,12 @@ $schema: ./json_schemas/_superseded_operations.schema.yaml superseded_by: /_plugins/_ism/explain operations: - GET + - POST /_opendistro/_ism/explain/{index}: superseded_by: /_plugins/_ism/explain/{index} operations: - GET + - POST /_opendistro/_ism/policies: superseded_by: /_plugins/_ism/policies operations: diff --git a/spec/namespaces/ism.yaml b/spec/namespaces/ism.yaml index 3aa5688f4..334bc69f7 100644 --- a/spec/namespaces/ism.yaml +++ b/spec/namespaces/ism.yaml @@ -4,18 +4,56 @@ info: description: Use the index state management operations to programmatically work with policies and managed indexes. version: 1.0.0 paths: + /_plugins/_ism/policies: + get: + operationId: ism.get_policies.0 + x-operation-group: ism.get_policies + description: Gets the policies. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#get-policy + responses: + '200': + $ref: '#/components/responses/ism.get_policies@200' + put: + operationId: ism.put_policies.0 + x-operation-group: ism.put_policies + description: Gets the policies. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#create-policy + requestBody: + $ref: '#/components/requestBodies/ism.put_policies' + parameters: + - $ref: '#/components/parameters/ism.put_policies::query.if_primary_term' + - $ref: '#/components/parameters/ism.put_policies::query.if_seq_no' + - $ref: '#/components/parameters/ism.put_policies::query.policyID' + responses: + '200': + $ref: '#/components/responses/ism.put_policies@200' /_plugins/_ism/policies/{policy_id}: get: operationId: ism.get_policy.0 x-operation-group: ism.get_policy - description: Gets the policy. + description: Gets a policy. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#get-policy + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#put-policy parameters: - $ref: '#/components/parameters/ism.get_policy::path.policy_id' responses: '200': $ref: '#/components/responses/ism.get_policy@200' + head: + operationId: ism.exists_policy.0 + x-operation-group: ism.exists_policy + description: Checks whether the policy exists. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#get-policy + parameters: + - $ref: '#/components/parameters/ism.exists_policy::path.policy_id' + responses: + '200': + $ref: '#/components/responses/ism.exists_policy@200' + '404': + $ref: '#/components/responses/ism.exists_policy@404' put: operationId: ism.put_policy.0 x-operation-group: ism.put_policy @@ -44,60 +82,187 @@ paths: responses: '200': $ref: '#/components/responses/ism.delete_policy@200' - /_plugins/_ism/add/{index}: + /_plugins/_ism/add: post: operationId: ism.add_policy.0 x-operation-group: ism.add_policy description: Adds a policy to an index. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#add-policy + parameters: + - $ref: '#/components/parameters/ism.add_policy::query.index' + requestBody: + $ref: '#/components/requestBodies/ism.add_policy' + responses: + '200': + $ref: '#/components/responses/ism.add_policy@200' + /_plugins/_ism/add/{index}: + post: + operationId: ism.add_policy.1 + x-operation-group: ism.add_policy + description: Adds a policy to an index. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#add-policy parameters: - $ref: '#/components/parameters/ism.add_policy::path.index' + - $ref: '#/components/parameters/ism.add_policy::query.index' requestBody: $ref: '#/components/requestBodies/ism.add_policy' responses: '200': $ref: '#/components/responses/ism.add_policy@200' - /_plugins/_ism/remove/{index}: + /_plugins/_ism/remove: post: operationId: ism.remove_policy.0 x-operation-group: ism.remove_policy description: Removes a policy from an index. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#remove-policy + parameters: + - $ref: '#/components/parameters/ism.remove_policy::query.index' + responses: + '200': + $ref: '#/components/responses/ism.remove_policy@200' + /_plugins/_ism/remove/{index}: + post: + operationId: ism.remove_policy.1 + x-operation-group: ism.remove_policy + description: Removes a policy from an index. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#remove-policy parameters: - $ref: '#/components/parameters/ism.remove_policy::path.index' + - $ref: '#/components/parameters/ism.remove_policy::query.index' responses: '200': $ref: '#/components/responses/ism.remove_policy@200' - /_plugins/_ism/change_policy/{index}: + /_plugins/_ism/change_policy: post: operationId: ism.change_policy.0 x-operation-group: ism.change_policy description: Updates the managed index policy to a new policy. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#update-managed-index-policy + parameters: + - $ref: '#/components/parameters/ism.change_policy::query.index' + requestBody: + $ref: '#/components/requestBodies/ism.change_policy' + responses: + '200': + $ref: '#/components/responses/ism.change_policy@200' + /_plugins/_ism/change_policy/{index}: + post: + operationId: ism.change_policy.1 + x-operation-group: ism.change_policy + description: Updates the managed index policy to a new policy. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#update-managed-index-policy parameters: - $ref: '#/components/parameters/ism.change_policy::path.index' + - $ref: '#/components/parameters/ism.change_policy::query.index' requestBody: $ref: '#/components/requestBodies/ism.change_policy' responses: '200': $ref: '#/components/responses/ism.change_policy@200' + /_plugins/_ism/explain: + get: + operationId: ism.explain_policy.0 + x-operation-group: ism.explain_policy + description: Gets the currently applied policy on indices. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index + requestBody: + $ref: '#/components/requestBodies/ism.explain_policy' + responses: + '200': + $ref: '#/components/responses/ism.explain_policy@200' + post: + operationId: ism.explain_policy.0 + x-operation-group: ism.explain_policy + description: Gets the currently applied policy on indices. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index + requestBody: + $ref: '#/components/requestBodies/ism.explain_policy' + responses: + '200': + $ref: '#/components/responses/ism.explain_policy@200' /_plugins/_ism/explain/{index}: get: - operationId: ism.explain_index.0 - x-operation-group: ism.explain_index - description: Gets the currently applied policy on an index. + operationId: ism.explain_policy.1 + x-operation-group: ism.explain_policy + description: Gets the currently applied policy on indices. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index parameters: - - $ref: '#/components/parameters/ism.explain_index::path.index' + - $ref: '#/components/parameters/ism.explain_policy::path.index' + requestBody: + $ref: '#/components/requestBodies/ism.explain_policy' responses: '200': - $ref: '#/components/responses/ism.explain_index@200' + $ref: '#/components/responses/ism.explain_policy@200' + post: + operationId: ism.explain_policy.1 + x-operation-group: ism.explain_policy + description: Gets the currently applied policy on indices. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index + parameters: + - $ref: '#/components/parameters/ism.explain_policy::path.index' + requestBody: + $ref: '#/components/requestBodies/ism.explain_policy' + responses: + '200': + $ref: '#/components/responses/ism.explain_policy@200' + /_plugins/_ism/retry: + post: + operationId: ism.retry_index.0 + x-operation-group: ism.retry_index + description: Retry the failed action for an index. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#retry-failed-index + parameters: + - $ref: '#/components/parameters/ism.retry_index::query.index' + requestBody: + $ref: '#/components/requestBodies/ism.retry_index' + responses: + '200': + $ref: '#/components/responses/ism.retry_index@200' + /_plugins/_ism/retry/{index}: + post: + operationId: ism.retry_index.1 + x-operation-group: ism.retry_index + description: Retry the failed action for an index. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#retry-failed-index + parameters: + - $ref: '#/components/parameters/ism.retry_index::path.index' + - $ref: '#/components/parameters/ism.retry_index::query.index' + requestBody: + $ref: '#/components/requestBodies/ism.retry_index' + responses: + '200': + $ref: '#/components/responses/ism.retry_index@200' + /_plugins/_refresh_search_analyzers/{index}: + post: + operationId: ism.refresh_search_analyzers.0 + x-operation-group: ism.refresh_search_analyzers + description: Refresh search analyzers in real time. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/refresh-analyzer/ + parameters: + - $ref: '#/components/parameters/ism.refresh_search_analyzers::path.index' + responses: + '200': + $ref: '#/components/responses/ism.refresh_search_analyzers@200' components: requestBodies: + ism.put_policies: + content: + application/json: + schema: + $ref: '../schemas/ism._common.yaml#/components/schemas/PutPolicyRequest' ism.put_policy: content: application/json: @@ -113,7 +278,29 @@ components: application/json: schema: $ref: '../schemas/ism._common.yaml#/components/schemas/ChangePolicyRequest' + ism.retry_index: + content: + application/json: + schema: + $ref: '../schemas/ism._common.yaml#/components/schemas/RetryIndexRequest' + ism.explain_policy: + content: + application/json: + schema: {} responses: + ism.exists_policy@200: + content: + application/json: + schema: {} + ism.exists_policy@404: + content: + application/json: + schema: {} + ism.get_policies@200: + content: + application/json: + schema: + $ref: '../schemas/ism._common.yaml#/components/schemas/GetPoliciesResponse' ism.get_policy@200: content: application/json: @@ -124,6 +311,11 @@ components: application/json: schema: $ref: '../schemas/ism._common.yaml#/components/schemas/PutPolicyResponse' + ism.put_policies@200: + content: + application/json: + schema: + $ref: '../schemas/ism._common.yaml#/components/schemas/PutPolicyResponse' ism.put_policy@200: content: application/json: @@ -149,12 +341,28 @@ components: application/json: schema: $ref: '../schemas/ism._common.yaml#/components/schemas/ChangePolicyResponse' - ism.explain_index@200: + ism.explain_policy@200: content: application/json: schema: $ref: '../schemas/ism._common.yaml#/components/schemas/ExplainIndexResponse' + ism.retry_index@200: + content: + application/json: + schema: + $ref: '../schemas/ism._common.yaml#/components/schemas/RetryIndexResponse' + ism.refresh_search_analyzers@200: + content: + application/json: + schema: + $ref: '../schemas/ism._common.yaml#/components/schemas/RefreshSearchAnalyzersResponse' parameters: + ism.exists_policy::path.policy_id: + name: policy_id + in: path + required: true + schema: + type: string ism.get_policy::path.policy_id: name: policy_id in: path @@ -187,6 +395,15 @@ components: schema: type: number style: form + ism.add_policy::query.index: + name: index + in: query + description: |- + Comma-separated list of data streams, indices, and aliases. + Supports wildcards (`*`). + required: true + schema: + $ref: '../schemas/_common.yaml#/components/schemas/IndexName' ism.add_policy::path.index: name: index in: path @@ -197,6 +414,24 @@ components: schema: $ref: '../schemas/_common.yaml#/components/schemas/IndexName' style: simple + ism.change_policy::query.index: + name: index + in: query + description: |- + Comma-separated list of data streams, indices, and aliases. + Supports wildcards (`*`). + required: true + schema: + $ref: '../schemas/_common.yaml#/components/schemas/IndexName' + ism.remove_policy::query.index: + name: index + in: query + description: |- + Comma-separated list of data streams, indices, and aliases. + Supports wildcards (`*`). + required: true + schema: + $ref: '../schemas/_common.yaml#/components/schemas/IndexName' ism.remove_policy::path.index: name: index in: path @@ -217,7 +452,26 @@ components: schema: $ref: '../schemas/_common.yaml#/components/schemas/IndexName' style: simple - ism.explain_index::path.index: + ism.explain_policy::path.index: + name: index + in: path + description: |- + Comma-separated list of data streams, indices, and aliases. + Supports wildcards (`*`). + required: true + schema: + $ref: '../schemas/_common.yaml#/components/schemas/IndexName' + style: simple + ism.retry_index::query.index: + name: index + in: query + description: |- + Comma-separated list of data streams, indices, and aliases. + Supports wildcards (`*`). + required: true + schema: + $ref: '../schemas/_common.yaml#/components/schemas/IndexName' + ism.retry_index::path.index: name: index in: path description: |- @@ -227,3 +481,34 @@ components: schema: $ref: '../schemas/_common.yaml#/components/schemas/IndexName' style: simple + ism.refresh_search_analyzers::path.index: + name: index + in: path + description: |- + Comma-separated list of data streams, indices, and aliases. + Supports wildcards (`*`). + required: true + schema: + $ref: '../schemas/_common.yaml#/components/schemas/IndexName' + style: simple + ism.put_policies::query.policyID: + name: policyID + in: query + required: true + schema: + type: string + style: form + ism.put_policies::query.if_primary_term: + name: if_primary_term + in: query + description: Only perform the operation if the document has this primary term. + schema: + type: number + style: form + ism.put_policies::query.if_seq_no: + name: if_seq_no + in: query + description: Only perform the operation if the document has this sequence number. + schema: + $ref: '../schemas/_common.yaml#/components/schemas/SequenceNumber' + style: form diff --git a/spec/schemas/ism._common.yaml b/spec/schemas/ism._common.yaml index 19e0762ce..73cb42071 100644 --- a/spec/schemas/ism._common.yaml +++ b/spec/schemas/ism._common.yaml @@ -49,6 +49,11 @@ components: - type: array items: $ref: '#/components/schemas/IsmTemplate' + PolicyWithMetadata: + type: object + allOf: + - $ref: '#/components/schemas/Metadata' + - $ref: '#/components/schemas/PolicyEnvelope' States: type: object description: |- @@ -217,10 +222,17 @@ components: conditions: type: object additionalProperties: true + GetPoliciesResponse: + type: object + properties: + total_policies: + type: number + policies: + type: array + items: + $ref: '#/components/schemas/PolicyWithMetadata' GetPolicyResponse: - allOf: - - $ref: '#/components/schemas/Metadata' - - $ref: '#/components/schemas/PolicyEnvelope' + $ref: '#/components/schemas/PolicyWithMetadata' PutPolicyResponse: allOf: - $ref: '#/components/schemas/Metadata' @@ -230,7 +242,7 @@ components: $ref: '#/components/schemas/PolicyEnvelope' DeletePolicyResponse: $ref: '_common.yaml#/components/schemas/WriteResponseBase' - ChangePolicyResponse: + ChangeResponse: type: object properties: updated_indices: @@ -241,6 +253,8 @@ components: type: array items: $ref: '#/components/schemas/FailedIndex' + ChangePolicyResponse: + $ref: '#/components/schemas/ChangeResponse' FailedIndex: type: object properties: @@ -374,3 +388,30 @@ components: type: number last_updated_time: type: integer + RetryIndexRequest: + type: object + properties: + state: + type: string + required: + - state + RetryIndexResponse: + $ref: '#/components/schemas/ChangeResponse' + RefreshSearchAnalyzersResponse: + type: object + properties: + _shards: + $ref: '_common.yaml#/components/schemas/ShardStatistics' + successful_refresh_details: + type: array + items: + $ref: '#/components/schemas/RefreshSearchAnalyzersResponseDetails' + RefreshSearchAnalyzersResponseDetails: + type: object + properties: + index: + type: string + refreshed_analyzers: + type: array + items: + type: string diff --git a/tests/default/ism/add.yaml b/tests/default/ism/add.yaml index f5283aa96..53794f33c 100644 --- a/tests/default/ism/add.yaml +++ b/tests/default/ism/add.yaml @@ -1,13 +1,6 @@ $schema: ../../../json_schemas/test_story.schema.yaml description: Test adding a policy to an index. -epilogues: - - path: /_plugins/_ism/policies/rollover - method: DELETE - status: [200, 404] - - path: /books - method: DELETE - status: [200, 404] prologues: - path: /books method: PUT @@ -28,7 +21,7 @@ prologues: output: id: payload._id chapters: - - synopsis: Add a rollover policy to the books index. + - synopsis: Add a rollover policy to the books index with the index in path. path: /_plugins/_ism/add/{index} method: POST parameters: @@ -36,4 +29,18 @@ chapters: request: payload: policy_id: ${policy.id} - \ No newline at end of file + - synopsis: Add a rollover policy to the books index with the index in a query parameter. + path: /_plugins/_ism/add + method: POST + parameters: + index: books + request: + payload: + policy_id: ${policy.id} +epilogues: + - path: /_plugins/_ism/policies/rollover + method: DELETE + status: [200, 404] + - path: /books + method: DELETE + status: [200, 404] diff --git a/tests/default/ism/change_policy.yaml b/tests/default/ism/change_policy.yaml index 3268f0d0a..cc7af8514 100644 --- a/tests/default/ism/change_policy.yaml +++ b/tests/default/ism/change_policy.yaml @@ -1,13 +1,6 @@ $schema: ../../../json_schemas/test_story.schema.yaml description: Test updating a managed index policy. -epilogues: - - path: /_plugins/_ism/policies/rollover - method: DELETE - status: [200, 404] - - path: /books - method: DELETE - status: [200, 404] prologues: - path: /books method: PUT @@ -33,7 +26,18 @@ prologues: payload: policy_id: ${policy.id} chapters: - - synopsis: Change policy on an index. + - synopsis: Change policy on an index in the query parameter. + path: /_plugins/_ism/change_policy + method: POST + parameters: + index: books + request: + payload: + policy_id: ${policy.id} + state: delete + include: + - state: searches + - synopsis: Change policy on an index in the path. path: /_plugins/_ism/change_policy/{index} method: POST parameters: @@ -44,4 +48,10 @@ chapters: state: delete include: - state: searches - \ No newline at end of file +epilogues: + - path: /_plugins/_ism/policies/rollover + method: DELETE + status: [200, 404] + - path: /books + method: DELETE + status: [200, 404] diff --git a/tests/default/ism/explain.yaml b/tests/default/ism/explain.yaml index 51c71b9ec..f3cf7654d 100644 --- a/tests/default/ism/explain.yaml +++ b/tests/default/ism/explain.yaml @@ -1,13 +1,6 @@ $schema: ../../../json_schemas/test_story.schema.yaml description: Test getting the current state of the index. -epilogues: - - path: /_plugins/_ism/policies/rollover - method: DELETE - status: [200, 404] - - path: /books - method: DELETE - status: [200, 404] prologues: - path: /books method: PUT @@ -33,8 +26,32 @@ prologues: payload: policy_id: ${policy.id} chapters: - - synopsis: Get the current policy for an index. + - synopsis: Get the total managed indices count (GET). + path: /_plugins/_ism/explain + method: GET + - synopsis: Get the total managed indices count (POST). + version: '>= 2.12' + path: /_plugins/_ism/explain + method: POST + request: + payload: {} + - synopsis: Get the current policy for an index (GET). path: /_plugins/_ism/explain/{index} method: GET parameters: index: books + - synopsis: Get the current policy for an index (POST). + version: '>= 2.12' + path: /_plugins/_ism/explain/{index} + method: POST + parameters: + index: books + request: + payload: {} +epilogues: + - path: /_plugins/_ism/policies/rollover + method: DELETE + status: [200, 404] + - path: /books + method: DELETE + status: [200, 404] diff --git a/tests/default/ism/policies.yaml b/tests/default/ism/policies.yaml index 0a2f75e7f..ae88b823b 100644 --- a/tests/default/ism/policies.yaml +++ b/tests/default/ism/policies.yaml @@ -1,10 +1,6 @@ $schema: ../../../json_schemas/test_story.schema.yaml description: Test index state management operations. -epilogues: - - path: /_plugins/_ism/policies/rollover - method: DELETE - status: [200, 404] chapters: - synopsis: Create a rollover policy. id: policy @@ -48,16 +44,27 @@ chapters: output: primary_term: payload._primary_term seq_no: payload._seq_no + - synopsis: Check whether a policy exists. + path: /_plugins/_ism/policies/{policy_id} + method: HEAD + parameters: + policy_id: rollover + response: + status: 200 - synopsis: Get a policy. path: /_plugins/_ism/policies/{policy_id} method: GET parameters: - policy_id: rollover - - synopsis: Update a policy. - path: /_plugins/_ism/policies/{policy_id} + policy_id: rollover + - synopsis: Get all policies. + path: /_plugins/_ism/policies + method: GET + - synopsis: Update a policy specified in the query. + id: updated_policy + path: /_plugins/_ism/policies method: PUT parameters: - policy_id: rollover + policyID: rollover if_primary_term: ${policy.primary_term} if_seq_no: ${policy.seq_no} request: @@ -72,6 +79,28 @@ chapters: min_doc_count: 3 response: status: 200 + output: + primary_term: payload._primary_term + seq_no: payload._seq_no + - synopsis: Update a policy specified in the path. + path: /_plugins/_ism/policies/{policy_id} + method: PUT + parameters: + policy_id: rollover + if_primary_term: ${updated_policy.primary_term} + if_seq_no: ${updated_policy.seq_no} + request: + payload: + policy: + description: Ingesting rollover. + default_state: ingest + states: + - name: ingest + actions: + - rollover: + min_doc_count: 3 + response: + status: 200 - synopsis: Delete a policy. path: /_plugins/_ism/policies/{policy_id} method: DELETE @@ -79,3 +108,7 @@ chapters: policy_id: rollover response: status: 200 +epilogues: + - path: /_plugins/_ism/policies/rollover + method: DELETE + status: [200, 404] diff --git a/tests/default/ism/refresh_search_analyzers.yaml b/tests/default/ism/refresh_search_analyzers.yaml new file mode 100644 index 000000000..532a0f498 --- /dev/null +++ b/tests/default/ism/refresh_search_analyzers.yaml @@ -0,0 +1,43 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Refresh search analyzers. +prologues: + - path: /books + method: PUT + request: + payload: + settings: + analysis: + analyzer: + movie_titles: + tokenizer: whitespace + filter: + - movie_titles + filter: + movie_titles: + type: synonym_graph + synonyms_path: opensearch.yml # synonyms.txt + updateable: true + mappings: + properties: + title: + type: text + analyzer: simple + search_analyzer: movie_titles +chapters: + - synopsis: Refresh search analyzers for an index. + path: /_plugins/_refresh_search_analyzers/{index} + method: POST + parameters: + index: books + response: + status: 200 + payload: + successful_refresh_details: + - index: books + refreshed_analyzers: + - movie_titles +epilogues: + - path: /books + method: DELETE + status: [200, 404] diff --git a/tests/default/ism/remove.yaml b/tests/default/ism/remove.yaml index f688cd519..93f673ee7 100644 --- a/tests/default/ism/remove.yaml +++ b/tests/default/ism/remove.yaml @@ -1,13 +1,6 @@ $schema: ../../../json_schemas/test_story.schema.yaml -description: Test adding a policy to an index. -epilogues: - - path: /_plugins/_ism/policies/rollover - method: DELETE - status: [200, 404] - - path: /books - method: DELETE - status: [200, 404] +description: Test removing a policy from an index. prologues: - path: /books method: PUT @@ -33,7 +26,12 @@ prologues: payload: policy_id: ${policy.id} chapters: - - synopsis: Remove the current policy from an index. + - synopsis: Remove the current policy from an index specified in the query. + path: /_plugins/_ism/remove + method: POST + parameters: + index: books + - synopsis: Remove the current policy from an index specified in the path. path: /_plugins/_ism/remove/{index} method: POST parameters: @@ -43,3 +41,10 @@ chapters: method: POST parameters: index: books +epilogues: + - path: /_plugins/_ism/policies/rollover + method: DELETE + status: [200, 404] + - path: /books + method: DELETE + status: [200, 404] diff --git a/tests/default/ism/retry.yaml b/tests/default/ism/retry.yaml new file mode 100644 index 000000000..6d5a3312f --- /dev/null +++ b/tests/default/ism/retry.yaml @@ -0,0 +1,43 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Test retrying a failed action for an index. +prologues: + - path: /books + method: PUT +chapters: + - synopsis: Retry a failed policy for an index specified in the query. + path: /_plugins/_ism/retry + method: POST + parameters: + index: books + request: + payload: + state: index + response: + status: 200 + payload: + updated_indices: 0 + failures: true + failed_indices: + - index_name: books + reason: This index is not being managed. + - synopsis: Retry a failed policy for an index specified in the path. + path: /_plugins/_ism/retry/{index} + method: POST + parameters: + index: books + request: + payload: + state: index + response: + status: 200 + payload: + updated_indices: 0 + failures: true + failed_indices: + - index_name: books + reason: This index is not being managed. +epilogues: + - path: /books + method: DELETE + status: [200, 404]