This is the API used by Trader to find resources to the OnApp Market.
It is assumed that any user of this API will have
Been assigned an appropriate user ID / API key
Have been given a suitable role wihin the market
It is also assumed that each ‘control panel’ enabled for the market, will have had it’s IP address added as a white list entry for the given user ID
It is assumed billing data will be accessible through a different API
API used to manage this resource
Find resource which match the specified queries.
resource_query - nil or OnappMarket::API::Query::Operator or OnappMarket::API::Query::Comparator
pricing_query - nil or OnappMarket::API::Query::Operator or OnappMarket::API::Query::Comparator
offset - Offest into data set for pagination
limit - Limit into data set for pagination
OnappMarket::API::Response - data will contain Array of matching resources, pricing and templates if is_ok?
trader, admin
# File lib/onapp_market/search.rb, line 42 def find(resource_query = nil, pricing_query = nil, offset = 0, limit = -1) resource_query = OnappMarket::API::Query::NilOperator.new if resource_query == nil pricing_query = OnappMarket::API::Query::NilOperator.new if pricing_query == nil resource_json = OnappMarket::API::Query::to_json(resource_query) pricing_json = OnappMarket::API::Query::to_json(pricing_query) @api.post("/resource/search", {:resource_query => resource_json.to_s, :pricing_query => pricing_json.to_s, :offset => offset, :limit => limit}) end
Find compute resources and templates which match a given template query
template_query - OnappMarket::API::Query::Operator or OnappMarket::API::Query::Comparator
offset - Offest into data set for pagination
limit - Limit into data set for pagination
OnappMarket::API::Response - data will contain Array of matching resources, pricing and templates if is_ok?
trader, admin
# File lib/onapp_market/search.rb, line 60 def find_by_template(template_query = nil, offset = 0, limit = -1) template_json = OnappMarket::API::Query::to_json(template_query) @api.post("/compute/template_search", {:template_query => template_json.to_s, :offset => offset, :limit => limit}) end