Created
April 25, 2018 13:56
-
-
Save mccun934/9eb9881bd903c724d5ddf32f64a1fec5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'yaml' | |
require 'oauth' | |
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE | |
katello_config = YAML.load_file('/etc/foreman/plugins/katello.yaml') | |
consumer_key = katello_config[:katello][:candlepin][:oauth_key] | |
consumer_secret = katello_config[:katello][:candlepin][:oauth_secret] | |
consumer = OAuth::Consumer.new( | |
consumer_key, | |
consumer_secret, | |
:site => "https://localhost:8443", | |
:request_token_path => "", | |
:authorize_path => "", | |
:access_token_path => "", | |
:http_method => :get | |
) | |
oauth_access = OAuth::AccessToken.new consumer | |
puts oauth_access.get("/candlepin/admin/queues").body | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment