Acknowledge a watch

PUT /_watcher/watch/{watch_id}/_ack

Acknowledging a watch enables you to manually throttle the execution of the watch's actions.

The acknowledgement state of an action is stored in the status.actions.<id>.ack.state structure.

IMPORTANT: If the specified watch is currently being executed, this API will return an error The reason for this behavior is to prevent overwriting the watch status from a watch execution.

Acknowledging an action throttles further executions of that action until its ack.state is reset to awaits_successful_execution. This happens when the condition of the watch is not met (the condition evaluates to false).

Path parameters

  • watch_id string Required

    The watch identifier.

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • status object Required
      Hide status attributes Show status attributes object
      • actions object Required
        Hide actions attribute Show actions attribute object
        • * object Additional properties
          Hide * attributes Show * attributes object
          • ack object Required
            Hide ack attributes Show ack attributes object
            • state string Required

              Values are awaits_successful_execution, ackable, or acked.

            • timestamp string
          • last_execution object
            Hide last_execution attributes Show last_execution attributes object
            • successful boolean Required
            • timestamp string
            • reason string
          • last_successful_execution object
            Hide last_successful_execution attributes Show last_successful_execution attributes object
            • successful boolean Required
            • timestamp string
            • reason string
          • last_throttle object
            Hide last_throttle attributes Show last_throttle attributes object
            • reason string Required
            • timestamp string
      • last_checked string | number

        A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string representation.

        One of:

        Time unit for milliseconds

      • last_met_condition string | number

        A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string representation.

        One of:

        Time unit for milliseconds

      • state object Required
        Hide state attributes Show state attributes object
        • active boolean Required
        • timestamp string | number Required

          A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string representation.

          One of:

          Time unit for milliseconds

      • version number Required
      • execution_state string
PUT /_watcher/watch/{watch_id}/_ack
POST _watcher/watch/my_watch/_ack
curl \
 --request PUT 'http://api.example.com/_watcher/watch/{watch_id}/_ack' \
 --header "Authorization: $API_KEY"
Response examples (200)
A successful response from `POST _watcher/watch/my_watch/_ack`.
{
  "status": {
    "state": {
      "active": true,
      "timestamp": "2015-05-26T18:04:27.723Z"
    },
    "last_checked": "2015-05-26T18:04:27.753Z",
    "last_met_condition": "2015-05-26T18:04:27.763Z",
    "actions": {
      "test_index": {
        "ack" : {
          "timestamp": "2015-05-26T18:04:27.713Z",
          "state": "acked"
        },
        "last_execution" : {
          "timestamp": "2015-05-25T18:04:27.733Z",
          "successful": true
        },
        "last_successful_execution" : {
          "timestamp": "2015-05-25T18:04:27.773Z",
          "successful": true
        }
      }
    },
    "execution_state": "executed",
    "version": 2
  }
}