Class: Bosh::Director::DeploymentPlan::CompilationConfig
- Includes:
- ValidationHelper
- Defined in:
- lib/bosh/director/deployment_plan/compilation_config.rb
Overview
Represents the deployment compilation worker configuration.
Instance Attribute Summary collapse
-
#availability_zone ⇒ Object
readonly
Returns the value of attribute availability_zone.
-
#cloud_properties ⇒ Hash
readonly
Cloud properties to use when creating VMs.
-
#env ⇒ Hash
Environment to use when creating VMs.
-
#network_name ⇒ Object
readonly
Returns the value of attribute network_name.
-
#reuse_compilation_vms ⇒ Bool
If VMs should be reused for compilation tasks.
-
#vm_extensions ⇒ Object
readonly
Returns the value of attribute vm_extensions.
-
#vm_type ⇒ Object
readonly
Returns the value of attribute vm_type.
-
#workers ⇒ Integer
Number of worker VMs to use.
Instance Method Summary collapse
- #availability_zone_name ⇒ Object
-
#initialize(compilation_config, azs_list, vm_types = [], vm_extensions = []) ⇒ CompilationConfig
constructor
A new instance of CompilationConfig.
Methods included from ValidationHelper
Constructor Details
#initialize(compilation_config, azs_list, vm_types = [], vm_extensions = []) ⇒ CompilationConfig
Returns a new instance of CompilationConfig.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/bosh/director/deployment_plan/compilation_config.rb', line 28 def initialize(compilation_config, azs_list, vm_types = [], vm_extensions = []) @workers = safe_property(compilation_config, 'workers', class: Integer, min: 1) @network_name = safe_property(compilation_config, 'network', class: String) @reuse_compilation_vms = safe_property(compilation_config, 'reuse_compilation_vms', class: :boolean, optional: true) @cloud_properties = safe_property( compilation_config, 'cloud_properties', class: Hash, default: {}) @env = safe_property(compilation_config, 'env', class: Hash, optional: true, default: {}) parse_availability_zone(azs_list, compilation_config) parse_vm_type(compilation_config, vm_types) parse_vm_extensions(compilation_config, vm_extensions) end |
Instance Attribute Details
#availability_zone ⇒ Object (readonly)
Returns the value of attribute availability_zone.
22 23 24 |
# File 'lib/bosh/director/deployment_plan/compilation_config.rb', line 22 def availability_zone @availability_zone end |
#cloud_properties ⇒ Hash (readonly)
Returns cloud properties to use when creating VMs. (optional).
12 13 14 |
# File 'lib/bosh/director/deployment_plan/compilation_config.rb', line 12 def cloud_properties @cloud_properties end |
#env ⇒ Hash
Returns environment to use when creating VMs. (optional).
15 16 17 |
# File 'lib/bosh/director/deployment_plan/compilation_config.rb', line 15 def env @env end |
#network_name ⇒ Object (readonly)
Returns the value of attribute network_name.
20 21 22 |
# File 'lib/bosh/director/deployment_plan/compilation_config.rb', line 20 def network_name @network_name end |
#reuse_compilation_vms ⇒ Bool
Returns if VMs should be reused for compilation tasks. (optional).
18 19 20 |
# File 'lib/bosh/director/deployment_plan/compilation_config.rb', line 18 def reuse_compilation_vms @reuse_compilation_vms end |
#vm_extensions ⇒ Object (readonly)
Returns the value of attribute vm_extensions.
26 27 28 |
# File 'lib/bosh/director/deployment_plan/compilation_config.rb', line 26 def vm_extensions @vm_extensions end |
#vm_type ⇒ Object (readonly)
Returns the value of attribute vm_type.
24 25 26 |
# File 'lib/bosh/director/deployment_plan/compilation_config.rb', line 24 def vm_type @vm_type end |
#workers ⇒ Integer
Returns number of worker VMs to use.
9 10 11 |
# File 'lib/bosh/director/deployment_plan/compilation_config.rb', line 9 def workers @workers end |
Instance Method Details
#availability_zone_name ⇒ Object
50 51 52 |
# File 'lib/bosh/director/deployment_plan/compilation_config.rb', line 50 def availability_zone_name @availability_zone.nil? ? nil : @availability_zone.name end |