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

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

Instance Attribute Summary

Attributes inherited from Model

#project

Instance Method Summary collapse

Methods inherited from Model

#initialize, #save

Constructor Details

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

Instance Method Details

#createObject



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

def create
  requires :name

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

  self
end

#destroyObject



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

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

#updateObject



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

def update
  requires :id

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

  self
end