Class: Bosh::Director::NetworkReservation
- Includes:
- IpUtil
- Defined in:
- lib/bosh/director/network_reservation.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#instance_model ⇒ Object
readonly
Returns the value of attribute instance_model.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#network ⇒ Object
readonly
Returns the value of attribute network.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #dynamic? ⇒ Boolean
-
#initialize(instance_model, network) ⇒ NetworkReservation
constructor
A new instance of NetworkReservation.
- #mark_reserved ⇒ Object
- #reserved? ⇒ Boolean
- #resolve_network(network) ⇒ Object
- #static? ⇒ Boolean
Methods included from IpUtil
#each_ip, #format_ip, #ip_to_i, #ip_to_netaddr
Constructor Details
#initialize(instance_model, network) ⇒ NetworkReservation
Returns a new instance of NetworkReservation.
7 8 9 10 11 12 |
# File 'lib/bosh/director/network_reservation.rb', line 7 def initialize(instance_model, network) @instance_model = instance_model @network = network @ip = nil @reserved = false end |
Instance Attribute Details
#instance_model ⇒ Object (readonly)
Returns the value of attribute instance_model.
5 6 7 |
# File 'lib/bosh/director/network_reservation.rb', line 5 def instance_model @instance_model end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
5 6 7 |
# File 'lib/bosh/director/network_reservation.rb', line 5 def ip @ip end |
#network ⇒ Object (readonly)
Returns the value of attribute network.
5 6 7 |
# File 'lib/bosh/director/network_reservation.rb', line 5 def network @network end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/bosh/director/network_reservation.rb', line 5 def type @type end |
Instance Method Details
#dynamic? ⇒ Boolean
30 31 32 |
# File 'lib/bosh/director/network_reservation.rb', line 30 def dynamic? type == :dynamic end |
#mark_reserved ⇒ Object
22 23 24 |
# File 'lib/bosh/director/network_reservation.rb', line 22 def mark_reserved @reserved = true end |
#reserved? ⇒ Boolean
18 19 20 |
# File 'lib/bosh/director/network_reservation.rb', line 18 def reserved? @reserved end |
#resolve_network(network) ⇒ Object
14 15 16 |
# File 'lib/bosh/director/network_reservation.rb', line 14 def resolve_network(network) @network = network end |
#static? ⇒ Boolean
26 27 28 |
# File 'lib/bosh/director/network_reservation.rb', line 26 def static? type == :static end |