Class: Miasma::Models::Orchestration::Stack
- Inherits:
-
Types::Model
- Object
- Types::Data
- Types::Model
- Miasma::Models::Orchestration::Stack
- Includes:
- Bogo::Memoization
- Defined in:
- lib/miasma/models/orchestration/stack.rb,
lib/miasma/models/orchestration/event.rb,
lib/miasma/models/orchestration/events.rb,
lib/miasma/models/orchestration/resource.rb,
lib/miasma/models/orchestration/resources.rb
Overview
Abstract server
Defined Under Namespace
Classes: Event, Events, Output, Resource, Resources
Instance Attribute Summary
Attributes inherited from Types::Model
Instance Method Summary collapse
- #events ⇒ Events
-
#load_data(args = {}) ⇒ Object
Overload the loader so we can extract resources, events, and outputs.
-
#reload ⇒ self
Override to scrub custom caches.
- #resources ⇒ Resources
-
#save ⇒ Object
Always perform save.
-
#validate ⇒ TrueClass
Validate the stack template.
Methods inherited from Types::Model
#destroy, from_json, #id?, #initialize, #persisted?
Methods included from Utils::ApiMethoding
Methods inherited from Types::Data
from_json, #from_json, #initialize, #to_json
Constructor Details
This class inherits a constructor from Miasma::Types::Model
Instance Method Details
#events ⇒ Events
93 94 95 96 97 |
# File 'lib/miasma/models/orchestration/stack.rb', line 93 def events memoize(:events) do Events.new(self) end end |
#load_data(args = {}) ⇒ Object
Overload the loader so we can extract resources, events, and outputs
59 60 61 62 63 64 65 66 67 68 |
# File 'lib/miasma/models/orchestration/stack.rb', line 59 def load_data(args={}) args = args.to_smash @resources = (args.delete(:resources) || []).each do |r| Resource.new(r) end @events = (args.delete(:events) || []).each do |e| Event.new(e) end super args end |
#reload ⇒ self
Override to scrub custom caches
81 82 83 84 85 86 87 88 89 90 |
# File 'lib/miasma/models/orchestration/stack.rb', line 81 def reload clear_memoizations! remove = data.keys.find_all do |k| ![:id, :name].include?(k.to_sym) end remove.each do |k| data.delete(k) end super end |
#resources ⇒ Resources
100 101 102 103 104 |
# File 'lib/miasma/models/orchestration/stack.rb', line 100 def resources memoize(:resources) do Resources.new(self) end end |
#save ⇒ Object
Always perform save. Remove dirty check provided by default.
108 109 110 |
# File 'lib/miasma/models/orchestration/stack.rb', line 108 def save perform_save end |
#validate ⇒ TrueClass
Validate the stack template
74 75 76 |
# File 'lib/miasma/models/orchestration/stack.rb', line 74 def validate perform_template_validate end |