in elasticsearch-api/lib/elasticsearch/api/actions/watcher/ack_watch.rb [50:81]
def ack_watch(arguments = {})
request_opts = { endpoint: arguments[:endpoint] || 'watcher.ack_watch' }
defined_params = [:watch_id, :action_id].each_with_object({}) do |variable, set_variables|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
end
request_opts[:defined_params] = defined_params unless defined_params.empty?
raise ArgumentError, "Required argument 'watch_id' missing" unless arguments[:watch_id]
arguments = arguments.clone
headers = arguments.delete(:headers) || {}
body = nil
_watch_id = arguments.delete(:watch_id)
_action_id = arguments.delete(:action_id)
method = Elasticsearch::API::HTTP_PUT
path = if _watch_id && _action_id
"_watcher/watch/#{Utils.listify(_watch_id)}/_ack/#{Utils.listify(_action_id)}"
else
"_watcher/watch/#{Utils.listify(_watch_id)}/_ack"
end
params = Utils.process_params(arguments)
Elasticsearch::API::Response.new(
perform_request(method, path, params, body, headers, request_opts)
)
end