Class: Opsmgr::Api::InstallationSettingsResult

Inherits:
Result
  • Object
show all
Defined in:
lib/opsmgr/api/results.rb

Instance Attribute Summary

Attributes inherited from Result

#message

Instance Method Summary collapse

Methods inherited from Result

#success?

Constructor Details

#initialize(install_hash) ⇒ InstallationSettingsResult

Returns a new instance of InstallationSettingsResult.



100
101
102
# File 'lib/opsmgr/api/results.rb', line 100

def initialize(install_hash)
  @install_hash = install_hash
end

Instance Method Details

#apps_domainObject



137
138
139
140
141
142
# File 'lib/opsmgr/api/results.rb', line 137

def apps_domain
  properties = cc_job.fetch('properties')
  property_list = Opsmgr::Settings::Microbosh::PropertyList.new(properties)
  credential_property = property_list.find { |property| property.name == 'apps_domain' }
  credential_property.fetch('value')
end

#as_hashObject



160
161
162
# File 'lib/opsmgr/api/results.rb', line 160

def as_hash
  install_hash
end

#director_ipObject



104
105
106
107
108
# File 'lib/opsmgr/api/results.rb', line 104

def director_ip
  ips = microbosh_settings.fetch('ips')
  _, director_ips = ips.each_pair.find { |ip_key, _| ip_key =~ /^director-/ }
  director_ips.first
end

#director_passwordObject



110
111
112
113
114
115
116
117
118
# File 'lib/opsmgr/api/results.rb', line 110

def director_password
  microbosh_jobs = microbosh_settings.fetch('jobs')
  microbosh_job_list = Opsmgr::Settings::Microbosh::JobList.new(microbosh_jobs)
  director_job = microbosh_job_list.find { |job| job.name == 'director' }
  properties = director_job.fetch('properties')
  property_list = Opsmgr::Settings::Microbosh::PropertyList.new(properties)
  credential_property = property_list.find { |property| property.name == 'director_credentials' }
  credential_property.fetch('value').fetch('password')
end

#ops_manager_installation_settingsObject



156
157
158
# File 'lib/opsmgr/api/results.rb', line 156

def ops_manager_installation_settings
  Opsmgr::Settings::Microbosh::InstallationSettings.from_api_result(self)
end

#product_version(product_guid) ⇒ Object



144
145
146
147
148
# File 'lib/opsmgr/api/results.rb', line 144

def product_version(product_guid)
  product = products.find { |p| p.guid == product_guid }
  return nil if product.nil?
  product.fetch('product_version')
end

#product_version_by_name(product_name) ⇒ Object



150
151
152
153
154
# File 'lib/opsmgr/api/results.rb', line 150

def product_version_by_name(product_name)
  product = products.find { |p| p.name == product_name }
  return nil if product.nil?
  product.fetch('product_version')
end

#system_domainObject



130
131
132
133
134
135
# File 'lib/opsmgr/api/results.rb', line 130

def system_domain
  properties = cc_job.fetch('properties')
  property_list = Opsmgr::Settings::Microbosh::PropertyList.new(properties)
  credential_property = property_list.find { |property| property.name == 'system_domain' }
  credential_property.fetch('value')
end

#uaa_admin_passwordObject



120
121
122
123
124
125
126
127
128
# File 'lib/opsmgr/api/results.rb', line 120

def uaa_admin_password
  jobs = cf_settings.fetch('jobs')
  job_list = Opsmgr::Settings::Microbosh::JobList.new(jobs)
  uaa_job = job_list.find { |job| job.name == 'uaa' }
  properties = uaa_job.fetch('properties')
  property_list = Opsmgr::Settings::Microbosh::PropertyList.new(properties)
  credential_property = property_list.find { |property| property.name == 'admin_credentials' }
  credential_property.fetch('value').fetch('password')
end