Class: DTK::Client::JenkinsClient::Connection

Inherits:
Hash
  • Object
show all
Defined in:
lib/command_helpers/jenkins_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection_hash) ⇒ Connection

Returns a new instance of Connection.



71
72
73
74
75
# File 'lib/command_helpers/jenkins_client.rb', line 71

def initialize(connection_hash)
  super()
  merge!(connection_hash)
  set_connection()
end

Instance Method Details

#create_job(job_name, config_xml_contents) ⇒ Object



76
77
78
# File 'lib/command_helpers/jenkins_client.rb', line 76

def create_job(job_name,config_xml_contents)
  ::Jenkins::Client::Job.create(job_name, config_xml_contents)
end

#get_infoObject



80
81
82
# File 'lib/command_helpers/jenkins_client.rb', line 80

def get_info()
  get('api/json')
end

#get_jobsObject



84
85
86
# File 'lib/command_helpers/jenkins_client.rb', line 84

def get_jobs()
  get_info()["jobs"]
end