Module | Fog::Compute::Brightbox::Shared
In: | lib/fog/brightbox/compute.rb

### Methods

access_token access_token_available? account authenticating_as_user? default_image get_access_token get_access_token! new refresh_token scoped_account scoped_account= scoped_account_reset

### Included Modules

Fog::Brightbox::OAuth2

### Public Class methods

new(options)

Creates a new instance of the Brightbox Compute service

@note If you create service using just a refresh token when it

      expires the service will no longer be able to authenticate.

@param [Hash] options @option options [String] :brightbox_api_url Override the default (or configured) API endpoint @option options [String] :brightbox_auth_url Override the default (or configured) API authentication endpoint @option options [String] :brightbox_client_id Client identifier to authenticate with (overrides configured) @option options [String] :brightbox_secret Client secret to authenticate with (overrides configured) @option options [String] :brightbox_username Email or user identifier for user based authentication @option options [String] :brightbox_password Password for user based authentication @option options [String] :brightbox_account Account identifier to scope this connection to @option options [String] :connection_options Settings to pass to underlying {Fog::Connection} @option options [Boolean] :persistent Sets a persistent HTTP {Fog::Connection} @option options [String] :brightbox_access_token Sets the OAuth access token to use rather than requesting a new token @option options [String] :brightbox_refresh_token Sets the refresh token to use when requesting a newer access token @option options [String] :brightbox_token_management Overide the existing behaviour to request access tokens if expired (default is `true`)

### Public Instance methods

access_token()

Returns the current access token or nil @return [String,nil]

access_token_available?()

Returns true if an access token is set @return [Boolean]

account()

Returns the scoped account being used for requests

- For API clients this is the owning account
- For User applications this is the account specified by either `account_id` option on the service or the `brightbox_account` setting in your configuration

@return [Fog::Compute::Brightbox::Account]

authenticating_as_user?()

Returns true if authentication is being performed as a user @return [Boolean]

default_image()

Returns an identifier for the default image for use

Currently tries to find the latest version Ubuntu LTS (i686) widening up to the latest, official version of Ubuntu available.

Highly recommended that you actually select the image you want to run on your servers yourself!

@return [String, nil]

get_access_token()

Requests a new access token

@return [String] New access token

get_access_token!()

Requests a new access token and raises if there is a problem

@return [String] New access token @raise [Excon::Errors::BadRequest] The credentials are expired or incorrect

refresh_token()

Returns the current refresh token or nil @return [String,nil]

scoped_account(options_account = nil)

This returns the account identifier that the request should be scoped by based on the options passed to the request and current configuration

@param [String] options_account Any identifier passed into the request

@return [String, nil] The account identifier to scope the request to or nil

scoped_account=(scoped_account)

Sets the scoped account for future requests @param [String] scoped_account Identifier of the account to scope request to

scoped_account_reset()

Resets the scoped account back to intially configured one

[Validate]