Class: Bosh::Director::Jobs::SnapshotDeployments
- Defined in:
- lib/bosh/director/jobs/snapshot_deployments.rb
Instance Attribute Summary
Attributes inherited from BaseJob
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ SnapshotDeployments
constructor
A new instance of SnapshotDeployments.
- #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(options = {}) ⇒ SnapshotDeployments
Returns a new instance of SnapshotDeployments.
10 11 12 |
# File 'lib/bosh/director/jobs/snapshot_deployments.rb', line 10 def initialize(={}) @snapshot_manager = .fetch(:snapshot_manager) { Bosh::Director::Api::SnapshotManager.new } end |
Class Method Details
.job_type ⇒ Object
6 7 8 |
# File 'lib/bosh/director/jobs/snapshot_deployments.rb', line 6 def self.job_type :snapshot_deployments end |
Instance Method Details
#perform ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/bosh/director/jobs/snapshot_deployments.rb', line 14 def perform tasks = Models::Deployment.all.map do |deployment| @snapshot_manager.create_deployment_snapshot_task('scheduler', deployment) end "Enqueued snapshot tasks [#{tasks.map(&:id).join(', ')}]" end |