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



10
11
12
13
14
15
16
17
# File 'lib/fog/openstack/models/volume/volume_type.rb', line 10

def create
  requires :name

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

  self
end

#destroyObject



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

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

#updateObject



19
20
21
22
23
24
25
26
# File 'lib/fog/openstack/models/volume/volume_type.rb', line 19

def update
  requires :id

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

  self
end