Class: ProconBypassMan::RemoteAction::RemotePbmJob::RunRemotePbmJobDispatchCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/procon_bypass_man/remote_action/remote_pbm_job/commands/run_remote_pbm_job_dispatch_command.rb

Class Method Summary collapse

Class Method Details

.execute(action:, uuid:, job_args:) ⇒ void

This method returns an undefined value.

Parameters:

  • action (String)
  • uuid (String)


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/procon_bypass_man/remote_action/remote_pbm_job/commands/run_remote_pbm_job_dispatch_command.rb', line 8

def self.execute(action: , uuid: , job_args: )
  case action
  when ProconBypassMan::RemoteAction::RemotePbmJob::ACTION_CHANGE_PBM_VERSION
    ProconBypassMan::RemoteAction::RemotePbmJob::ChangePbmVersionAction.new(pbm_job_uuid: uuid).run!(job_args: job_args)
  when ProconBypassMan::RemoteAction::RemotePbmJob::ACTION_STOP_PBM
    ProconBypassMan::RemoteAction::RemotePbmJob::StopPbmJob.new(pbm_job_uuid: uuid).run!(job_args: {})
  when ProconBypassMan::RemoteAction::RemotePbmJob::ACTION_REBOOT_OS
    ProconBypassMan::RemoteAction::RemotePbmJob::RebootOsAction.new(pbm_job_uuid: uuid).run!(job_args: {})
  when ProconBypassMan::RemoteAction::RemotePbmJob::ACTION_RESTORE_SETTING
    ProconBypassMan::RemoteAction::RemotePbmJob::RestorePbmSettingAction.new(pbm_job_uuid: uuid).run!(job_args: job_args)
  when ProconBypassMan::RemoteAction::RemotePbmJob::ACTION_REPORT_PORCON_STATUS
    ProconBypassMan::RemoteAction::RemotePbmJob::ReportProconStatusAction.new(pbm_job_uuid: uuid).run!(job_args: {})
  else
    raise "#{action}は対応していないアクションです"
  end
rescue ProconBypassMan::RemoteAction::RemotePbmJob::ActionUnexpectedError => e
  ProconBypassMan::SendErrorCommand.execute(error: e)
end