Class: Bosh::Director::Jobs::FetchLogs
- Includes:
- LockHelper
- Defined in:
- lib/bosh/director/jobs/fetch_logs.rb
Instance Attribute Summary
Attributes inherited from BaseJob
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(instance_id, options = {}) ⇒ FetchLogs
constructor
A new instance of FetchLogs.
- #perform ⇒ Object
Methods included from LockHelper
#with_compile_lock, #with_deployment_lock, #with_release_lock, #with_release_locks, #with_stemcell_lock
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 = {}) ⇒ FetchLogs
Returns a new instance of FetchLogs.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/bosh/director/jobs/fetch_logs.rb', line 12 def initialize(instance_id, = {}) @instance_id = instance_id @log_type = ["type"] || "job" @filters = ["filters"] @instance_manager = Api::InstanceManager.new blobstore = .fetch(:blobstore) { App.instance.blobstores.blobstore } log_bundles_cleaner = LogBundlesCleaner.new(blobstore, 60 * 60 * 24 * 10, logger) # 10 days @logs_fetcher = LogsFetcher.new(@instance_manager, log_bundles_cleaner, logger) end |
Class Method Details
.job_type ⇒ Object
8 9 10 |
# File 'lib/bosh/director/jobs/fetch_logs.rb', line 8 def self.job_type :fetch_logs end |
Instance Method Details
#perform ⇒ Object
23 24 25 26 27 |
# File 'lib/bosh/director/jobs/fetch_logs.rb', line 23 def perform instance = @instance_manager.find_instance(@instance_id) @logs_fetcher.fetch(instance, @log_type, @filters) end |