Class: VGH::APPS::Checkpoint
- Inherits:
-
Object
- Object
- VGH::APPS::Checkpoint
- Defined in:
- lib/vgh/apps/checkpoint.rb
Overview
Description:
See Checkpoint Section in the README file.
Usage:
checkpoint = APPS::Checkpoint.new
checkpoint.run
Instance Attribute Summary collapse
-
#snapshot ⇒ Object
readonly
Snapshot Class.
-
#volumes ⇒ Object
readonly
Volumes Class.
Instance Method Summary collapse
-
#initialize ⇒ Checkpoint
constructor
Initialize external classes.
-
#run ⇒ Object
Runs the checkpoint app logic.
Constructor Details
#initialize ⇒ Checkpoint
Initialize external classes
22 23 24 25 |
# File 'lib/vgh/apps/checkpoint.rb', line 22 def initialize @volumes ||= EC2::Volume.new @snapshot = EC2::Snapshot.new end |
Instance Attribute Details
#snapshot ⇒ Object (readonly)
Returns Snapshot Class.
19 20 21 |
# File 'lib/vgh/apps/checkpoint.rb', line 19 def snapshot @snapshot end |
#volumes ⇒ Object (readonly)
Returns Volumes Class.
16 17 18 |
# File 'lib/vgh/apps/checkpoint.rb', line 16 def volumes @volumes end |
Instance Method Details
#run ⇒ Object
Runs the checkpoint app logic
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/vgh/apps/checkpoint.rb', line 28 def run System.lock volumes.list_tagged('CHECKPOINT').map {|vid| snapshot.snap_and_tag( vid, "CHECKPOINT for #{vid}(#{volumes.name_tag(vid)})", { 'Name' => fqdn, 'CHECKPOINT' => "#{vid}" } ) snapshot.purge_checkpoints } System.unlock end |