Class: Fog::Volume::OpenStack::Snapshot

Inherits:
OpenStack::Model show all
Defined in:
lib/fog/volume/openstack/models/snapshot.rb

Direct Known Subclasses

V1::Snapshot, V2::Snapshot

Instance Attribute Summary

Attributes inherited from OpenStack::Model

#project

Instance Method Summary collapse

Methods inherited from OpenStack::Model

#create, #initialize, #save

Constructor Details

This class inherits a constructor from Fog::OpenStack::Model

Instance Method Details

#delete_metadata(key_name) ⇒ Object

Delete one specific key-value pair by specifying the key name



30
31
32
33
34
# File 'lib/fog/volume/openstack/models/snapshot.rb', line 30

def (key_name)
  requires :id
  service.(id, key_name)
  true
end

#destroyObject



16
17
18
19
20
# File 'lib/fog/volume/openstack/models/snapshot.rb', line 16

def destroy
  requires :id
  service.delete_snapshot(id)
  true
end

#update(data) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/fog/volume/openstack/models/snapshot.rb', line 7

def update(data)
  requires :id

  response = service.update_snapshot(id, data)
  merge_attributes(response.body['snapshot'])

  self
end

#update_metadata(metadata) ⇒ Object

Existing keys have values updated and new key-value pairs are created, but none are deleted



23
24
25
26
27
# File 'lib/fog/volume/openstack/models/snapshot.rb', line 23

def ()
  requires :id
  service.(id, )
  true
end