Sha256: d3c72122a3d8c0925c68ea20488d4fff5b5aea6cde0fff72d9442207e693b14b

Contents?: true

Size: 1.5 KB

Versions: 98

Compression:

Stored size: 1.5 KB

Contents

module Fog
  module Compute
    class Cloudstack
      class Snapshot < Fog::Model
        identity  :id,                         :aliases => 'id'

        attribute :name,                       :aliases => 'name'
        attribute :volume_type,                :aliases => 'volumetype'
        attribute :volume_name,                :aliases => 'volumename'
        attribute :volume_id,                  :aliases => 'volumeid'
        attribute :created,                    :aliases => 'created'
        attribute :state,                      :aliases => 'state'
        attribute :account,                    :aliases => 'account'
        attribute :domain_id,                  :aliases => 'domainid'
        attribute :domain,                     :aliases => 'domain'
        attribute :snapshot_type,              :aliases => 'snapshot_type'
        attribute :interval_type,              :aliases => 'interval_type'

        def save
          requires :volume_id

          options = {
            'volumeid'      => volume_id,
            'domainid'      => domain_id
          }
          data = service.create_snapshot(options)
          merge_attributes(data['createsnapshotresponse'])
        end

        def ready?
          state == 'BackedUp'
        end

        def volume
          service.volumes.get(volume_id) if volume_id
        end

        def destroy
          requires :id
          service.delete_snapshot('id' => id)
          true
        end
      end # Snapshot
    end # Cloudstack
  end # Compute
end # Fog

Version data entries

98 entries across 96 versions & 8 rubygems

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