Class: Fog::Rackspace::Orchestration::Resources

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/rackspace/models/orchestration/resources.rb

Instance Method Summary collapse

Instance Method Details

#all(stack, options = {}) ⇒ Object


13
14
15
16
# File 'lib/fog/rackspace/models/orchestration/resources.rb', line 13

def all(stack, options={})
  data = service.list_resources(stack, options).body['resources']
  load(data)
end

#get(resource_name, stack = nil) ⇒ Object


18
19
20
21
22
23
24
# File 'lib/fog/rackspace/models/orchestration/resources.rb', line 18

def get(resource_name, stack=nil)
  stack = self.first.stack if stack.nil?
  data  = service.show_resource_data(stack.stack_name, stack.id, resource_name).body['resource']
  new(data)
rescue Fog::Rackspace::Orchestration::NotFound
  nil
end

#metadata(stack_name, stack_id, resource_name) ⇒ Object


26
27
28
29
30
# File 'lib/fog/rackspace/models/orchestration/resources.rb', line 26

def (stack_name, stack_id, resource_name)
  service.(stack_name, stack_id, resource_name).body['resource']
rescue Fog::Rackspace::Orchestration::NotFound
  nil
end

#typesObject


9
10
11
# File 'lib/fog/rackspace/models/orchestration/resources.rb', line 9

def types
  service.list_resource_types.body['resource_types'].sort
end