Class: Bosh::Director::Jobs::DeleteStemcell
- Defined in:
- lib/bosh/director/jobs/delete_stemcell.rb
Instance Attribute Summary
Attributes inherited from BaseJob
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, version, options = {}) ⇒ DeleteStemcell
constructor
A new instance of DeleteStemcell.
- #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(name, version, options = {}) ⇒ DeleteStemcell
Returns a new instance of DeleteStemcell.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/bosh/director/jobs/delete_stemcell.rb', line 10 def initialize(name, version, = {}) @name = name @version = version @options = @cloud = Config.cloud @stemcell_manager = Api::StemcellManager.new blobstore = .fetch(:blobstore) { App.instance.blobstores.blobstore } blob_deleter = Helpers::BlobDeleter.new(blobstore, logger) compiled_package_deleter = Helpers::CompiledPackageDeleter.new(blob_deleter, logger) @stemcell_deleter = Helpers::StemcellDeleter.new(@cloud, compiled_package_deleter, logger) end |
Class Method Details
.job_type ⇒ Object
6 7 8 |
# File 'lib/bosh/director/jobs/delete_stemcell.rb', line 6 def self.job_type :delete_stemcell end |
Instance Method Details
#perform ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/bosh/director/jobs/delete_stemcell.rb', line 23 def perform logger.info("Processing delete stemcell") logger.info("Looking up stemcell: #{@name}/#{@version}") stemcell = @stemcell_manager.find_by_name_and_version(@name, @version) logger.info("Found: #{stemcell.pretty_inspect}") @stemcell_deleter.delete(stemcell, @options) "/stemcells/#{@name}/#{@version}" end |