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.validation_service.enabled parameter.

Example request

  1. PUT _cluster/settings
  2. {
  3. "persistent":{
  4. "plugins.index_state_management.validation_action.enabled": true
  5. }
  6. }

Example response

  1. {
  2. "acknowledged" : true,
  3. "persistent" : {
  4. "plugins" : {
  5. "index_state_management" : {
  6. "validation_action" : {
  7. "enabled" : "true"
  8. }
  9. }
  10. }
  11. },
  12. "transient" : { }
  13. }

Check validation status and message via the Explain API

Pass the validate_action=true path parameter in the Explain API URI to see the validation status and message.

Example request

  1. GET _plugins/_ism/explain/test-000001?validate_action=true

Example response

  1. {
  2. "test-000001" : {
  3. "index.plugins.index_state_management.policy_id" : "test_rollover",
  4. "index.opendistro.index_state_management.policy_id" : "test_rollover",
  5. "index" : "test-000001",
  6. "index_uuid" : "CgKsxFmQSIa8dWqpbSJmyA",
  7. "policy_id" : "test_rollover",
  8. "policy_seq_no" : -2,
  9. "policy_primary_term" : 0,
  10. "rolled_over" : false,
  11. "index_creation_date" : 1667410460649,
  12. "state" : {
  13. "name" : "rollover",
  14. "start_time" : 1667410766045
  15. },
  16. "action" : {
  17. "name" : "rollover",
  18. "start_time" : 1667411127803,
  19. "index" : 0,
  20. "failed" : false,
  21. "consumed_retries" : 0,
  22. "last_retry_time" : 0
  23. },
  24. "step" : {
  25. "name" : "attempt_rollover",
  26. "start_time" : 1667411127803,
  27. "step_status" : "starting"
  28. },
  29. "retry_info" : {
  30. "failed" : true,
  31. "consumed_retries" : 0
  32. },
  33. "info" : {
  34. "message" : "Previous action was not able to update IndexMetaData."
  35. },
  36. "enabled" : false,
  37. "validate" : {
  38. "validation_message" : "Missing rollover_alias index setting [index=test-000001]",
  39. "validation_status" : "re_validating"
  40. }
  41. },
  42. "total_managed_indices" : 1
  43. }

If you pass the parameter without a value or false, then it doesn’t return the validation status and message. Only if you pass validate_action=true will the response will return the validation status and message.

Example request

  1. GET _plugins/_ism/explain/test-000001?validate_action=false
  2. --- OR ---
  3. GET _plugins/_ism/explain/test-000001

Example response

  1. {
  2. "test-000001" : {
  3. "index.plugins.index_state_management.policy_id" : "test_rollover",
  4. "index.opendistro.index_state_management.policy_id" : "test_rollover",
  5. "index" : "test-000001",
  6. "index_uuid" : "CgKsxFmQSIa8dWqpbSJmyA",
  7. "policy_id" : "test_rollover",
  8. "policy_seq_no" : -2,
  9. "policy_primary_term" : 0,
  10. "rolled_over" : false,
  11. "index_creation_date" : 1667410460649,
  12. "state" : {
  13. "name" : "rollover",
  14. "start_time" : 1667410766045
  15. },
  16. "action" : {
  17. "name" : "rollover",
  18. "start_time" : 1667411127803,
  19. "index" : 0,
  20. "failed" : false,
  21. "consumed_retries" : 0,
  22. "last_retry_time" : 0
  23. },
  24. "step" : {
  25. "name" : "attempt_rollover",
  26. "start_time" : 1667411127803,
  27. "step_status" : "starting"
  28. },
  29. "retry_info" : {
  30. "failed" : true,
  31. "consumed_retries" : 0
  32. },
  33. "info" : {
  34. "message" : "Previous action was not able to update IndexMetaData."
  35. },
  36. "enabled" : false
  37. },
  38. "total_managed_indices" : 1
  39. }