Class: Bosh::Director::DeploymentPlan::JobNetwork

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, static_ips, default_for, deployment_network) ⇒ JobNetwork

Returns a new instance of JobNetwork.



6
7
8
9
10
11
# File 'lib/bosh/director/deployment_plan/job_network.rb', line 6

def initialize(name, static_ips, default_for, deployment_network)
  @name = name
  @static_ips = static_ips
  @default_for = default_for
  @deployment_network = deployment_network
end

Instance Attribute Details

#deployment_networkObject (readonly)

Returns the value of attribute deployment_network.



4
5
6
# File 'lib/bosh/director/deployment_plan/job_network.rb', line 4

def deployment_network
  @deployment_network
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/bosh/director/deployment_plan/job_network.rb', line 4

def name
  @name
end

#static_ipsObject (readonly)

Returns the value of attribute static_ips.



4
5
6
# File 'lib/bosh/director/deployment_plan/job_network.rb', line 4

def static_ips
  @static_ips
end

Instance Method Details

#availability_zonesObject



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

def availability_zones
  @deployment_network.availability_zones
end

#default_for?(property) ⇒ Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/bosh/director/deployment_plan/job_network.rb', line 29

def default_for?(property)
  properties_for_which_the_network_is_the_default.include?(property)
end

#has_azs?(az_names) ⇒ Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/bosh/director/deployment_plan/job_network.rb', line 37

def has_azs?(az_names)
  @deployment_network.has_azs?(az_names)
end

#make_default_for(defaults) ⇒ Object



33
34
35
# File 'lib/bosh/director/deployment_plan/job_network.rb', line 33

def make_default_for(defaults)
  @default_for = defaults
end

#properties_for_which_the_network_is_the_defaultObject



17
18
19
# File 'lib/bosh/director/deployment_plan/job_network.rb', line 17

def properties_for_which_the_network_is_the_default
  @default_for
end

#static?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/bosh/director/deployment_plan/job_network.rb', line 21

def static?
  !!@static_ips
end

#vip?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/bosh/director/deployment_plan/job_network.rb', line 25

def vip?
  deployment_network.kind_of?(VipNetwork)
end