Sha256: 57fb4a010f93a709ed867c1163015c335a0ad07da897772a6b8155de949fa843

Contents?: true

Size: 1.93 KB

Versions: 5

Compression:

Stored size: 1.93 KB

Contents

= 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}[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 Foreman instance to load the apidoc.json.

Usage:

    bin/generate.rb -h
    Script for generating API bindings for Foreman API from Apipie docs.
        -u, --url FOREMAN_APIDOC_URL     By default http://localhost:3000/apidoc
        -h, --help

Only files under +lib/foreman_api/resources+ are touched by the generator.

=== 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 




Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_api-0.1.3 README.rdoc
foreman_api-0.1.2 README.rdoc
foreman_api-0.1.1 README.rdoc
foreman_api-0.1.0 README.rdoc
foreman_api-0.0.11 README.rdoc