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

The Shared module consists of code that was duplicated between the Real and Mock implementations.

Methods

Included Modules

Fog::Brightbox::OAuth2

Constants

API_URL = "https://api.gb1.brightbox.com/"

Attributes

scoped_account  [W] 

Public Class methods

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.

@see Fog::Brightbox::Config#initialize Config object for possible configuration options

@param [Brightbox::Config, Hash] config

  Any configuration to be used for this service. This ideally should be in the newer form
  of a {Brightbox::Config} object but may be a Hash.

Public Instance methods

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

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

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]

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

Returns an identifier for the default image for use

Currently tries to find the latest version of Ubuntu (i686) from Brightbox.

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

@return [String] if image is found, returns the identifier @return [NilClass] if no image is found or an error occurs

Returns the current token expiry time in seconds or nil @return [Number,nil]

Requests a new access token

@return [String] New 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

Returns the current refresh token or nil @return [String,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

Resets the scoped account back to intially configured one

[Validate]