Class: Opsmgr::Settings::Microbosh::Job
- Inherits:
-
Object
- Object
- Opsmgr::Settings::Microbosh::Job
- Defined in:
- lib/opsmgr/settings/microbosh/job.rb
Instance Method Summary collapse
- #elb_name=(name) ⇒ Object
-
#initialize(job_hash) ⇒ Job
constructor
A new instance of Job.
- #instances=(instance_count) ⇒ Object
- #name ⇒ Object
- #networks=(networks) ⇒ Object
- #property(property_name) ⇒ Object
- #resource(resource_name) ⇒ Object
Constructor Details
#initialize(job_hash) ⇒ Job
Returns a new instance of Job.
7 8 9 |
# File 'lib/opsmgr/settings/microbosh/job.rb', line 7 def initialize(job_hash) @job_hash = job_hash end |
Instance Method Details
#elb_name=(name) ⇒ Object
27 28 29 |
# File 'lib/opsmgr/settings/microbosh/job.rb', line 27 def elb_name=(name) job_hash['elb_name'] = name end |
#instances=(instance_count) ⇒ Object
31 32 33 34 |
# File 'lib/opsmgr/settings/microbosh/job.rb', line 31 def instances=(instance_count) job_hash['instances'].first['value'] = instance_count job_hash.delete('partitions') end |
#name ⇒ Object
11 12 13 |
# File 'lib/opsmgr/settings/microbosh/job.rb', line 11 def name job_hash.fetch('identifier') rescue job_hash.fetch('type') end |
#networks=(networks) ⇒ Object
23 24 25 |
# File 'lib/opsmgr/settings/microbosh/job.rb', line 23 def networks=(networks) job_hash['network_references'] = networks end |
#property(property_name) ⇒ Object
15 16 17 |
# File 'lib/opsmgr/settings/microbosh/job.rb', line 15 def property(property_name) properties('properties').find { |property| property.name == property_name } end |
#resource(resource_name) ⇒ Object
19 20 21 |
# File 'lib/opsmgr/settings/microbosh/job.rb', line 19 def resource(resource_name) properties('resources').find { |resource| resource.name == resource_name } end |