Class: Fog::Orchestration::OpenStack::Stack
- Defined in:
- lib/fog/openstack/models/orchestration/stack.rb
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
-
#initialize(attributes) ⇒ Stack
constructor
A new instance of Stack.
- #save ⇒ Object
- #update ⇒ Object
Methods inherited from Model
#inspect, #reload, #symbolize_keys, #to_json, #wait_for
Methods included from Attributes::ClassMethods
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
Methods included from Core::DeprecatedConnectionAccessors
#connection, #connection=, #prepare_service_value
Methods included from Attributes::InstanceMethods
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one
Constructor Details
#initialize(attributes) ⇒ Stack
Returns a new instance of Stack.
21 22 23 24 25 |
# File 'lib/fog/openstack/models/orchestration/stack.rb', line 21 def initialize(attributes) # Old 'connection' is renamed as service and should be used instead prepare_service_value(attributes) super end |
Instance Method Details
#create ⇒ Object
32 33 34 35 36 |
# File 'lib/fog/openstack/models/orchestration/stack.rb', line 32 def create requires :stack_name service.create_stack(stack_name, self.attributes) self end |
#destroy ⇒ Object
44 45 46 47 48 |
# File 'lib/fog/openstack/models/orchestration/stack.rb', line 44 def destroy requires :id service.delete_stack(self.stack_name, self.id) true end |
#save ⇒ Object
27 28 29 30 |
# File 'lib/fog/openstack/models/orchestration/stack.rb', line 27 def save requires :stack_name identity ? update : create end |
#update ⇒ Object
38 39 40 41 42 |
# File 'lib/fog/openstack/models/orchestration/stack.rb', line 38 def update requires :stack_name service.update_stack(stack_name, self.attributes) self end |