Sha256: 01170bbba880820f8aea848a52c73b4de8a2154c02ae607749905a0985f60fbb

Contents?: true

Size: 902 Bytes

Versions: 24

Compression:

Stored size: 902 Bytes

Contents

module Runcible
  module Resources
    # @see https://docs.pulpproject.org/dev-guide/integration/rest-api/content/index.html
    class Unit < Runcible::Base
      # Generates the API path for Units
      #
      # @param  [String]  type  the unit type
      # @return [String]        the unit search path
      def path(type)
        "content/units/#{type}/search/"
      end

      # Searches a given unit type based on criteria
      #
      # @param  [String]                type      the unit type
      # @param  [Hash]                  criteria  criteria object containing Mongo syntax
      # @param  [Hash]                  optional  container for all optional parameters
      # @return [RestClient::Response]
      def search(type, criteria, optional = {})
        call(:post, path(type), :payload => {:required => {:criteria => criteria}, :optional => optional})
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
runcible-2.13.1 lib/runcible/resources/unit.rb
runcible-2.13.0 lib/runcible/resources/unit.rb
runcible-2.12.1 lib/runcible/resources/unit.rb
runcible-2.12.0 lib/runcible/resources/unit.rb
runcible-2.11.1 lib/runcible/resources/unit.rb
runcible-2.11.0 lib/runcible/resources/unit.rb
runcible-2.10.1 lib/runcible/resources/unit.rb
runcible-2.10.0 lib/runcible/resources/unit.rb
runcible-2.9.0 lib/runcible/resources/unit.rb
runcible-2.8.1 lib/runcible/resources/unit.rb
runcible-2.8.0 lib/runcible/resources/unit.rb
runcible-2.7.0 lib/runcible/resources/unit.rb
runcible-2.6.0 lib/runcible/resources/unit.rb
runcible-2.5.0 lib/runcible/resources/unit.rb
runcible-2.4.0 lib/runcible/resources/unit.rb
runcible-2.3.0 lib/runcible/resources/unit.rb
runcible-2.2.0 lib/runcible/resources/unit.rb
runcible-1.12.0 lib/runcible/resources/unit.rb
runcible-2.1.0 lib/runcible/resources/unit.rb
runcible-2.0.1 lib/runcible/resources/unit.rb