1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/cloudstack/models/compute/disk_offering.rb
Paul Thornthwaite 2e0b7e545a Standardise empty lines throughout codebase
Done with `rubocop --auto-correct --only EmptyLineBetweenDefs,EmptyLines,EmptyLinesAroundBody`
2014-05-26 14:20:02 +01:00

44 lines
1.3 KiB
Ruby

module Fog
module Compute
class Cloudstack
class DiskOffering < Fog::Model
identity :id, :aliases => 'id'
attribute :created
attribute :disk_size, :aliases => 'disk_size'
attribute :display_text, :aliases => 'display_text'
attribute :domain
attribute :domain_id, :aliases => 'domainid'
attribute :is_customized, :aliases => 'iscustomized'
attribute :name
attribute :storage_type, :aliases => 'storagetype'
attribute :tags
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
def destroy
requires :id
response = service.delete_disk_offering('id' => id )
success_status = response['deletediskofferingresponse']['success']
success_status == 'true'
end
end # DiskOffering
end # Cloudstack
end # Compute
end # Fog