class Bosh::Director::Jobs::DeleteSnapshots

Public Class Methods

job_type() click to toggle source
# File lib/bosh/director/jobs/delete_snapshots.rb, line 7
def self.job_type
  :delete_snapshot
end
new(snapshots_cids) click to toggle source
# File lib/bosh/director/jobs/delete_snapshots.rb, line 11
def initialize(snapshots_cids)
  @snapshot_cids = snapshots_cids
end

Public Instance Methods

perform() click to toggle source
# 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