Ruby bindings for Forman's rest API
Ruby
Switch branches/tags
Nothing to show
Pull request Compare This branch is 77 commits behind theforeman:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
Gemfile
MIT-LICENSE
README.rdoc
Rakefile
foreman_api.gemspec
rubygem-foreman_api.spec

README.rdoc

Foreman API bindings for Ruby

Summary

require 'foreman_api'
architectures = ForemanApi::Resources::Architecture.new(:base_url => 'http://localhost:3000', 
                                                        :username => 'admin', 
                                                        :password => 'changeme')

pp architectures.index
[[{"architecture"=>{"id"=>5, "name"=>"i386"}},
  {"architecture"=>{"id"=>9, "name"=>"ppc"}},
  {"architecture"=>{"id"=>14, "name"=>"x86_64"}}],
 "[{\"architecture\":{\"name\":\"i386\",\"id\":5}},{\"architecture\":{\"name\":\"ppc\",\"id\":9}},{\"architecture\":{\"name\":\"x86_64\",\"id\":14}}]"]
=> nil

Description

This gem contains Foreman API bindings for the Ruby language. The bindings are generated from API documentation using Apidoc tool.

The bindings brings support for new versioned API which is not complete yet. The number of supported controllers is limited but more are comming soon.

Authentication

Foreman API supports authentication with username/password and OAuth. For use of OAuth with the bindings you only have to change the params

architectures = ForemanApi::Resources::Architecture.new(:base_url => 'http://localhost:3000', 
                                                        :oauth    => { :consumer_key    => 'mykey',
                                                                       :consumer_secret => 'shhhh' })

License

The bindings are released under MIT license