Class: Katello::Resources::Candlepin::Pool
Instance Attribute Summary
Attributes inherited from HttpResource
#json
Class Method Summary
collapse
default_headers, logger, name_to_key
#[], #[]=, create_thing, delete, get, hash_to_query, #initialize, join_path, logger, post, print_debug_info, process_response, put, raise_rest_client_exception, rest_client, url_encode
Class Method Details
.destroy(id) ⇒ Object
516
517
518
519
|
# File 'app/lib/katello/resources/candlepin.rb', line 516
def destroy(id)
fail ArgumentError, "pool id has to be specified" unless id
self.delete(path(id), self.).code.to_i
end
|
.find(pool_id) ⇒ Object
502
503
504
505
506
|
# File 'app/lib/katello/resources/candlepin.rb', line 502
def find(pool_id)
pool_json = self.get(path(pool_id), self.).body
fail ArgumentError, "pool id cannot contain ?" if pool_id["?"]
JSON.parse(pool_json).with_indifferent_access
end
|
.get_for_owner(owner_key, include_temporary_guests = false) ⇒ Object
508
509
510
511
512
513
514
|
# File 'app/lib/katello/resources/candlepin.rb', line 508
def get_for_owner(owner_key, include_temporary_guests = false)
url_path = "/candlepin/owners/#{owner_key}/pools"
url_params = "?attribute=unmapped_guests_only:!true"
url = include_temporary_guests ? url_path : url_path + url_params
pools_json = self.get(url, self.).body
JSON.parse(pools_json)
end
|
.path(id = nil) ⇒ Object
521
522
523
|
# File 'app/lib/katello/resources/candlepin.rb', line 521
def path(id = nil)
"/candlepin/pools/#{id}"
end
|