Class: Bosh::Director::Jobs::CreateSnapshot
- Defined in:
- lib/bosh/director/jobs/create_snapshot.rb
Instance Attribute Summary
Attributes inherited from BaseJob
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(instance_id, options) ⇒ CreateSnapshot
constructor
A new instance of CreateSnapshot.
- #perform ⇒ Object
Methods inherited from BaseJob
#begin_stage, #dns_manager, #event_manager, #logger, perform, #result_file, schedule_message, #single_step_stage, #task_cancelled?, #task_checkpoint, #track_and_log, #username
Constructor Details
#initialize(instance_id, options) ⇒ CreateSnapshot
Returns a new instance of CreateSnapshot.
11 12 13 14 |
# File 'lib/bosh/director/jobs/create_snapshot.rb', line 11 def initialize(instance_id, ) @instance = Bosh::Director::Api::InstanceManager.new.find_instance(instance_id) @options = end |
Class Method Details
.job_type ⇒ Object
7 8 9 |
# File 'lib/bosh/director/jobs/create_snapshot.rb', line 7 def self.job_type :create_snapshot end |
Instance Method Details
#perform ⇒ Object
16 17 18 19 20 |
# File 'lib/bosh/director/jobs/create_snapshot.rb', line 16 def perform logger.info("taking snapshot of: #{@instance.job}/#{@instance.index} (#{@instance.vm_cid})") snapshot_cids = Bosh::Director::Api::SnapshotManager.take_snapshot(@instance, @options) "snapshot(s) #{snapshot_cids.join(', ')} created" end |