Class: Fog::Compute::Cloudstack::DiskOffering

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/cloudstack/models/compute/disk_offering.rb

Instance Attribute Summary

Attributes inherited from Model

#collection, #service

Instance Method Summary collapse

Methods inherited from Model

#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Fog::Core::DeprecatedConnectionAccessors

#connection, #connection=, #prepare_service_value

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Model

Instance Method Details

#destroyObject



34
35
36
37
38
39
40
41
# File 'lib/fog/cloudstack/models/compute/disk_offering.rb', line 34

def destroy
  requires :id

  response = service.delete_disk_offering('id' => id )
  success_status = response['deletediskofferingresponse']['success']

  success_status == 'true'
end

#saveObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/fog/cloudstack/models/compute/disk_offering.rb', line 17

def save
  requires :display_text, :name

  options = {
    'displaytext' => display_text,
    'name'        => name,
    'customized'  => is_customized,
    'disksize'    => disk_size,
    'domain_id'   => domain_id,
    'storagetype' => storage_type,
    'tags'        => tags
  }

  response = service.create_disk_offering(options)
  merge_attributes(response['creatediskofferingresponse'])
end