ExecuteAction executes the action over the process specified with operationID
(operationID, actionID string, retries uint, host string, cfTarget util.CloudFoundryTarget)
| 175 | |
| 176 | // ExecuteAction executes the action over the process specified with operationID |
| 177 | func (c *BaseCommand) ExecuteAction(operationID, actionID string, retries uint, host string, cfTarget util.CloudFoundryTarget) ExecutionStatus { |
| 178 | mtaClient := c.NewMtaClient(host, cfTarget) |
| 179 | |
| 180 | // find ongoing operation by the specified operationID |
| 181 | ongoingOperation, err := c.findOngoingOperationByID(operationID, mtaClient) |
| 182 | if err != nil { |
| 183 | ui.Failed(err.Error()) |
| 184 | return Failure |
| 185 | } |
| 186 | |
| 187 | if ongoingOperation == nil { |
| 188 | ui.Failed("Multi-target app operation with ID %s not found", terminal.EntityNameColor(operationID)) |
| 189 | return Failure |
| 190 | } |
| 191 | |
| 192 | // Finds the action specified with the actionID |
| 193 | action := GetActionToExecute(actionID, c.name, retries) |
| 194 | if action == nil { |
| 195 | ui.Failed("Invalid action %s", terminal.EntityNameColor(actionID)) |
| 196 | return Failure |
| 197 | } |
| 198 | |
| 199 | // Executes the action specified with actionID |
| 200 | return action.Execute(operationID, mtaClient) |
| 201 | } |
| 202 | |
| 203 | // CheckOngoingOperation checks for ongoing operation for mta with the specified id and tries to abort it |
| 204 | func (c *BaseCommand) CheckOngoingOperation(mtaID string, namespace string, host string, force bool, cfTarget util.CloudFoundryTarget) (bool, error) { |
nothing calls this directly
no test coverage detected