Module: RubyAemAws::SnapshotVerifier
- Included in:
- Component::AuthorDispatcher, Component::AuthorPrimary, Component::AuthorPublishDispatcher, Component::AuthorStandby, Component::ChaosMonkey, Component::Orchestrator, Component::PreviewPublish, Component::PreviewPublishDispatcher, Component::Publish, Component::PublishDispatcher
- Defined in:
- lib/ruby_aem_aws/mixins/snapshot_verifier.rb
Overview
Mixin for checking snapshots of a component via EC2 client Add this to a component to make it capable of determining its own snapshots.
Instance Method Summary collapse
-
#snapshot?(snapshot_id) ⇒ Boolean
True if snapshot exists, nil if no snapshot exists.
-
#snapshots?(snapshot_type) ⇒ Boolean
True if snapshots exist, false is no snapshots exist.
Instance Method Details
#snapshot?(snapshot_id) ⇒ Boolean
Returns true if snapshot exists, nil if no snapshot exists.
21 22 23 |
# File 'lib/ruby_aem_aws/mixins/snapshot_verifier.rb', line 21 def snapshot?(snapshot_id) return true unless get_snapshot_by_id(snapshot_id).nil? end |
#snapshots?(snapshot_type) ⇒ Boolean
Returns true if snapshots exist, false is no snapshots exist.
27 28 29 30 31 32 33 34 35 |
# File 'lib/ruby_aem_aws/mixins/snapshot_verifier.rb', line 27 def snapshots?(snapshot_type) has_snapshot = false get_snapshots_by_type(snapshot_type).each do |s| next if s.nil? has_snapshot = true end has_snapshot end |