Module: Rancher

Extended by:
Configurable
Defined in:
lib/rancher.rb,
lib/rancher/type.rb,
lib/rancher/error.rb,
lib/rancher/client.rb,
lib/rancher/default.rb,
lib/rancher/version.rb,
lib/rancher/classify.rb,
lib/rancher/resource.rb,
lib/rancher/arguments.rb,
lib/rancher/collection.rb,
lib/rancher/connection.rb,
lib/rancher/configurable.rb,
lib/rancher/authentication.rb,
lib/rancher/response/raise_error.rb,
lib/rancher/middleware/follow_redirects.rb

Overview

Adapted from lostisland/faraday_middleware. Trimmed down to just the logic that we need for Rancher.rb.

github.com/lostisland/faraday_middleware/blob/138766e/lib/faraday_middleware/response/follow_redirects.rb

Defined Under Namespace

Modules: Authentication, Classify, Configurable, Connection, Default, Middleware, Response Classes: AbuseDetected, ApplicationCredentialsRequired, Arguments, BadGateway, BadRequest, Client, ClientError, Collection, Conflict, Error, Forbidden, InternalServerError, MethodNotAllowed, MissingContentType, NotAcceptable, NotFound, NotImplemented, OneTimePasswordRequired, RepositoryUnavailable, Resource, ServerError, ServiceUnavailable, TooManyLoginAttempts, TooManyRequests, Type, Unauthorized, UnprocessableEntity, UnsupportedMediaType

Constant Summary collapse

MAJOR =

Current major release.

Returns:

  • (Integer)
0
MINOR =

Current minor release.

Returns:

  • (Integer)
1
PATCH =

Current patch level.

Returns:

  • (Integer)
2
VERSION =

Full release version.

Returns:

  • (String)
[MAJOR, MINOR, PATCH].join('.').freeze

Instance Attribute Summary

Attributes included from Configurable

#access_key, #api_endpoint, #connection_options, #default_media_type, #middleware, #proxy, #secret_key, #user_agent

Class Method Summary collapse

Methods included from Configurable

configure, keys, reset!, same_options?

Class Method Details

.clientRancher::Client

API client based on configured options Configurable

Returns:



11
12
13
14
# File 'lib/rancher.rb', line 11

def client
  return @client if defined?(@client) && @client.same_options?(options)
  @client = Rancher::Client.new(options)
end