Class: Fog::Orchestration::OpenStack::Resources
- Inherits:
-
Collection
- Object
- Collection
- Fog::Orchestration::OpenStack::Resources
- Defined in:
- lib/fog/openstack/models/orchestration/resources.rb
Instance Method Summary collapse
- #all(stack, options = {}) ⇒ Object
- #get(resource_name, stack = nil) ⇒ Object
- #metadata(stack_name, stack_id, resource_name) ⇒ Object
- #types ⇒ Object
Instance Method Details
#all(stack, options = {}) ⇒ Object
13 14 15 16 |
# File 'lib/fog/openstack/models/orchestration/resources.rb', line 13 def all(stack, ={}) data = service.list_resources(stack, ).body['resources'] load(data) end |
#get(resource_name, stack = nil) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/fog/openstack/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::Compute::OpenStack::NotFound nil end |
#metadata(stack_name, stack_id, resource_name) ⇒ Object
26 27 28 29 30 |
# File 'lib/fog/openstack/models/orchestration/resources.rb', line 26 def (stack_name, stack_id, resource_name) service.(stack_name, stack_id, resource_name).body['resource'] rescue Fog::Compute::OpenStack::NotFound nil end |
#types ⇒ Object
9 10 11 |
# File 'lib/fog/openstack/models/orchestration/resources.rb', line 9 def types service.list_resource_types.body['resource_types'].sort end |