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

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

Instance Attribute Summary

Attributes inherited from OpenStack::Model

#project

Instance Method Summary collapse

Methods inherited from OpenStack::Model

#initialize, #save

Constructor Details

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

Instance Method Details

#createObject


13
14
15
16
17
18
19
20
# File 'lib/fog/openstack/models/volume/volume_type.rb', line 13

def create
  requires :name

  response = service.create_volume_type(self.attributes)
  merge_attributes(response.body['volume_type'])

  self
end

#destroyObject


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

def destroy
  requires :id
  service.delete_volume_type(self.id)
  true
end

#updateObject


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

def update
  requires :id

  response = service.update_volume_type(self.id, self.attributes)
  merge_attributes(response.body['volume_type'])

  self
end