Class: DeltacloudVM::Client::Address
- Includes:
- Methods::Address
- Defined in:
- lib/deltacloud_vm/client/models/address.rb
Instance Attribute Summary collapse
-
#instance_id ⇒ Object
readonly
Returns the value of attribute instance_id.
-
#ip ⇒ Object
readonly
Custom attributes:.
Attributes inherited from Base
#description, #name, #obj_id, #url
Class Method Summary collapse
-
.parse(xml_body) ⇒ Object
Parse the Address entity from XML body.
Instance Method Summary collapse
-
#associate(instance_id) ⇒ Object
Associate the IP address to the
Instance
. - #destroy! ⇒ Object
-
#disassociate ⇒ Object
Disassociate the IP address from
Instance
.
Methods included from Methods::Address
#address, #addresses, #associate_address, #create_address, #destroy_address, #disassociate_address
Methods inherited from Base
#client, #connection, convert, #entrypoint, from_collection, #id, #initialize, #original_body, #to_s, #update_instance_variables!, validate_attrs!
Methods included from Helpers::XmlHelper
Methods included from Methods::Api
#api_uri, #current_driver, #current_provider, #feature?, #features, #must_support!, #path, #support?, #supported_collections, #version
Methods included from Helpers::Model
#error, #from_collection, #from_resource, #model
Constructor Details
This class inherits a constructor from DeltacloudVM::Client::Base
Instance Attribute Details
#instance_id ⇒ Object (readonly)
Returns the value of attribute instance_id.
25 26 27 |
# File 'lib/deltacloud_vm/client/models/address.rb', line 25 def instance_id @instance_id end |
#ip ⇒ Object (readonly)
Custom attributes:
24 25 26 |
# File 'lib/deltacloud_vm/client/models/address.rb', line 24 def ip @ip end |
Class Method Details
.parse(xml_body) ⇒ Object
Parse the Address entity from XML body
-
xml_body -> DeltacloudVM API XML representation of the address
50 51 52 53 54 55 |
# File 'lib/deltacloud_vm/client/models/address.rb', line 50 def self.parse(xml_body) { :ip => xml_body.text_at(:ip), :instance_id => xml_body.attr_at('instance', :id) } end |
Instance Method Details
#associate(instance_id) ⇒ Object
Associate the IP address to the Instance
32 33 34 |
# File 'lib/deltacloud_vm/client/models/address.rb', line 32 def associate(instance_id) associate_address(_id, instance_id) end |
#destroy! ⇒ Object
42 43 44 |
# File 'lib/deltacloud_vm/client/models/address.rb', line 42 def destroy! destroy_address(_id) end |
#disassociate ⇒ Object
Disassociate the IP address from Instance
38 39 40 |
# File 'lib/deltacloud_vm/client/models/address.rb', line 38 def disassociate disassociate_address(_id) end |