Class: Opsmgr::Api::InstallationSettingsResult
- Defined in:
- lib/opsmgr/api/results.rb
Instance Attribute Summary
Attributes inherited from Result
Instance Method Summary collapse
- #apps_domain ⇒ Object
- #as_hash ⇒ Object
- #director_ip ⇒ Object
- #director_password ⇒ Object
-
#initialize(install_hash) ⇒ InstallationSettingsResult
constructor
A new instance of InstallationSettingsResult.
- #ops_manager_installation_settings ⇒ Object
- #product_version(product_guid) ⇒ Object
- #product_version_by_name(product_name) ⇒ Object
- #system_domain ⇒ Object
- #uaa_admin_password ⇒ Object
Methods inherited from Result
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_domain ⇒ Object
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_hash ⇒ Object
160 161 162 |
# File 'lib/opsmgr/api/results.rb', line 160 def as_hash install_hash end |
#director_ip ⇒ Object
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_password ⇒ Object
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_settings ⇒ Object
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_domain ⇒ Object
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_password ⇒ Object
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 |