Skip to content

Commit

Permalink
Fixed/added ISM APIs. (#568)
Browse files Browse the repository at this point in the history
  • Loading branch information
dblock authored Sep 13, 2024
1 parent 584d525 commit c2c666f
Show file tree
Hide file tree
Showing 10 changed files with 915 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- 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))

### Changed

Expand Down Expand Up @@ -154,6 +155,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Fixed `geo_distance` query spec ([#561](https://github.com/opensearch-project/opensearch-api-specification/pull/561))
- Fixed `geo_bounding_box` and `geo_shape` queries ([#531](https://github.com/opensearch-project/opensearch-api-specification/pull/531))
- Fixed tasks namespace schemas ([#520](https://github.com/opensearch-project/opensearch-api-specification/pull/520))
- Fixed `/_plugins/_transform/_preview` ([#568](https://github.com/opensearch-project/opensearch-api-specification/pull/568))

### Security

Expand Down
229 changes: 229 additions & 0 deletions spec/namespaces/ism.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
openapi: 3.1.0
info:
title: OpenSearch ISM API
description: Use the index state management operations to programmatically work with policies and managed indexes.
version: 1.0.0
paths:
/_plugins/_ism/policies/{policy_id}:
get:
operationId: ism.get_policy.0
x-operation-group: ism.get_policy
description: Gets the policy.
externalDocs:
url: https://opensearch.org/docs/latest/im-plugin/ism/api/#get-policy
parameters:
- $ref: '#/components/parameters/ism.get_policy::path.policy_id'
responses:
'200':
$ref: '#/components/responses/ism.get_policy@200'
put:
operationId: ism.put_policy.0
x-operation-group: ism.put_policy
description: Creates or updates a policy.
externalDocs:
url: https://opensearch.org/docs/latest/im-plugin/ism/api/#create-policy
parameters:
- $ref: '#/components/parameters/ism.put_policy::path.policy_id'
- $ref: '#/components/parameters/ism.put_policy::query.if_primary_term'
- $ref: '#/components/parameters/ism.put_policy::query.if_seq_no'
requestBody:
$ref: '#/components/requestBodies/ism.put_policy'
responses:
'201':
$ref: '#/components/responses/ism.put_policy@201'
'200':
$ref: '#/components/responses/ism.put_policy@200'
delete:
operationId: ism.delete_policy.0
x-operation-group: ism.delete_policy
description: Deletes a policy.
externalDocs:
url: https://opensearch.org/docs/latest/im-plugin/ism/api/#delete-policy
parameters:
- $ref: '#/components/parameters/ism.delete_policy::path.policy_id'
responses:
'200':
$ref: '#/components/responses/ism.delete_policy@200'
/_plugins/_ism/add/{index}:
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::path.index'
requestBody:
$ref: '#/components/requestBodies/ism.add_policy'
responses:
'200':
$ref: '#/components/responses/ism.add_policy@200'
/_plugins/_ism/remove/{index}:
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::path.index'
responses:
'200':
$ref: '#/components/responses/ism.remove_policy@200'
/_plugins/_ism/change_policy/{index}:
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::path.index'
requestBody:
$ref: '#/components/requestBodies/ism.change_policy'
responses:
'200':
$ref: '#/components/responses/ism.change_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.
externalDocs:
url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index
parameters:
- $ref: '#/components/parameters/ism.explain_index::path.index'
responses:
'200':
$ref: '#/components/responses/ism.explain_index@200'
components:
requestBodies:
ism.put_policy:
content:
application/json:
schema:
$ref: '../schemas/ism._common.yaml#/components/schemas/PutPolicyRequest'
ism.add_policy:
content:
application/json:
schema:
$ref: '../schemas/ism._common.yaml#/components/schemas/AddPolicyRequest'
ism.change_policy:
content:
application/json:
schema:
$ref: '../schemas/ism._common.yaml#/components/schemas/ChangePolicyRequest'
responses:
ism.get_policy@200:
content:
application/json:
schema:
$ref: '../schemas/ism._common.yaml#/components/schemas/GetPolicyResponse'
ism.put_policy@201:
content:
application/json:
schema:
$ref: '../schemas/ism._common.yaml#/components/schemas/PutPolicyResponse'
ism.put_policy@200:
content:
application/json:
schema:
$ref: '../schemas/ism._common.yaml#/components/schemas/PutPolicyResponse'
ism.delete_policy@200:
content:
application/json:
schema:
$ref: '../schemas/ism._common.yaml#/components/schemas/DeletePolicyResponse'
ism.add_policy@200:
content:
application/json:
schema:
$ref: '../schemas/ism._common.yaml#/components/schemas/AddPolicyResponse'
ism.remove_policy@200:
content:
application/json:
schema:
$ref: '../schemas/ism._common.yaml#/components/schemas/RemovePolicyResponse'
ism.change_policy@200:
content:
application/json:
schema:
$ref: '../schemas/ism._common.yaml#/components/schemas/ChangePolicyResponse'
ism.explain_index@200:
content:
application/json:
schema:
$ref: '../schemas/ism._common.yaml#/components/schemas/ExplainIndexResponse'
parameters:
ism.get_policy::path.policy_id:
name: policy_id
in: path
required: true
schema:
type: string
ism.put_policy::path.policy_id:
name: policy_id
in: path
required: true
schema:
type: string
ism.delete_policy::path.policy_id:
name: policy_id
in: path
required: true
schema:
type: string
ism.put_policy::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
ism.put_policy::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.add_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.remove_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.change_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.explain_index::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
14 changes: 13 additions & 1 deletion spec/namespaces/transforms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,30 @@ paths:
'200':
$ref: '#/components/responses/transforms.explain@200'
/_plugins/_transform/_preview:
get:
post:
operationId: transforms.preview.0
x-operation-group: transforms.preview
x-version-added: '1.0'
description: Returns a preview of what a transformed index would look like.
externalDocs:
url: https://opensearch.org/docs/latest/im-plugin/index-transforms/transforms-apis/#preview-a-transform-jobs-results
requestBody:
$ref: '#/components/requestBodies/transforms.preview'
responses:
'200':
$ref: '#/components/responses/transforms.preview@200'
components:
requestBodies:
transforms.preview:
content:
application/json:
schema:
type: object
properties:
transform:
$ref: '../schemas/transforms._common.yaml#/components/schemas/Transform'
required:
- transform
transforms.put:
content:
application/json:
Expand Down
Loading

0 comments on commit c2c666f

Please sign in to comment.