Sha256: 581f73f7763118e8cd5601fa4e486cda3b6350bfb1058c75f8d01cd54dcf641b

Contents?: true

Size: 653 Bytes

Versions: 4

Compression:

Stored size: 653 Bytes

Contents

module Smartdc::Api
  module Machine
    class Tags
      attr_reader :request

      def initialize(id, options)
        @id = id
        @request = Smartdc::Request.new(options)
      end

      def create(raw={})
        request.post('my/machines/' + @id.to_s + '/tags/', raw)
      end
      
      def read(id)
        raise ArgumentError unless id
        request.get('my/machines/' + @id.to_s + '/tags/' + id.to_s)
      end

      def all(query={})
        request.get('my/machines/' + @id.to_s + '/tags', query)
      end

      def destroy(id=nil)
        request.del('my/machines/' + @id.to_s + '/tags/' + id.to_s)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
smartdc-1.2.2 lib/smartdc/api/machine/tags.rb
smartdc-1.2.1 lib/smartdc/api/machine/tags.rb
smartdc-1.1.1 lib/smartdc/api/machine/tags.rb
smartdc-1.0.1 lib/smartdc/api/machine/tags.rb