Class: Opsicle::Client
- Inherits:
-
Object
- Object
- Opsicle::Client
- Defined in:
- lib/opsicle/client.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#opsworks ⇒ Object
readonly
Returns the value of attribute opsworks.
-
#s3 ⇒ Object
readonly
Returns the value of attribute s3.
Instance Method Summary collapse
- #api_call(command, options = {}) ⇒ Object
-
#initialize(environment) ⇒ Client
constructor
A new instance of Client.
- #opsworks_url ⇒ Object
- #run_command(command, options = {}) ⇒ Object
Constructor Details
#initialize(environment) ⇒ Client
Returns a new instance of Client.
9 10 11 12 13 14 |
# File 'lib/opsicle/client.rb', line 9 def initialize(environment) @config = Config.new(environment) @config.configure_aws! @opsworks = AWS::OpsWorks.new.client @s3 = AWS::S3.new end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
7 8 9 |
# File 'lib/opsicle/client.rb', line 7 def config @config end |
#opsworks ⇒ Object (readonly)
Returns the value of attribute opsworks.
5 6 7 |
# File 'lib/opsicle/client.rb', line 5 def opsworks @opsworks end |
#s3 ⇒ Object (readonly)
Returns the value of attribute s3.
6 7 8 |
# File 'lib/opsicle/client.rb', line 6 def s3 @s3 end |
Instance Method Details
#api_call(command, options = {}) ⇒ Object
20 21 22 |
# File 'lib/opsicle/client.rb', line 20 def api_call(command, ={}) opsworks.public_send(command, ) end |
#opsworks_url ⇒ Object
24 25 26 |
# File 'lib/opsicle/client.rb', line 24 def opsworks_url "https://console.aws.amazon.com/opsworks/home?#/stack/#{@config.opsworks_config[:stack_id]}" end |
#run_command(command, options = {}) ⇒ Object
16 17 18 |
# File 'lib/opsicle/client.rb', line 16 def run_command(command, ={}) opsworks.create_deployment((command, )) end |