Class: Deltacloud::Client::StorageSnapshot

Inherits:
Base
  • Object
show all
Includes:
Methods::StorageSnapshot, Methods::StorageVolume
Defined in:
lib/deltacloud/client/models/storage_snapshot.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#description, #name, #obj_id, #url

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Methods::StorageVolume

#attach_storage_volume, #create_storage_volume, #destroy_storage_volume, #detach_storage_volume, #storage_volumes

Methods included from Methods::StorageSnapshot

#create_storage_snapshot, #destroy_storage_snapshot, #storage_snapshot, #storage_snapshots

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

#extract_xml_body

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 Deltacloud::Client::Base

Instance Attribute Details

#createdObject (readonly)

Custom attributes:



26
27
28
# File 'lib/deltacloud/client/models/storage_snapshot.rb', line 26

def created
  @created
end

#storage_volume_idObject (readonly)

Returns the value of attribute storage_volume_id.



27
28
29
# File 'lib/deltacloud/client/models/storage_snapshot.rb', line 27

def storage_volume_id
  @storage_volume_id
end

Class Method Details

.parse(xml_body) ⇒ Object

Parse the StorageSnapshot entity from XML body

  • xml_body -> Deltacloud API XML representation of the storage_snapshot



47
48
49
50
51
52
# File 'lib/deltacloud/client/models/storage_snapshot.rb', line 47

def self.parse(xml_body)
  {
    :created => xml_body.text_at(:created),
    :storage_volume_id => xml_body.attr_at('storage_volume', :id)
  }
end

Instance Method Details

#destroy!Object

Syntax sugar for destroying the current instance of StorageSnapshot



38
39
40
# File 'lib/deltacloud/client/models/storage_snapshot.rb', line 38

def destroy!
  destroy_storage_snapshot(_id)
end

#storage_volumeObject

StorageSnapshot model methods



31
32
33
# File 'lib/deltacloud/client/models/storage_snapshot.rb', line 31

def storage_volume
  super(storage_volume_id)
end