Class: Opsicle::OpsworksAdapter
- Inherits:
-
Object
- Object
- Opsicle::OpsworksAdapter
- Defined in:
- lib/opsicle/opsworks_adapter.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #associate_elastic_ip(elastic_ip, target_instance_id) ⇒ Object
- #delete_instance(instance_id) ⇒ Object
- #elastic_ips(stack_id) ⇒ Object
-
#initialize(opsicle_client) ⇒ OpsworksAdapter
constructor
A new instance of OpsworksAdapter.
- #instance(instance_id) ⇒ Object
- #instances_by_layer(layer_id) ⇒ Object
- #instances_by_stack(stack_id) ⇒ Object
- #layer(layer_id) ⇒ Object
- #layers(stack_id) ⇒ Object
- #stack(stack_id) ⇒ Object
- #start_instance(instance_id) ⇒ Object
- #stop_instance(instance_id) ⇒ Object
Constructor Details
#initialize(opsicle_client) ⇒ OpsworksAdapter
Returns a new instance of OpsworksAdapter.
4 5 6 |
# File 'lib/opsicle/opsworks_adapter.rb', line 4 def initialize(opsicle_client) @client = opsicle_client.opsworks end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
2 3 4 |
# File 'lib/opsicle/opsworks_adapter.rb', line 2 def client @client end |
Instance Method Details
#associate_elastic_ip(elastic_ip, target_instance_id) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/opsicle/opsworks_adapter.rb', line 36 def associate_elastic_ip(elastic_ip, target_instance_id) client.associate_elastic_ip( elastic_ip: elastic_ip, instance_id: target_instance_id ) end |
#delete_instance(instance_id) ⇒ Object
51 52 53 |
# File 'lib/opsicle/opsworks_adapter.rb', line 51 def delete_instance(instance_id) client.delete_instance(instance_id: instance_id) end |
#elastic_ips(stack_id) ⇒ Object
32 33 34 |
# File 'lib/opsicle/opsworks_adapter.rb', line 32 def elastic_ips(stack_id) client.describe_elastic_ips(stack_id: stack_id).elastic_ips end |
#instance(instance_id) ⇒ Object
28 29 30 |
# File 'lib/opsicle/opsworks_adapter.rb', line 28 def instance(instance_id) client.describe_instances(instance_ids: [ instance_id ]).instances.first end |
#instances_by_layer(layer_id) ⇒ Object
24 25 26 |
# File 'lib/opsicle/opsworks_adapter.rb', line 24 def instances_by_layer(layer_id) client.describe_instances(layer_id: layer_id).instances end |
#instances_by_stack(stack_id) ⇒ Object
20 21 22 |
# File 'lib/opsicle/opsworks_adapter.rb', line 20 def instances_by_stack(stack_id) client.describe_instances(stack_id: stack_id).instances end |
#layer(layer_id) ⇒ Object
16 17 18 |
# File 'lib/opsicle/opsworks_adapter.rb', line 16 def layer(layer_id) client.describe_layers(layer_ids: [ layer_id ]).layers.first end |
#layers(stack_id) ⇒ Object
12 13 14 |
# File 'lib/opsicle/opsworks_adapter.rb', line 12 def layers(stack_id) client.describe_layers(stack_id: stack_id).layers end |
#stack(stack_id) ⇒ Object
8 9 10 |
# File 'lib/opsicle/opsworks_adapter.rb', line 8 def stack(stack_id) client.describe_stacks(stack_ids: [ stack_id ]).stacks.first end |
#start_instance(instance_id) ⇒ Object
43 44 45 |
# File 'lib/opsicle/opsworks_adapter.rb', line 43 def start_instance(instance_id) client.start_instance(instance_id: instance_id) end |
#stop_instance(instance_id) ⇒ Object
47 48 49 |
# File 'lib/opsicle/opsworks_adapter.rb', line 47 def stop_instance(instance_id) client.stop_instance(instance_id: instance_id) end |