Class: Omc::Stack

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/omc/stack.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account, attributes) ⇒ Stack

Returns a new instance of Stack.



14
15
16
17
# File 'lib/omc/stack.rb', line 14

def initialize , attributes
  @account = 
  @attributes = attributes
end

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



8
9
10
# File 'lib/omc/stack.rb', line 8

def 
  @account
end

#attributesObject (readonly)

Returns the value of attribute attributes.



8
9
10
# File 'lib/omc/stack.rb', line 8

def attributes
  @attributes
end

Instance Method Details

#appsObject



23
24
25
# File 'lib/omc/stack.rb', line 23

def apps
  @apps ||= describe(:apps).map{ |app| App.new(self, app) }
end

#execute_recipes(app, recipes: [], name: "execute_recipes") ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/omc/stack.rb', line 31

def execute_recipes(app, recipes: [], name: "execute_recipes")
  client.create_deployment(
    stack_id: self[:stack_id],
    app_id: app[:app_id],
    command: {
      name: name,
      args: {
        "recipes" => recipes
      }
    }
  )
end

#instancesObject



19
20
21
# File 'lib/omc/stack.rb', line 19

def instances
  @instances ||= describe(:instances).map{ |instance| Instance.new(self, instance) }
end

#layersObject



27
28
29
# File 'lib/omc/stack.rb', line 27

def layers
  @layers ||= describe(:layers).map{ |layer| Layer.new(self, layer) }
end