module Elasticsearch::API::Watcher::Actions

Public Instance Methods

ack_watch(arguments={}) click to toggle source

Throttle the execution of the watch by acknowledging it

@option arguments [String] :id Watch ID (Required)

@see www.elastic.co/guide/en/watcher/current/appendix-api-ack-watch.html

# File lib/elasticsearch/watcher/api/actions/ack_watch.rb, line 12
def ack_watch(arguments={})
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
  valid_params = [
    :master_timeout
  ]
  method = 'PUT'
  path   = "_watcher/watch/#{arguments[:id]}/_ack"
  params = {}
  body   = nil

  perform_request(method, path, params, body).body
end
delete_watch(arguments={}) click to toggle source

Delete a specific watch

@option arguments [String] :id Watch ID (Required) @option arguments [Boolean] :force Ignore any locks on the watch and force the execution

@see www.elastic.co/guide/en/watcher/current/appendix-api-delete-watch.html

# File lib/elasticsearch/watcher/api/actions/delete_watch.rb, line 13
def delete_watch(arguments={})
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
  valid_params = [
    :master_timeout,
    :force
  ]
  method = 'DELETE'
  path   = "_watcher/watch/#{arguments[:id]}"
  params = {}
  body   = nil

  perform_request(method, path, params, body).body
end
execute_watch(arguments={}) click to toggle source

Force the execution of the watch actions (eg. for testing)

@option arguments [String] :id Watch ID (Required) @option arguments [Hash] :body Execution control

@see www.elastic.co/guide/en/watcher/current/appendix-api-execute-watch.html

# File lib/elasticsearch/watcher/api/actions/execute_watch.rb, line 13
def execute_watch(arguments={})
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
  valid_params = [
     ]
  method = 'PUT'
  path   = "_watcher/watch/#{arguments[:id]}/_execute"
  params = {}
  body   = arguments[:body]

  perform_request(method, path, params, body).body
end
get_watch(arguments={}) click to toggle source

Get a specific watch

@option arguments [String] :id Watch ID (Required)

@see www.elastic.co/guide/en/watcher/current/appendix-api-get-watch.html

# File lib/elasticsearch/watcher/api/actions/get_watch.rb, line 12
def get_watch(arguments={})
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
  valid_params = [
     ]
  method = 'GET'
  path   = "_watcher/watch/#{arguments[:id]}"
  params = {}
  body   = nil

  perform_request(method, path, params, body).body
rescue Exception => e
  # NOTE: Use exception name, not full class in Elasticsearch::Client to allow client plugability
  if Array(arguments[:ignore]).include?(404) && e.class.to_s =~ /NotFound/; false
  else raise(e)
  end
end
info(arguments={}) click to toggle source

Return information about the installed Watcher plugin

@see www.elastic.co/guide/en/watcher/current/appendix-api-info.html

# File lib/elasticsearch/watcher/api/actions/info.rb, line 10
def info(arguments={})
  valid_params = [
     ]
  method = 'GET'
  path   = "/_watcher/"
  params = {}
  body   = nil

  perform_request(method, path, params, body).body
end
put_watch(arguments={}) click to toggle source

Create a new watch or update an existing one

@option arguments [String] :id Watch ID (Required) @option arguments [Hash] :body The watch (Required) @option arguments [Boolean] :pretty Pretty the output

@see www.elastic.co/guide/en/watcher/current/appendix-api-put-watch.html

# File lib/elasticsearch/watcher/api/actions/put_watch.rb, line 14
def put_watch(arguments={})
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  valid_params = [
    :master_timeout ]
  method = 'PUT'
  path   = "_watcher/watch/#{arguments[:id]}"
  params = Utils.__validate_and_extract_params arguments, valid_params
  body   = arguments[:body]

  perform_request(method, path, params, body).body
end
restart(arguments={}) click to toggle source

Restart the watcher service

@see www.elastic.co/guide/en/watcher/current/appendix-api-service.html

# File lib/elasticsearch/watcher/api/actions/restart.rb, line 11
def restart(arguments={})
  valid_params = [
     ]
  method = 'PUT'
  path   = "/_watcher/_restart"
  params = {}
  body   = nil

  perform_request(method, path, params, body).body
end
start(arguments={}) click to toggle source

Start the watcher service

@see www.elastic.co/guide/en/watcher/current/appendix-api-service.html

# File lib/elasticsearch/watcher/api/actions/start.rb, line 10
def start(arguments={})
  valid_params = [
     ]
  method = 'PUT'
  path   = "/_watcher/_start"
  params = {}
  body   = nil

  perform_request(method, path, params, body).body
end
stats(arguments={}) click to toggle source

Return statistical information about the watcher service

@see www.elastic.co/guide/en/watcher/current/appendix-api-stats.html

# File lib/elasticsearch/watcher/api/actions/stats.rb, line 10
def stats(arguments={})
  valid_params = [
     ]
  method = 'GET'
  path   = "/_watcher/stats"
  params = {}
  body   = nil

  perform_request(method, path, params, body).body
end
stop(arguments={}) click to toggle source

Stop the watcher service

@see www.elastic.co/guide/en/watcher/current/appendix-api-service.html

# File lib/elasticsearch/watcher/api/actions/stop.rb, line 10
def stop(arguments={})
  valid_params = [
     ]
  method = 'PUT'
  path   = "/_watcher/_stop"
  params = {}
  body   = nil

  perform_request(method, path, params, body).body
end