Class: Bosh::Director::DeploymentPlan::VipNetwork
- Includes:
- IpUtil
- Defined in:
- lib/bosh/director/deployment_plan/vip_network.rb
Constant Summary
Constants inherited from Network
Instance Attribute Summary collapse
-
#cloud_properties ⇒ Hash
readonly
Network cloud properties.
Attributes inherited from Network
Instance Method Summary collapse
- #has_azs?(az_names) ⇒ Boolean
-
#initialize(network_spec, logger) ⇒ VipNetwork
constructor
Creates a new network.
- #ip_type(_) ⇒ Object
-
#network_settings(reservation, default_properties = VALID_DEFAULTS, availability_zone = nil) ⇒ Hash
Returns the network settings for the specific reservation.
Methods included from IpUtil
#each_ip, #format_ip, #ip_to_i, #ip_to_netaddr
Methods inherited from Network
#find_az_names_for_ip, #manual?, #supports_azs?, #validate_reference_from_job!
Methods included from ValidationHelper
Constructor Details
#initialize(network_spec, logger) ⇒ VipNetwork
Creates a new network.
14 15 16 17 18 19 20 21 |
# File 'lib/bosh/director/deployment_plan/vip_network.rb', line 14 def initialize(network_spec, logger) super(safe_property(network_spec, "name", :class => String), logger) @cloud_properties = safe_property(network_spec, "cloud_properties", class: Hash, default: {}) @reserved_ips = Set.new @logger = TaggedLogger.new(logger, 'network-configuration') end |
Instance Attribute Details
#cloud_properties ⇒ Hash (readonly)
Returns Network cloud properties.
7 8 9 |
# File 'lib/bosh/director/deployment_plan/vip_network.rb', line 7 def cloud_properties @cloud_properties end |
Instance Method Details
#has_azs?(az_names) ⇒ Boolean
46 47 48 |
# File 'lib/bosh/director/deployment_plan/vip_network.rb', line 46 def has_azs?(az_names) true end |
#ip_type(_) ⇒ Object
42 43 44 |
# File 'lib/bosh/director/deployment_plan/vip_network.rb', line 42 def ip_type(_) :static end |
#network_settings(reservation, default_properties = VALID_DEFAULTS, availability_zone = nil) ⇒ Hash
Returns the network settings for the specific reservation.
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/bosh/director/deployment_plan/vip_network.rb', line 29 def network_settings(reservation, default_properties = VALID_DEFAULTS, availability_zone = nil) if default_properties && !default_properties.empty? raise NetworkReservationVipDefaultProvided, "Can't provide any defaults since this is a VIP network" end { "type" => "vip", "ip" => ip_to_netaddr(reservation.ip).ip, "cloud_properties" => @cloud_properties } end |