ISM Error Prevention API
The ISM Error Prevention API allows you to enable Index State Management (ISM) error prevention and check the validation status and message.
Enable error prevention validation
You can configure error prevention validation by setting the plugins.index_state_management.action_validation.enabled parameter.
Example request
PUT _cluster/settings
{
"persistent":{
"plugins.index_state_management.action_validation.enabled": true
}
}
Example response
{
"acknowledged" : true,
"persistent" : {
"plugins" : {
"index_state_management" : {
"action_validation" : {
"enabled" : "true"
}
}
}
},
"transient" : { }
}
Check validation status and message using the Explain API
Pass the validate_action=true path parameter in the Explain API URI to view the validation status and message.
Example request
GET _plugins/_ism/explain/test-000001?validate_action=true
Example response
{
"test-000001" : {
"index.plugins.index_state_management.policy_id" : "test_rollover",
"index.opendistro.index_state_management.policy_id" : "test_rollover",
"index" : "test-000001",
"index_uuid" : "CgKsxFmQSIa8dWqpbSJmyA",
"policy_id" : "test_rollover",
"policy_seq_no" : -2,
"policy_primary_term" : 0,
"rolled_over" : false,
"index_creation_date" : 1667410460649,
"state" : {
"name" : "rollover",
"start_time" : 1667410766045
},
"action" : {
"name" : "rollover",
"start_time" : 1667411127803,
"index" : 0,
"failed" : false,
"consumed_retries" : 0,
"last_retry_time" : 0
},
"step" : {
"name" : "attempt_rollover",
"start_time" : 1667411127803,
"step_status" : "starting"
},
"retry_info" : {
"failed" : true,
"consumed_retries" : 0
},
"info" : {
"message" : "Previous action was not able to update IndexMetaData."
},
"enabled" : false,
"validate" : {
"validation_message" : "Missing rollover_alias index setting [index=test-000001]",
"validation_status" : "re_validating"
}
},
"total_managed_indices" : 1
}
The validation status and message are returned only when you pass validate_action=true. Setting the parameter to false or omitting it returns neither.
Example request
GET _plugins/_ism/explain/test-000001?validate_action=false
Omitting the parameter has the same result:
GET _plugins/_ism/explain/test-000001
Example response
{
"test-000001" : {
"index.plugins.index_state_management.policy_id" : "test_rollover",
"index.opendistro.index_state_management.policy_id" : "test_rollover",
"index" : "test-000001",
"index_uuid" : "CgKsxFmQSIa8dWqpbSJmyA",
"policy_id" : "test_rollover",
"policy_seq_no" : -2,
"policy_primary_term" : 0,
"rolled_over" : false,
"index_creation_date" : 1667410460649,
"state" : {
"name" : "rollover",
"start_time" : 1667410766045
},
"action" : {
"name" : "rollover",
"start_time" : 1667411127803,
"index" : 0,
"failed" : false,
"consumed_retries" : 0,
"last_retry_time" : 0
},
"step" : {
"name" : "attempt_rollover",
"start_time" : 1667411127803,
"step_status" : "starting"
},
"retry_info" : {
"failed" : true,
"consumed_retries" : 0
},
"info" : {
"message" : "Previous action was not able to update IndexMetaData."
},
"enabled" : false
},
"total_managed_indices" : 1
}