class Runcible::Resources::Unit
@see docs.pulpproject.org/dev-guide/integration/rest-api/content/index.html
Public Instance Methods
path(type)
click to toggle source
Generates the API path for Units
@param [String] type the unit type @return [String] the unit search path
# File lib/runcible/resources/unit.rb, line 9 def path(type) "content/units/#{type}/search/" end
search(type, criteria, optional = {})
click to toggle source
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]
# File lib/runcible/resources/unit.rb, line 19 def search(type, criteria, optional = {}) call(:post, path(type), :payload => {:required => {:criteria => criteria}, :optional => optional}) end