Class: Deltacloud::StorageSnapshot

Inherits:
BaseModel
  • Object
show all
Includes:
TestPoller
Defined in:
lib/deltacloud/api.rb,
lib/deltacloud/models/storage_snapshot.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from TestPoller

#wait_for!

Methods inherited from BaseModel

attr_accessor, attributes, #attributes, #id, #initialize, #to_entity

Constructor Details

This class inherits a constructor from Deltacloud::BaseModel

Instance Attribute Details

#createdObject

Returns the value of attribute created.



22
23
24
# File 'lib/deltacloud/models/storage_snapshot.rb', line 22

def created
  @created
end

#descriptionObject

Returns the value of attribute description.



24
25
26
# File 'lib/deltacloud/models/storage_snapshot.rb', line 24

def description
  @description
end

#nameObject

Returns the value of attribute name.



23
24
25
# File 'lib/deltacloud/models/storage_snapshot.rb', line 23

def name
  @name
end

#stateObject

Returns the value of attribute state.



20
21
22
# File 'lib/deltacloud/models/storage_snapshot.rb', line 20

def state
  @state
end

#storage_volume_idObject

Returns the value of attribute storage_volume_id.



21
22
23
# File 'lib/deltacloud/models/storage_snapshot.rb', line 21

def storage_volume_id
  @storage_volume_id
end

Instance Method Details

#is_completed?Boolean

Returns:

  • (Boolean)


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

def is_completed?
  state == 'completed'
end

#to_hash(context) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/deltacloud/models/storage_snapshot.rb', line 30

def to_hash(context)
  {
    :id => self.id,
    :href => context.storage_snapshot_url(self.id),
    :state => state,
    :storage_volume => {
      :id => storage_volume_id,
      :href => context.storage_volume_url(storage_volume_id),
      :rel => :storage_volume 
    },
    :created => created
  }
end