MCPcopy Create free account
hub / github.com/cloudfoundry/multiapps-cli-plugin / ExecuteAction

Method ExecuteAction

commands/base_command.go:177–201  ·  view source on GitHub ↗

ExecuteAction executes the action over the process specified with operationID

(operationID, actionID string, retries uint, host string, cfTarget util.CloudFoundryTarget)

Source from the content-addressed store, hash-verified

175
176// ExecuteAction executes the action over the process specified with operationID
177func (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
204func (c *BaseCommand) CheckOngoingOperation(mtaID string, namespace string, host string, force bool, cfTarget util.CloudFoundryTarget) (bool, error) {

Callers

nothing calls this directly

Calls 6

NewMtaClientMethod · 0.95
FailedFunction · 0.92
GetActionToExecuteFunction · 0.85
ExecuteMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected