Merge branch 'opensearch-project:main' into docs_cn
This commit is contained in:
commit
9c862788b0
|
@ -39,7 +39,7 @@ You can use the visual editor or JSON editor to create policies. Compared to the
|
||||||
2. Choose **Create policy**.
|
2. Choose **Create policy**.
|
||||||
3. Choose **Visual editor**.
|
3. Choose **Visual editor**.
|
||||||
4. In the **Policy info** section, enter a policy ID and an optional description.
|
4. In the **Policy info** section, enter a policy ID and an optional description.
|
||||||
5. In the **Error notification** section, set up an optional error notification that gets sent whenever a policy execution fails. For more information, see [Error notifications]({{site.url}}{{site.baseurl}}/im-plugin/ism/policies#error-notifications).
|
5. In the **Error notification** section, set up an optional error notification that gets sent whenever a policy execution fails. For more information, see [Error notifications]({{site.url}}{{site.baseurl}}/im-plugin/ism/policies#error-notifications). If you're using auto rollovers in your policy, we recommend setting up error notifications, which notify you of unexpectedly large indices if rollovers fail.
|
||||||
6. In **ISM templates**, enter any ISM template patterns to automatically apply this policy to existing and future indices. For example, if you specify a template of `sample-index*`, the ISM plugin automatically applies this policy to any indices whose names start with `sample-index`.
|
6. In **ISM templates**, enter any ISM template patterns to automatically apply this policy to existing and future indices. For example, if you specify a template of `sample-index*`, the ISM plugin automatically applies this policy to any indices whose names start with `sample-index`.
|
||||||
7. In **States**, add any states you want to include in the policy. Each state has [actions]({{site.url}}{{site.baseurl}}/im-plugin/ism/policies/#actions) the plugin executes when the index enters a certain state, and [transitions]({{site.url}}{{site.baseurl}}/im-plugin/ism/policies/#transitions), which have conditions that, when met, transition the index into a destination state. The first state you create in a policy is automatically set as the initial state. Each policy must have at least one state, but actions and transitions are optional.
|
7. In **States**, add any states you want to include in the policy. Each state has [actions]({{site.url}}{{site.baseurl}}/im-plugin/ism/policies/#actions) the plugin executes when the index enters a certain state, and [transitions]({{site.url}}{{site.baseurl}}/im-plugin/ism/policies/#transitions), which have conditions that, when met, transition the index into a destination state. The first state you create in a policy is automatically set as the initial state. Each policy must have at least one state, but actions and transitions are optional.
|
||||||
8. Choose **Create**.
|
8. Choose **Create**.
|
||||||
|
@ -76,7 +76,7 @@ PUT _plugins/_ism/policies/policy_id
|
||||||
|
|
||||||
If you have more than one template that matches an index pattern, ISM uses the priority value to determine which template to apply.
|
If you have more than one template that matches an index pattern, ISM uses the priority value to determine which template to apply.
|
||||||
|
|
||||||
For an example ISM template policy, see [Sample policy with ISM template]({{site.url}}{{site.baseurl}}/im-plugin/ism/policies#sample-policy-with-ism-template).
|
For an example ISM template policy, see [Sample policy with ISM template for auto rollover]({{site.url}}{{site.baseurl}}/im-plugin/ism/policies#sample-policy-with-ism-template-for-auto-rollover).
|
||||||
|
|
||||||
Older versions of the plugin include the `policy_id` in an index template, so when an index is created that matches the index template pattern, the index will have the policy attached to it:
|
Older versions of the plugin include the `policy_id` in an index template, so when an index is created that matches the index template pattern, the index will have the policy attached to it:
|
||||||
|
|
||||||
|
|
|
@ -517,10 +517,12 @@ The destination system **must** return a response otherwise the `error_notificat
|
||||||
|
|
||||||
You can use the same options for `ctx` variables as the [notification](#notification) operation.
|
You can use the same options for `ctx` variables as the [notification](#notification) operation.
|
||||||
|
|
||||||
## Sample policy with ISM template
|
## Sample policy with ISM template for auto rollover
|
||||||
|
|
||||||
The following sample template policy is for a rollover use case.
|
The following sample template policy is for a rollover use case.
|
||||||
|
|
||||||
|
If you want to skip rollovers for an index, use the [update cluster settings API]({{site.url}}{{site.baseurl}}/opensearch/configuration/#update-cluster-settings-using-the-api) to set `index.plugins.index_state_management.rollover_skip` to true.
|
||||||
|
|
||||||
1. Create a policy with an `ism_template` field:
|
1. Create a policy with an `ism_template` field:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
---
|
||||||
|
layout: default
|
||||||
|
title: Close index
|
||||||
|
parent: Index APIs
|
||||||
|
grand_parent: REST API reference
|
||||||
|
nav_order: 30
|
||||||
|
---
|
||||||
|
|
||||||
|
# Close index
|
||||||
|
Introduced 1.0
|
||||||
|
{: .label .label-purple }
|
||||||
|
|
||||||
|
The close index API operation closes an index. Once an index is closed, you cannot add data to it or search for any data within the index.
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```json
|
||||||
|
POST /sample-index/_close
|
||||||
|
```
|
||||||
|
|
||||||
|
## Path and HTTP methods
|
||||||
|
|
||||||
|
```
|
||||||
|
POST /<index-name>/_close
|
||||||
|
```
|
||||||
|
|
||||||
|
## URL parameters
|
||||||
|
|
||||||
|
All parameters are optional.
|
||||||
|
|
||||||
|
Parameter | Type | Description
|
||||||
|
:--- | :--- | :---
|
||||||
|
<index-name> | String | The index to close. Can be a comma-separated list of multiple index names. Use `_all` or * to close all indices.
|
||||||
|
allow_no_indices | Boolean | Whether to ignore wildcards that don't match any indices. Default is true.
|
||||||
|
expand_wildcards | String | Expands wildcard expressions to different indices. Combine multiple values with commas. Available values are all (match all indices), open (match open indices), closed (match closed indices), hidden (match hidden indices), and none (do not accept wildcard expressions). Default is open.
|
||||||
|
ignore_unavailable | Boolean | If true, OpenSearch does not search for missing or closed indices. Default is false.
|
||||||
|
wait_for_active_shards | String | Specifies the number of active shards that must be available before OpenSearch processes the request. Default is 1 (only the primary shard). Set to all or a positive integer. Values greater than 1 require replicas. For example, if you specify a value of 3, the index must have two replicas distributed across two additional nodes for the request to succeed.
|
||||||
|
master_timeout | Time | How long to wait for a connection to the master node. Default is `30s`.
|
||||||
|
timeout | Time | How long to wait for a response from the cluster. Default is `30s`.
|
||||||
|
|
||||||
|
|
||||||
|
## Response
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"acknowledged": true,
|
||||||
|
"shards_acknowledged": true,
|
||||||
|
"indices": {
|
||||||
|
"sample-index1": {
|
||||||
|
"closed": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
|
@ -3,7 +3,7 @@ layout: default
|
||||||
title: Delete index
|
title: Delete index
|
||||||
parent: Index APIs
|
parent: Index APIs
|
||||||
grand_parent: REST API reference
|
grand_parent: REST API reference
|
||||||
nav_order: 5
|
nav_order: 10
|
||||||
---
|
---
|
||||||
|
|
||||||
# Delete index
|
# Delete index
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
---
|
||||||
|
layout: default
|
||||||
|
title: Index exists
|
||||||
|
parent: Index APIs
|
||||||
|
grand_parent: REST API reference
|
||||||
|
nav_order: 5
|
||||||
|
---
|
||||||
|
|
||||||
|
# Index exists
|
||||||
|
Introduced 1.0
|
||||||
|
{: .label .label-purple }
|
||||||
|
|
||||||
|
The index exists API operation returns whether or not an index already exists.
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```json
|
||||||
|
HEAD /sample-index
|
||||||
|
```
|
||||||
|
|
||||||
|
## Path and HTTP methods
|
||||||
|
|
||||||
|
```
|
||||||
|
HEAD /<index-name>
|
||||||
|
```
|
||||||
|
|
||||||
|
## URL parameters
|
||||||
|
|
||||||
|
All parameters are optional.
|
||||||
|
|
||||||
|
Parameter | Type | Description
|
||||||
|
:--- | :--- | :---
|
||||||
|
allow_no_indices | Boolean | Whether to ignore wildcards that don't match any indices. Default is true.
|
||||||
|
expand_wildcards | String | Expands wildcard expressions to different indices. Combine multiple values with commas. Available values are all (match all indices), open (match open indices), closed (match closed indices), hidden (match hidden indices), and none (do not accept wildcard expressions). Default is open.
|
||||||
|
flat_settings | Boolean | Whether to return settings in the flat form, which can improve readability, especially for heavily nested settings. For example, the flat form of "index": { "creation_date": "123456789" } is "index.creation_date": "123456789".
|
||||||
|
include_defaults | Boolean | Whether to include default settings as part of the response. This parameter is useful for identifying the names and current values of settings you want to update.
|
||||||
|
ignore_unavailable | Boolean | If true, OpenSearch does not search for missing or closed indices. Default is false.
|
||||||
|
local | Boolean | Whether to return information from only the local node instead of from the master node. Default is false.
|
||||||
|
|
||||||
|
|
||||||
|
## Response
|
||||||
|
|
||||||
|
The index exists API operation returns only one of two possible response codes: `200` -- the index exists, and `404` -- the index does not exist.
|
|
@ -3,7 +3,7 @@ layout: default
|
||||||
title: Get index
|
title: Get index
|
||||||
parent: Index APIs
|
parent: Index APIs
|
||||||
grand_parent: REST API reference
|
grand_parent: REST API reference
|
||||||
nav_order: 10
|
nav_order: 20
|
||||||
---
|
---
|
||||||
|
|
||||||
# Get index
|
# Get index
|
||||||
|
|
Loading…
Reference in New Issue