Module: DeltacloudVM::Client::Methods::StorageSnapshot

Included in:
Connection, StorageSnapshot, StorageVolume
Defined in:
lib/deltacloud_vm/client/methods/storage_snapshot.rb

Instance Method Summary collapse

Instance Method Details

#create_storage_snapshot(volume_id, create_opts = {}) ⇒ Object

Create a new StorageSnapshot based on volume_id

  • volume_id -> ID of the StorageVolume to create snapshot from

  • create_opts ->

    • :name -> Name of the StorageSnapshot

    • :description -> Description of the StorageSnapshot



46
47
48
# File 'lib/deltacloud_vm/client/methods/storage_snapshot.rb', line 46

def create_storage_snapshot(volume_id, create_opts={})
  create_resource :storage_snapshot, create_opts.merge(:volume_id => volume_id)
end

#destroy_storage_snapshot(snapshot_id) ⇒ Object

Destroy the current StorageSnapshot Returns ‘true’ if the response was 204 No Content

  • snapshot_id -> The ‘id’ of the snapshot to destroy



55
56
57
# File 'lib/deltacloud_vm/client/methods/storage_snapshot.rb', line 55

def destroy_storage_snapshot(snapshot_id)
  destroy_resource :storage_snapshot, snapshot_id
end

#storage_snapshot(storage_snapshot_id) ⇒ Object

Retrieve the single storage_snapshot entity

  • storage_snapshot_id -> StorageSnapshot entity to retrieve



34
35
36
37
# File 'lib/deltacloud_vm/client/methods/storage_snapshot.rb', line 34

def storage_snapshot(storage_snapshot_id)
  from_resource :storage_snapshot,
    connection.get(api_uri("storage_snapshots/#{storage_snapshot_id}"))
end

#storage_snapshots(filter_opts = {}) ⇒ Object

Retrieve list of all storage_snapshot entities

  • filter_options:

    • :id -> Filter entities using ‘id’ attribute



25
26
27
28
# File 'lib/deltacloud_vm/client/methods/storage_snapshot.rb', line 25

def storage_snapshots(filter_opts={})
  from_collection :storage_snapshots,
    connection.get(api_uri('storage_snapshots'), filter_opts)
end