Module: Rundeck::Client::Execution
- Included in:
- Rundeck::Client
- Defined in:
- lib/rundeck/client/execution.rb
Overview
Defines methods related to executions.
Instance Method Summary collapse
-
#abort_execution(id, options = {}) ⇒ Rundeck::ObjectifiedHash
Abort a running execution.
-
#bulk_delete_executions(ids, options = {}) ⇒ Rundeck::ObjectifiedHash
Bulk delete executions.
-
#delete_execution(id, options = {}) ⇒ nil
Delete an execution.
-
#delete_job_executions(id, options = {}) ⇒ Rundeck::ObjectifiedHash
Delete all executions for a specific job.
-
#execute_job(id, options = {}) ⇒ Rundeck::ObjectifiedHash
(also: #run_job)
Execute a job.
-
#execution(id, options = {}) ⇒ Rundeck::ObjectifiedHash
Get info for an execution.
-
#execution_state(id, options = {}) ⇒ Rundeck::ObjectifiedHash
Get the state of an execution.
-
#job_executions(id, options = {}) ⇒ Rundeck::ObjectifiedHash
Get executions for a specific job.
Instance Method Details
#abort_execution(id, options = {}) ⇒ Rundeck::ObjectifiedHash
This method has optional Rundeck parameters that can be passed to the options parameter. See Rundeck API documentation for more information.
-
query: { param1: ‘value’, param2: ‘value’ }
Abort a running execution
116 117 118 |
# File 'lib/rundeck/client/execution.rb', line 116 def abort_execution(id, = {}) objectify post("/execution/#{id}/abort", )['abort'] end |
#bulk_delete_executions(ids, options = {}) ⇒ Rundeck::ObjectifiedHash
Bulk delete executions
146 147 148 149 150 151 152 153 154 |
# File 'lib/rundeck/client/execution.rb', line 146 def bulk_delete_executions(ids, = {}) unless ids.is_a?(Array) fail Rundeck::Error::InvalidAttributes, '`ids` must be an array of ids' end [:query] = {} if [:query].nil? [:query].merge!(ids: ids.join(',')) objectify post('/executions/delete', )['deleteExecutions'] end |
#delete_execution(id, options = {}) ⇒ nil
Delete an execution
100 101 102 |
# File 'lib/rundeck/client/execution.rb', line 100 def delete_execution(id, = {}) delete("/execution/#{id}", ) end |
#delete_job_executions(id, options = {}) ⇒ Rundeck::ObjectifiedHash
Delete all executions for a specific job
87 88 89 |
# File 'lib/rundeck/client/execution.rb', line 87 def delete_job_executions(id, = {}) objectify delete("/job/#{id}/executions", )['deleteExecutions'] end |
#execute_job(id, options = {}) ⇒ Rundeck::ObjectifiedHash Also known as: run_job
This method has optional Rundeck parameters that can be passed to the options parameter. See Rundeck API documentation for more information.
-
query: { param1: ‘value’, param2: ‘value’ }
Execute a job
21 22 23 |
# File 'lib/rundeck/client/execution.rb', line 21 def execute_job(id, = {}) objectify post("/job/#{id}/executions", )['result']['executions']['execution'] end |
#execution(id, options = {}) ⇒ Rundeck::ObjectifiedHash
Get info for an execution
132 133 134 |
# File 'lib/rundeck/client/execution.rb', line 132 def execution(id, = {}) objectify get("/execution/#{id}", )['result']['executions']['execution'] end |
#execution_state(id, options = {}) ⇒ Rundeck::ObjectifiedHash
Get the state of an execution
165 166 167 |
# File 'lib/rundeck/client/execution.rb', line 165 def execution_state(id, = {}) objectify get("/execution/#{id}/state", )['result']['executionState'] end |
#job_executions(id, options = {}) ⇒ Rundeck::ObjectifiedHash
This method has optional Rundeck parameters that can be passed to the options parameter. See Rundeck API documentation for more information.
-
query: { param1: ‘value’, param2: ‘value’ }
Get executions for a specific job.
41 42 43 44 |
# File 'lib/rundeck/client/execution.rb', line 41 def job_executions(id, = {}) r = get("/job/#{id}/executions", )['result']['executions']['execution'] objectify r end |