Class: Opsicle::CloneableLayer

Inherits:
Object
  • Object
show all
Defined in:
lib/opsicle/cloneable_layer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, layer_id, opsworks, cli) ⇒ CloneableLayer

Returns a new instance of CloneableLayer.



5
6
7
8
9
10
11
# File 'lib/opsicle/cloneable_layer.rb', line 5

def initialize(name, layer_id, opsworks, cli)
  self.name = name
  self.layer_id = layer_id
  self.opsworks = opsworks
  self.cli = cli
  self.instances = []
end

Instance Attribute Details

#cliObject

Returns the value of attribute cli.



3
4
5
# File 'lib/opsicle/cloneable_layer.rb', line 3

def cli
  @cli
end

#instancesObject

Returns the value of attribute instances.



3
4
5
# File 'lib/opsicle/cloneable_layer.rb', line 3

def instances
  @instances
end

#layer_idObject

Returns the value of attribute layer_id.



3
4
5
# File 'lib/opsicle/cloneable_layer.rb', line 3

def layer_id
  @layer_id
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/opsicle/cloneable_layer.rb', line 3

def name
  @name
end

#opsworksObject

Returns the value of attribute opsworks.



3
4
5
# File 'lib/opsicle/cloneable_layer.rb', line 3

def opsworks
  @opsworks
end

Instance Method Details

#get_cloneable_instancesObject



13
14
15
16
17
18
19
# File 'lib/opsicle/cloneable_layer.rb', line 13

def get_cloneable_instances
  ops_instances = @opsworks.describe_instances({ :layer_id => layer_id }).instances
  ops_instances.each do |instance|
    self.instances << CloneableInstance.new(instance, self, @opsworks, @cli)
  end
  self.instances
end