Sha256: 9c645ebfd329a8c4f61ae33f9b7b6eb9e4f807451f1248060f5a2b7253ca8f03

Contents?: true

Size: 1.31 KB

Versions: 41

Compression:

Stored size: 1.31 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
          service.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
          service.set_metadata_item(collection_name, parent.id, key, value)
          true
        end

      end
    end
  end
end

Version data entries

41 entries across 41 versions & 2 rubygems

Version Path
fog-1.22.0 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-1.21.0 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.20.0.20140305101839 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-1.20.0 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-1.19.0 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/rackspace/models/compute_v2/metadatum.rb