GetActionToExecute returns the action to execute specified with action ID
(actionID, commandName string, monitoringRetries uint)
| 15 | |
| 16 | // GetActionToExecute returns the action to execute specified with action ID |
| 17 | func GetActionToExecute(actionID, commandName string, monitoringRetries uint) Action { |
| 18 | switch actionID { |
| 19 | case "abort": |
| 20 | action := newAction(actionID, VerbosityLevelVERBOSE) |
| 21 | return &action |
| 22 | case "retry": |
| 23 | action := newMonitoringAction(actionID, commandName, VerbosityLevelVERBOSE, monitoringRetries) |
| 24 | return &action |
| 25 | case "resume": |
| 26 | action := newMonitoringAction(actionID, commandName, VerbosityLevelVERBOSE, monitoringRetries) |
| 27 | return &action |
| 28 | case "monitor": |
| 29 | return &MonitorAction{ |
| 30 | commandName: commandName, |
| 31 | monitoringRetries: monitoringRetries, |
| 32 | } |
| 33 | } |
| 34 | return nil |
| 35 | } |
| 36 | |
| 37 | func GetNoRetriesActionToExecute(actionID, commandName string) Action { |
| 38 | return GetActionToExecute(actionID, commandName, 0) |
no test coverage detected