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-maestrodev-1.18.0.20131209090811 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.18.0.20131206115947 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.18.0.20131205181604 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.18.0.20131127194823 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.18.0.20131126183714 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.18.0.20131126122111 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.18.0.20131125111730 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.18.0.20131125083406 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.18.0.20131123105121 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.18.0.20131122203507 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.18.0.20131121075022 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.18.0.20131118164830 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.18.0.20131115184302 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.18.0.20131114200144 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.18.0.20131112185232 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.18.0.20131111203459 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-1.18.0 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-1.17.0 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-1.16.0 lib/fog/rackspace/models/compute_v2/metadatum.rb
fog-maestrodev-1.15.0.20130927082724 lib/fog/rackspace/models/compute_v2/metadatum.rb