Class: Katello::Resources::Candlepin::Entitlement

Inherits:
CandlepinResource show all
Defined in:
app/lib/katello/resources/candlepin.rb

Instance Attribute Summary

Attributes inherited from HttpResource

#json

Class Method Summary collapse

Methods inherited from CandlepinResource

default_headers, logger, name_to_key

Methods inherited from HttpResource

#[], #[]=, create_thing, delete, hash_to_query, #initialize, join_path, logger, post, print_debug_info, process_response, put, raise_rest_client_exception, rest_client, url_encode

Constructor Details

This class inherits a constructor from Katello::HttpResource

Class Method Details

.get(id = nil, params = '') ⇒ Object



718
719
720
721
# File 'app/lib/katello/resources/candlepin.rb', line 718

def get(id = nil, params = '')
  json = Candlepin::CandlepinResource.get(path(id) + params, self.default_headers).body
  JSON.parse(json)
end

.path(id = nil) ⇒ Object



723
724
725
# File 'app/lib/katello/resources/candlepin.rb', line 723

def path(id = nil)
  "/candlepin/entitlements/#{id}"
end

.regenerate_entitlement_certificates_for_product(product_id) ⇒ Object



714
715
716
# File 'app/lib/katello/resources/candlepin.rb', line 714

def regenerate_entitlement_certificates_for_product(product_id)
  self.put("/candlepin/entitlements/product/#{product_id}", nil, self.default_headers).code.to_i
end