Class: Bosh::Director::Jobs::DeleteSnapshots
- Defined in:
- lib/bosh/director/jobs/delete_snapshots.rb
Instance Attribute Summary
Attributes inherited from BaseJob
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(snapshots_cids) ⇒ DeleteSnapshots
constructor
A new instance of DeleteSnapshots.
- #perform ⇒ Object
Methods inherited from BaseJob
#begin_stage, #event_log, #logger, perform, #result_file, #single_step_stage, #task_cancelled?, #task_checkpoint, #track_and_log
Constructor Details
#initialize(snapshots_cids) ⇒ DeleteSnapshots
Returns a new instance of DeleteSnapshots.
11 12 13 |
# File 'lib/bosh/director/jobs/delete_snapshots.rb', line 11 def initialize(snapshots_cids) @snapshot_cids = snapshots_cids end |
Class Method Details
.job_type ⇒ Object
7 8 9 |
# File 'lib/bosh/director/jobs/delete_snapshots.rb', line 7 def self.job_type :delete_snapshot end |
Instance Method Details
#perform ⇒ Object
15 16 17 18 19 20 |
# File 'lib/bosh/director/jobs/delete_snapshots.rb', line 15 def perform logger.info("deleting snapshots: #{@snapshot_cids.join(', ')}") snapshots = Bosh::Director::Models::Snapshot.where(snapshot_cid: @snapshot_cids).to_a Bosh::Director::Api::SnapshotManager.delete_snapshots(snapshots) "snapshot(s) #{@snapshot_cids.join(', ')} deleted" end |