Class: Bosh::Director::DeploymentPlan::ResourcePool
- Includes:
- ValidationHelper
- Defined in:
- lib/bosh/director/deployment_plan/resource_pool.rb
Instance Attribute Summary collapse
-
#cloud_properties ⇒ Hash
readonly
Cloud properties.
-
#env ⇒ Hash
readonly
Resource pool environment.
-
#name ⇒ String
readonly
Resource pool name.
-
#stemcell ⇒ DeploymentPlan::Stemcell
readonly
Stemcell spec.
Instance Method Summary collapse
-
#initialize(spec) ⇒ ResourcePool
constructor
A new instance of ResourcePool.
-
#spec ⇒ Hash
Returns resource pools spec as Hash (usually for agent to serialize).
Methods included from ValidationHelper
Constructor Details
#initialize(spec) ⇒ ResourcePool
Returns a new instance of ResourcePool.
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/bosh/director/deployment_plan/resource_pool.rb', line 23 def initialize(spec) @name = safe_property(spec, "name", class: String) @cloud_properties = safe_property(spec, "cloud_properties", class: Hash, default: {}) stemcell_spec = safe_property(spec, "stemcell", class: Hash) @stemcell = Stemcell.parse(stemcell_spec) @env = safe_property(spec, "env", class: Hash, default: {}) end |
Instance Attribute Details
#cloud_properties ⇒ Hash (readonly)
Returns Cloud properties.
15 16 17 |
# File 'lib/bosh/director/deployment_plan/resource_pool.rb', line 15 def cloud_properties @cloud_properties end |
#env ⇒ Hash (readonly)
Returns Resource pool environment.
18 19 20 |
# File 'lib/bosh/director/deployment_plan/resource_pool.rb', line 18 def env @env end |
#name ⇒ String (readonly)
Returns Resource pool name.
9 10 11 |
# File 'lib/bosh/director/deployment_plan/resource_pool.rb', line 9 def name @name end |
#stemcell ⇒ DeploymentPlan::Stemcell (readonly)
Returns Stemcell spec.
12 13 14 |
# File 'lib/bosh/director/deployment_plan/resource_pool.rb', line 12 def stemcell @stemcell end |
Instance Method Details
#spec ⇒ Hash
Returns resource pools spec as Hash (usually for agent to serialize)
38 39 40 41 42 43 44 |
# File 'lib/bosh/director/deployment_plan/resource_pool.rb', line 38 def spec { "name" => @name, "cloud_properties" => @cloud_properties, "stemcell" => @stemcell.spec } end |