Class: Bosh::Director::DeploymentPlan::CompilationConfig

Inherits:
Object
  • Object
show all
Includes:
ValidationHelper
Defined in:
lib/bosh/director/deployment_plan/compilation_config.rb

Overview

Represents the deployment compilation worker configuration.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ValidationHelper

#safe_property

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_zoneObject (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_propertiesHash (readonly)

Returns cloud properties to use when creating VMs. (optional).

Returns:

  • (Hash)

    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

#envHash

Returns environment to use when creating VMs. (optional).

Returns:

  • (Hash)

    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_nameObject (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_vmsBool

Returns if VMs should be reused for compilation tasks. (optional).

Returns:

  • (Bool)

    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_extensionsObject (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_typeObject (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

#workersInteger

Returns number of worker VMs to use.

Returns:

  • (Integer)

    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_nameObject



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