Class: Bosh::Director::DeploymentPlan::NetworkWithSubnets

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

Direct Known Subclasses

DynamicNetwork, ManualNetwork

Constant Summary

Constants inherited from Network

Bosh::Director::DeploymentPlan::Network::VALID_DEFAULTS

Instance Attribute Summary

Attributes inherited from Network

#canonical_name, #name

Instance Method Summary collapse

Methods inherited from Network

#find_az_names_for_ip, #initialize, #manual?, #network_settings, #validate_reference_from_job!

Methods included from ValidationHelper

#safe_property

Constructor Details

This class inherits a constructor from Bosh::Director::DeploymentPlan::Network

Instance Method Details

#availability_zonesObject



80
81
82
# File 'lib/bosh/director/deployment_plan/network.rb', line 80

def availability_zones
  @subnets.map(&:availability_zone_names).flatten.uniq
end

#has_azs?(az_names) ⇒ Boolean

Returns:

  • (Boolean)


61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/bosh/director/deployment_plan/network.rb', line 61

def has_azs?(az_names)
  az_names = [az_names].flatten

  if az_names.compact.empty? && availability_zones.empty?
    return true
  end

  unreferenced_zones = az_names - availability_zones
  if unreferenced_zones.empty?
    return true
  end

  false
end

#supports_azs?Boolean

Returns:

  • (Boolean)


76
77
78
# File 'lib/bosh/director/deployment_plan/network.rb', line 76

def supports_azs?
  true
end