Sha256: b719a5e7b19382690f0fc0caea8fdc70d4637863dbfb3208a4a753696f597349

Contents?: true

Size: 750 Bytes

Versions: 11

Compression:

Stored size: 750 Bytes

Contents

require 'fog/core/model'

module Fog
  module Compute
    class RackspaceV2
      class Attachment < Fog::Model
        identity :id

        attribute :server_id, :aliases => 'serverId'
        attribute :volume_id, :aliases => 'volumeId'
        attribute :device

        def save
          requires :server, :identity, :device
          data = connection.attach_volume(server.identity, identity, device)
          merge_attributes(data.body['volumeAttachment'])
          true
        end

        def destroy
          requires :server, :identity
          connection.delete_attachment(server.identity, identity)
          true
        end

        private

        def server
          collection.server
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 7 rubygems

Version Path
fog-nirvanix-1.8.2 lib/fog/rackspace/models/compute_v2/attachment.rb
fog-nirvanix-1.8.1 lib/fog/rackspace/models/compute_v2/attachment.rb
fog-parser-fix-1.6.1 lib/fog/rackspace/models/compute_v2/attachment.rb
fog-test-again-1.6.0 lib/fog/rackspace/models/compute_v2/attachment.rb
fog-parser-fix-1.6.0 lib/fog/rackspace/models/compute_v2/attachment.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/rackspace/models/compute_v2/attachment.rb
fog-sgonyea-1.8.1 lib/fog/rackspace/models/compute_v2/attachment.rb
fog-1.8.0 lib/fog/rackspace/models/compute_v2/attachment.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/rackspace/models/compute_v2/attachment.rb
fog-1.7.0 lib/fog/rackspace/models/compute_v2/attachment.rb
fog-1.6.0 lib/fog/rackspace/models/compute_v2/attachment.rb