Class: BigPanda::Client
- Inherits:
-
Object
- Object
- BigPanda::Client
- Defined in:
- lib/bigpanda/bp-api.rb
Overview
Main BigPanda API Class
The client needs to be initialized with the access_token of the organization. Possible options:
-
Pass the access_token as a :access_token parameter
-
Place a bigpanda.yaml file in /etc/ and add to the file - ‘access_token’: YOUR_TOKEN
-
Pass a location of a yaml file using the :file parameter
Defined Under Namespace
Classes: Error, Unauthorized
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#ssl ⇒ Object
readonly
Returns the value of attribute ssl.
Instance Method Summary collapse
- #deployment_end(options = {}) ⇒ Object
- #deployment_start(options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/bigpanda/bp-api.rb', line 30 def initialize( = {}) unless .fetch(:access_token, nil) file = .delete(:file) file_config, config_files = read_config_from_file(file) .merge!(file_config) if file_config end @config = DEFAULT_CONFIGURATION.merge() @ssl = .delete(:ssl) || {} unless @config.fetch(:access_token, nil) raise "No BigPanda config token received, and no configuration file found. Searched: #{config_files.join ','}." end end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
28 29 30 |
# File 'lib/bigpanda/bp-api.rb', line 28 def config @config end |
#ssl ⇒ Object (readonly)
Returns the value of attribute ssl.
28 29 30 |
# File 'lib/bigpanda/bp-api.rb', line 28 def ssl @ssl end |
Instance Method Details
#deployment_end(options = {}) ⇒ Object
50 51 52 |
# File 'lib/bigpanda/bp-api.rb', line 50 def deployment_end( = {}) return deployment_notification config[:deployment_end_path], end |
#deployment_start(options = {}) ⇒ Object
46 47 48 |
# File 'lib/bigpanda/bp-api.rb', line 46 def deployment_start( = {}) return deployment_notification config[:deployment_start_path], end |