Class: Bosh::Director::ProblemScanner::Scanner
- Defined in:
- lib/bosh/director/problem_scanner/scanner.rb
Instance Method Summary collapse
-
#initialize(deployment) ⇒ Scanner
constructor
A new instance of Scanner.
- #reset(vms = nil) ⇒ Object
- #scan_disks ⇒ Object
- #scan_vms(vms = nil) ⇒ Object
Constructor Details
#initialize(deployment) ⇒ Scanner
Returns a new instance of Scanner.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/bosh/director/problem_scanner/scanner.rb', line 8 def initialize(deployment) @deployment = deployment @agent_disks = {} @instance_manager = Api::InstanceManager.new @logger = Config.logger @event_logger = EventLogger.new(Config.event_log, @logger) @problem_register = ProblemRegister.new(deployment, @logger) end |
Instance Method Details
#reset(vms = nil) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/bosh/director/problem_scanner/scanner.rb', line 20 def reset(vms=nil) if vms vms.each do |job, index| instance = @instance_manager.find_by_name(@deployment, job, index) Models::DeploymentProblem.where( deployment: @deployment, resource_id: instance.id, state: 'open' ).update(state: 'closed') end else Models::DeploymentProblem.where( state: 'open', deployment: @deployment ).update(state: 'closed') end end |
#scan_disks ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/bosh/director/problem_scanner/scanner.rb', line 54 def scan_disks disk_scanner = DiskScanStage.new( @agent_disks, @problem_register, Config.cloud, @deployment.id, @event_logger, @logger ) disk_scanner.scan end |
#scan_vms(vms = nil) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/bosh/director/problem_scanner/scanner.rb', line 40 def scan_vms(vms=nil) vm_scanner = VmScanStage.new( @instance_manager, @problem_register, Config.cloud, @deployment, @event_logger, @logger ) vm_scanner.scan(vms) @agent_disks = vm_scanner.agent_disks end |