Method: Runcible::Instance#initialize

Defined in:
lib/runcible/instance.rb

#initialize(config = {}) ⇒ Instance

Initialize a Runcible instance

Parameters:

  • (defaults to: {})
  • a customizable set of options

Options Hash (config):

  • :user (String)

    Pulp username

  • :oauth (String)

    Oauth credentials

  • :headers (Hash)

    Additional headers e.g. content-type => “application/json”

  • :url (String)

    Scheme and hostname for the pulp server e.g. localhost/

  • :api_path (String)

    URL path for the api e.g. pulp/api/v2/

  • :timeout (String)

    Timeout in seconds for the connection (defaults to rest client’s default)

  • :open_timeout (String)

    timeout in seconds for the connection to open(defaults to rest client’s default)

  • :http_auth (Hash)

    Needed when using simple http auth



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/runcible/instance.rb', line 19

def initialize(config = {})
  @config = {
    :api_path   => '/pulp/api/v2/',
    :url        => 'https://localhost',
    :user       => '',
    :http_auth  => {:password => {} },
    :headers    => {:content_type => 'application/json',
                    :accept       => 'application/json'},
    :logging    => {}
  }.merge(config).with_indifferent_access

  initialize_wrappers
end