Sha256: b85f1ccb4a22bf9be838e5bf11729317ab36d5b7051dd6056b1bbebc1b20b0c0

Contents?: true

Size: 1.32 KB

Versions: 14

Compression:

Stored size: 1.32 KB

Contents

require 'fog/core/model'
require 'fog/rackspace/models/compute_v2/meta_parent'

module Fog
  module Compute
    class RackspaceV2
      class Metadatum < Fog::Model

        include Fog::Compute::RackspaceV2::MetaParent

        identity :key
        attribute :value

        # Remove metadatum from server
        # @return [Boolean] return true if metadatum is deleting
        # @raise [Fog::Compute::RackspaceV2::NotFound] - HTTP 404
        # @raise [Fog::Compute::RackspaceV2::BadRequest] - HTTP 400
        # @raise [Fog::Compute::RackspaceV2::InternalServerError] - HTTP 500
        # @raise [Fog::Compute::RackspaceV2::ServiceError]
        def destroy
          requires :identity
          connection.delete_metadata_item(collection_name, parent.id, key)
          true
        end

        # Save metadatum on server
        # @return [Boolean] return true if metadatum is saving
        # @raise [Fog::Compute::RackspaceV2::NotFound] - HTTP 404
        # @raise [Fog::Compute::RackspaceV2::BadRequest] - HTTP 400
        # @raise [Fog::Compute::RackspaceV2::InternalServerError] - HTTP 500
        # @raise [Fog::Compute::RackspaceV2::ServiceError]
        def save
          requires :identity, :value
          connection.set_metadata_item(collection_name, parent.id, key, value)
          true
        end

      end
    end
  end
end

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
gapinc-fog-1.12.1.2.1 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-1.15.0 lib/fog/rackspace/models/compute_v2/metadatum.rb
gapinc-fog-1.14.0 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.14.0.20130806165225 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-1.14.0 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-1.13.0 lib/fog/rackspace/models/compute_v2/metadatum.rb
gapinc-fog-1.12.1.2 lib/fog/rackspace/models/compute_v2/metadatum.rb
gapinc-fog-1.12.1.1 lib/fog/rackspace/models/compute_v2/metadatum.rb
gapinc-fog-1.12.1a lib/fog/rackspace/models/compute_v2/metadatum.rb
gapinc-fog-1.12.1 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-1.12.1 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-1.12.0 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-1.11.1 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-1.11.0 lib/fog/rackspace/models/compute_v2/metadatum.rb