Katello API bindings for Ruby
Summary
require 'katello_api'
environments = KatelloApi::Resources::Environment.new(:base_url => 'http://localhost:3000',
:username => 'admin',
:password => 'changeme')
data, raw_response architectures.index(:organization_id => "ACME_Corporation")
pp data # parsed data of the response
pp raw_response # raw string of the response body
Description
This gem contains Katello API bindings for the Ruby language. The bindings are generated from API documentation using Apidoc[https://github.com/Pajk/apipie-rails] tool.
The bindings brings support for new versioned API which is not complete yet. The number of supported controllers is limited but more are coming soon.
Regenerating bindings
The code for generating the bindings is a part of this repo. The generator needs a running Katello instance to load the apidoc.json.
Usage:
bin/generate.rb -h
Script for API bindings for Katello API from Apipie docs.
-u, --url KATELLO_APIDOC_URL By default http://localhost:3000/apidoc
-h, --help
Only files under lib/katello_api/resources are touched by the generator.
Authentication
Katello API supports authentication with username/password and OAuth. For use of OAuth with the bindings you only have to change the params
environments = KatelloApi::Resources::Environment.new(:base_url => 'http://localhost:3000',
:oauth => { :consumer_key => 'mykey',
:consumer_secret => 'shhhh' })
License
The bindings are released under MIT license