Class: Bosh::Director::ExistingNetworkReservation
- Inherits:
-
NetworkReservation
- Object
- NetworkReservation
- Bosh::Director::ExistingNetworkReservation
- Defined in:
- lib/bosh/director/network_reservation.rb
Instance Attribute Summary collapse
-
#network_type ⇒ Object
readonly
Returns the value of attribute network_type.
Attributes inherited from NetworkReservation
#instance_model, #ip, #network, #type
Instance Method Summary collapse
- #desc ⇒ Object
-
#initialize(instance_model, network, ip, network_type) ⇒ ExistingNetworkReservation
constructor
A new instance of ExistingNetworkReservation.
- #resolve_type(type) ⇒ Object
- #to_s ⇒ Object
Methods inherited from NetworkReservation
#dynamic?, #mark_reserved, #reserved?, #resolve_network, #static?
Methods included from IpUtil
#each_ip, #format_ip, #ip_to_i, #ip_to_netaddr
Constructor Details
#initialize(instance_model, network, ip, network_type) ⇒ ExistingNetworkReservation
Returns a new instance of ExistingNetworkReservation.
44 45 46 47 48 |
# File 'lib/bosh/director/network_reservation.rb', line 44 def initialize(instance_model, network, ip, network_type) super(instance_model, network) @ip = ip_to_i(ip) if ip @network_type = network_type end |
Instance Attribute Details
#network_type ⇒ Object (readonly)
Returns the value of attribute network_type.
42 43 44 |
# File 'lib/bosh/director/network_reservation.rb', line 42 def network_type @network_type end |
Instance Method Details
#desc ⇒ Object
54 55 56 |
# File 'lib/bosh/director/network_reservation.rb', line 54 def desc "existing reservation#{@ip.nil? ? '' : " with IP '#{formatted_ip}' for instance #{@instance_model}"}" end |
#resolve_type(type) ⇒ Object
50 51 52 |
# File 'lib/bosh/director/network_reservation.rb', line 50 def resolve_type(type) @type = type end |
#to_s ⇒ Object
58 59 60 |
# File 'lib/bosh/director/network_reservation.rb', line 58 def to_s "{ip=#{formatted_ip}, network=#{@network.name}, instance=#{@instance_model}, reserved=#{reserved?}, type=#{type}}" end |