Class: Fog::Compute::Ecloud::IpAddress
- Inherits:
-
Ecloud::Model
- Object
- Model
- Ecloud::Model
- Fog::Compute::Ecloud::IpAddress
- Defined in:
- lib/fog/ecloud/models/compute/ip_address.rb
Instance Attribute Summary
Attributes inherited from Ecloud::Model
Attributes inherited from Model
Instance Method Summary collapse
Methods inherited from Ecloud::Model
Methods inherited from Model
#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for
Methods included from Attributes::ClassMethods
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
Methods included from Fog::Core::DeprecatedConnectionAccessors
#connection, #connection=, #prepare_service_value
Methods included from Attributes::InstanceMethods
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one
Constructor Details
This class inherits a constructor from Fog::Model
Instance Method Details
#id ⇒ Object
19 20 21 |
# File 'lib/fog/ecloud/models/compute/ip_address.rb', line 19 def id href.match(/((\d+{1,3}\.){3}(\d+{1,3}))$/)[1] end |
#network ⇒ Object
31 32 33 34 35 |
# File 'lib/fog/ecloud/models/compute/ip_address.rb', line 31 def network reload if other_links.nil? network_href = other_links.detect { |l| l[:type] == "application/vnd.tmrk.cloud.network" }[:href] network = self.service.networks.get(network_href) end |
#server ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/fog/ecloud/models/compute/ip_address.rb', line 23 def server @server ||= begin reload unless other_links server_link = other_links.find{|l| l[:type] == "application/vnd.tmrk.cloud.virtualMachine"} self.service.servers.get(server_link[:href]) end end |
#status ⇒ Object
15 16 17 |
# File 'lib/fog/ecloud/models/compute/ip_address.rb', line 15 def status (detected_on || host) ? "Assigned" : "Available" end |