Sha256: 169aaf1a96a57e76f0f962e56e15f490d2f51d711dbed8921820211ae7d235b9

Contents?: true

Size: 1.33 KB

Versions: 40

Compression:

Stored size: 1.33 KB

Contents

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

Version data entries

40 entries across 38 versions & 5 rubygems

Version Path
fog-2.1.0 lib/fog/cloudstack/models/compute/disk_offering.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/lib/fog/cloudstack/models/compute/disk_offering.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/lib/fog/cloudstack/models/compute/disk_offering.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/lib/fog/cloudstack/models/compute/disk_offering.rb
fog-1.42.1 lib/fog/cloudstack/models/compute/disk_offering.rb
fog-2.0.0 lib/fog/cloudstack/models/compute/disk_offering.rb
fog-1.42.0 lib/fog/cloudstack/models/compute/disk_offering.rb
fog-1.41.0 lib/fog/cloudstack/models/compute/disk_offering.rb
fog-1.40.0 lib/fog/cloudstack/models/compute/disk_offering.rb
fog-1.39.0 lib/fog/cloudstack/models/compute/disk_offering.rb
fog-1.38.0 lib/fog/cloudstack/models/compute/disk_offering.rb
fog-1.37.0 lib/fog/cloudstack/models/compute/disk_offering.rb
fog-1.36.0 lib/fog/cloudstack/models/compute/disk_offering.rb
fog-1.35.0 lib/fog/cloudstack/models/compute/disk_offering.rb
fog-2.0.0.pre.0 lib/fog/cloudstack/models/compute/disk_offering.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/cloudstack/models/compute/disk_offering.rb
fog-1.34.0 lib/fog/cloudstack/models/compute/disk_offering.rb
fog-1.33.0 lib/fog/cloudstack/models/compute/disk_offering.rb
fog-1.32.0 lib/fog/cloudstack/models/compute/disk_offering.rb
fog-1.31.0 lib/fog/cloudstack/models/compute/disk_offering.rb