Class: Onering::API::AutomationJobs

Inherits:
Onering::API show all
Defined in:
lib/onering/plugins/automation.rb

Overview


Constant Summary

Constants inherited from Onering::API

DEFAULT_BASE, DEFAULT_CLIENT_KEY, DEFAULT_CLIENT_PEM, DEFAULT_PATH, DEFAULT_VALIDATION_PEM

Constants included from Util

Util::HTTP_STATUS_CODES

Instance Attribute Summary

Attributes inherited from Onering::API

#url

Instance Method Summary collapse

Methods inherited from Onering::API

#_default_param, #_setup_auth, #_setup_auth_token, #connect, #delete, #get, #initialize, #method_missing, #post, #put, #request, #status

Methods included from Util

#fact, #gem_path, #http_status, #make_filter

Constructor Details

This class inherits a constructor from Onering::API

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Onering::API

Instance Method Details

#listObject



36
37
38
# File 'lib/onering/plugins/automation.rb', line 36

def list()
  get("/automation/jobs/list").parsed_response
end

#requests_waiting(name) ⇒ Object



44
45
46
# File 'lib/onering/plugins/automation.rb', line 44

def requests_waiting(name)
  get("/automation/jobs/#{name}/waiting").parsed_response
end

#run(name, options = {}, &block) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
# File 'lib/onering/plugins/automation.rb', line 48

def run(name, options={}, &block)
  if block_given?
    post("/automation/jobs/#{name}/run", {
      :query => options
    }, &block).parsed_response
  else
    get("/automation/jobs/#{name}/run", {
      :query => options
    }).parsed_response
  end
end

#show(name) ⇒ Object



40
41
42
# File 'lib/onering/plugins/automation.rb', line 40

def show(name)
  get("/automation/jobs/#{name}").parsed_response
end