Class: Katello::Resources::Candlepin::Subscription
Constant Summary
Constants inherited
from HttpResource
HttpResource::REQUEST_MAP
Instance Attribute Summary
Attributes inherited from HttpResource
#json
Class Method Summary
collapse
default_headers, fetch_paged, included_list, logger, name_to_key, process_response, raise_rest_client_exception
#[], #[]=, hash_to_query, #initialize, issue_request, join_path, logger, process_response, raise_rest_client_exception, rest_client
#filter_sensitive_data
Class Method Details
.destroy(subscription_id) ⇒ Object
6
7
8
9
|
# File 'app/lib/katello/resources/candlepin/subscription.rb', line 6
def destroy(subscription_id)
fail ArgumentError, "subscription id has to be specified" unless subscription_id
self.delete(path(subscription_id), self.).code.to_i
end
|
.get(id = nil) ⇒ Object
11
12
13
14
|
# File 'app/lib/katello/resources/candlepin/subscription.rb', line 11
def get(id = nil)
content_json = super(path(id), self.).body
JSON.parse(content_json)
end
|
.get_for_owner(owner_key, included = []) ⇒ Object
16
17
18
19
20
21
22
|
# File 'app/lib/katello/resources/candlepin/subscription.rb', line 16
def get_for_owner(owner_key, included = [])
content_json = Candlepin::CandlepinResource.get(
"/candlepin/owners/#{owner_key}/subscriptions?#{included_list(included)}",
self.
).body
JSON.parse(content_json)
end
|
.path(id = nil) ⇒ Object
24
25
26
|
# File 'app/lib/katello/resources/candlepin/subscription.rb', line 24
def path(id = nil)
"/candlepin/subscriptions/#{id}"
end
|