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

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

Instance Attribute Summary

Attributes inherited from OpenStack::Model

#project

Instance Method Summary collapse

Methods inherited from OpenStack::Model

#create, #initialize, #save, #update

Constructor Details

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

Instance Method Details

#create_metadata(metadata) ⇒ Object


39
40
41
# File 'lib/fog/volume/openstack/models/volume.rb', line 39

def ()
  ()
end

#delete_metadata(key_name) ⇒ Object

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


58
59
60
61
62
# File 'lib/fog/volume/openstack/models/volume.rb', line 58

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

#destroyObject


18
19
20
21
22
# File 'lib/fog/volume/openstack/models/volume.rb', line 18

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

#extend(size) ⇒ Object


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

def extend(size)
  requires :id
  service.extend_volume(id, size)
  true
end

#ready?Boolean


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

def ready?
  status == 'available'
end

#replace_metadata(metadata) ⇒ Object

All existing key-value pairs are deleted and replaced with the key-value pairs specified here


51
52
53
54
55
# File 'lib/fog/volume/openstack/models/volume.rb', line 51

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

#reset_status(status) ⇒ Object


34
35
36
37
# File 'lib/fog/volume/openstack/models/volume.rb', line 34

def reset_status(status)
  requires :id
  service.action(id, 'os-reset_status' => {:status => status})
end

#update_metadata(metadata) ⇒ Object

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


44
45
46
47
48
# File 'lib/fog/volume/openstack/models/volume.rb', line 44

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