Sha256: 733abbe833b65347238803757e58e9dbbec7c5a1b5e42a3ebc4a5d5929c8ce04

Contents?: true

Size: 1.55 KB

Versions: 8

Compression:

Stored size: 1.55 KB

Contents

module ProconBypassMan
  module RemoteAction
    module RemotePbmJob
      class RunRemotePbmJobDispatchCommand
        # @param [String] action
        # @param [String] uuid
        # @return [void]
        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
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
procon_bypass_man-0.3.12 lib/procon_bypass_man/remote_action/remote_pbm_job/commands/run_remote_pbm_job_dispatch_command.rb
procon_bypass_man-0.3.11 lib/procon_bypass_man/remote_action/remote_pbm_job/commands/run_remote_pbm_job_dispatch_command.rb
procon_bypass_man-0.3.10 lib/procon_bypass_man/remote_action/remote_pbm_job/commands/run_remote_pbm_job_dispatch_command.rb
procon_bypass_man-0.3.9 lib/procon_bypass_man/remote_action/remote_pbm_job/commands/run_remote_pbm_job_dispatch_command.rb
procon_bypass_man-0.3.8.1 lib/procon_bypass_man/remote_action/remote_pbm_job/commands/run_remote_pbm_job_dispatch_command.rb
procon_bypass_man-0.3.8 lib/procon_bypass_man/remote_action/remote_pbm_job/commands/run_remote_pbm_job_dispatch_command.rb
procon_bypass_man-0.3.7 lib/procon_bypass_man/remote_action/remote_pbm_job/commands/run_remote_pbm_job_dispatch_command.rb
procon_bypass_man-0.3.6 lib/procon_bypass_man/remote_action/remote_pbm_job/commands/run_remote_pbm_job_dispatch_command.rb