Class: Rundeck::Client

Inherits:
API show all
Includes:
Execution, Job, Key
Defined in:
lib/rundeck/client.rb,
lib/rundeck/client/job.rb,
lib/rundeck/client/key.rb,
lib/rundeck/client/execution.rb

Overview

Wrapper for the Rundeck REST API.

Defined Under Namespace

Modules: Execution, Job, Key

Instance Attribute Summary

Attributes inherited from Request

#api_token

Instance Method Summary collapse

Methods included from Key

#create_private_key, #create_public_key, #delete_key, #key_contents, #key_metadata, #keys, #update_private_key, #update_public_key

Methods included from Job

#delete_job, #export_jobs, #import_jobs, #job, #jobs

Methods included from Execution

#abort_execution, #bulk_delete_executions, #delete_execution, #delete_job_executions, #execute_job, #execution, #execution_state, #job_executions

Methods inherited from API

#initialize

Methods inherited from Request

#delete, #get, #post, #put, #set_request_defaults, #validate

Constructor Details

This class inherits a constructor from Rundeck::API

Instance Method Details

#objectify(result) ⇒ Rundeck::ObjectifiedHash

Note:

This method will objectify nested hashes/arrays.

Turn a hash into an object for easy accessibility.

Parameters:

  • result (Hash, Array)

    An array or hash of results to turn into an object

Returns:

Raises:



67
68
69
70
71
72
73
74
75
76
77
# File 'lib/rundeck/client.rb', line 67

def objectify(result)
  if result.is_a?(Hash)
    ObjectifiedHash.new(result)
  elsif result.is_a?(Array)
    result.map! { |e| ObjectifiedHash.new(e) }
  elsif result.nil?
    nil
  else
    fail Error::Parsing, "Couldn't parse a response body"
  end
end