Sha256: ad1756e1241e553805af11640de26f60b2d665a51920f47bf65ff20fc158255d
Contents?: true
Size: 1.48 KB
Versions: 31
Compression:
Stored size: 1.48 KB
Contents
module Katello module Resources module Candlepin class UpstreamConsumer < UpstreamCandlepinResource extend ConsumerResource class << self def path(id = upstream_consumer_id) super(id) end def remove_entitlement(entitlement_id) fail ArgumentError, "No entitlement ID given to remove." if entitlement_id.blank? self["entitlements/#{entitlement_id}"].delete end def export(url, client_cert, client_key, ca_file) logger.debug "Sending GET request to upstream Candlepin: #{url}" return resource(url, client_cert, client_key, ca_file).get rescue RestClient::Exception => e raise e end def update(url, client_cert, client_key, ca_file, attributes) logger.debug "Sending POST request to upstream Candlepin: #{url} #{attributes.to_json}" return resource(url, client_cert, client_key, ca_file).put(attributes.to_json, 'accept' => 'application/json', 'accept-language' => I18n.locale, 'content-type' => 'application/json') end def bind_entitlement(**pool) JSON.parse(self['entitlements'].post(nil, params: pool)) end end end end end end
Version data entries
31 entries across 31 versions & 1 rubygems