Class: Bosh::Director::DeploymentPlan::Network

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

Overview

Represents a logical deployment network.

Direct Known Subclasses

NetworkWithSubnets, VipNetwork

Constant Summary collapse

VALID_DEFAULTS =
%w(dns gateway).sort

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ValidationHelper

#safe_property

Constructor Details

#initialize(name, logger) ⇒ Network

Creates a new network.

Parameters:

  • deployment (DeploymentPlan)

    associated deployment plan

  • network_spec (Hash)

    parsed deployment manifest network section



23
24
25
26
27
# File 'lib/bosh/director/deployment_plan/network.rb', line 23

def initialize(name, logger)
  @name = name
  @canonical_name = Canonicalizer.canonicalize(@name)
  @logger = logger
end

Instance Attribute Details

#canonical_nameString

Returns canonical network name.

Returns:

  • (String)

    canonical network name



16
17
18
# File 'lib/bosh/director/deployment_plan/network.rb', line 16

def canonical_name
  @canonical_name
end

#nameString

Returns network name.

Returns:

  • (String)

    network name



13
14
15
# File 'lib/bosh/director/deployment_plan/network.rb', line 13

def name
  @name
end

Instance Method Details

#find_az_names_for_ip(ip) ⇒ Object

Raises:

  • (NotImplementedError)


44
45
46
# File 'lib/bosh/director/deployment_plan/network.rb', line 44

def find_az_names_for_ip(ip)
  raise NotImplementedError
end

#has_azs?(az_names) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


40
41
42
# File 'lib/bosh/director/deployment_plan/network.rb', line 40

def has_azs?(az_names)
  raise NotImplementedError
end

#manual?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/bosh/director/deployment_plan/network.rb', line 55

def manual?
  false
end

#network_settings(reservation, default_properties = VALID_DEFAULTS, availability_zone = nil) ⇒ Hash

Returns the network settings for the specific reservation.

Parameters:

Returns:

  • (Hash)

    network settings that will be passed to the BOSH Agent

Raises:

  • (NotImplementedError)


35
36
37
38
# File 'lib/bosh/director/deployment_plan/network.rb', line 35

def network_settings(reservation, default_properties = VALID_DEFAULTS, availability_zone = nil)
  raise NotImplementedError,
        "#network_settings not implemented for #{self.class}"
end

#supports_azs?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/bosh/director/deployment_plan/network.rb', line 51

def supports_azs?
  false
end

#validate_reference_from_job!(job_network_spec, job_name) ⇒ Object



48
49
# File 'lib/bosh/director/deployment_plan/network.rb', line 48

def validate_reference_from_job!(job_network_spec, job_name)
end