Class: Opsicle::ManageableLayer
- Inherits:
-
Object
- Object
- Opsicle::ManageableLayer
- Defined in:
- lib/opsicle/manageable_layer.rb
Instance Attribute Summary collapse
-
#agent_version ⇒ Object
Returns the value of attribute agent_version.
-
#ami_id ⇒ Object
Returns the value of attribute ami_id.
-
#cli ⇒ Object
Returns the value of attribute cli.
-
#ec2 ⇒ Object
Returns the value of attribute ec2.
-
#instances ⇒ Object
Returns the value of attribute instances.
-
#layer_id ⇒ Object
Returns the value of attribute layer_id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#opsworks ⇒ Object
Returns the value of attribute opsworks.
-
#stack ⇒ Object
Returns the value of attribute stack.
-
#subnet_id ⇒ Object
Returns the value of attribute subnet_id.
Instance Method Summary collapse
- #add_new_instance(instance_id) ⇒ Object
- #get_cloneable_instances ⇒ Object
-
#initialize(name, layer_id, stack, opsworks, ec2, cli) ⇒ ManageableLayer
constructor
A new instance of ManageableLayer.
Constructor Details
#initialize(name, layer_id, stack, opsworks, ec2, cli) ⇒ ManageableLayer
5 6 7 8 9 10 11 12 13 |
# File 'lib/opsicle/manageable_layer.rb', line 5 def initialize(name, layer_id, stack, opsworks, ec2, cli) self.name = name self.layer_id = layer_id self.stack = stack self.opsworks = opsworks self.ec2 = ec2 self.cli = cli self.instances = [] end |
Instance Attribute Details
#agent_version ⇒ Object
Returns the value of attribute agent_version.
3 4 5 |
# File 'lib/opsicle/manageable_layer.rb', line 3 def agent_version @agent_version end |
#ami_id ⇒ Object
Returns the value of attribute ami_id.
3 4 5 |
# File 'lib/opsicle/manageable_layer.rb', line 3 def ami_id @ami_id end |
#cli ⇒ Object
Returns the value of attribute cli.
3 4 5 |
# File 'lib/opsicle/manageable_layer.rb', line 3 def cli @cli end |
#ec2 ⇒ Object
Returns the value of attribute ec2.
3 4 5 |
# File 'lib/opsicle/manageable_layer.rb', line 3 def ec2 @ec2 end |
#instances ⇒ Object
Returns the value of attribute instances.
3 4 5 |
# File 'lib/opsicle/manageable_layer.rb', line 3 def instances @instances end |
#layer_id ⇒ Object
Returns the value of attribute layer_id.
3 4 5 |
# File 'lib/opsicle/manageable_layer.rb', line 3 def layer_id @layer_id end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/opsicle/manageable_layer.rb', line 3 def name @name end |
#opsworks ⇒ Object
Returns the value of attribute opsworks.
3 4 5 |
# File 'lib/opsicle/manageable_layer.rb', line 3 def opsworks @opsworks end |
#stack ⇒ Object
Returns the value of attribute stack.
3 4 5 |
# File 'lib/opsicle/manageable_layer.rb', line 3 def stack @stack end |
#subnet_id ⇒ Object
Returns the value of attribute subnet_id.
3 4 5 |
# File 'lib/opsicle/manageable_layer.rb', line 3 def subnet_id @subnet_id end |
Instance Method Details
#add_new_instance(instance_id) ⇒ Object
23 24 25 26 |
# File 'lib/opsicle/manageable_layer.rb', line 23 def add_new_instance(instance_id) instance = @opsworks.describe_instances({ :instance_ids => [instance_id] }).instances.first self.instances << ManageableInstance.new(instance, self, stack, @opsworks, @ec2, @cli) end |
#get_cloneable_instances ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/opsicle/manageable_layer.rb', line 15 def get_cloneable_instances ops_instances = @opsworks.describe_instances({ :layer_id => layer_id }).instances ops_instances.each do |instance| self.instances << ManageableInstance.new(instance, self, stack, @opsworks, @ec2, @cli) end self.instances end |