MCPcopy Index your code
hub / github.com/cloudfoundry/cli / RunTask

Method RunTask

actor/v7action/task.go:18–27  ·  view source on GitHub ↗

Run resources.Task runs the provided command in the application environment associated with the provided application GUID.

(appGUID string, task resources.Task)

Source from the content-addressed store, hash-verified

16// Run resources.Task runs the provided command in the application environment associated
17// with the provided application GUID.
18func (actor Actor) RunTask(appGUID string, task resources.Task) (resources.Task, Warnings, error) {
19 createdTask, warnings, err := actor.CloudControllerClient.CreateApplicationTask(appGUID, resources.Task(task))
20 if err != nil {
21 if e, ok := err.(ccerror.TaskWorkersUnavailableError); ok {
22 return resources.Task{}, Warnings(warnings), actionerror.TaskWorkersUnavailableError{Message: e.Error()}
23 }
24 }
25
26 return resources.Task(createdTask), Warnings(warnings), err
27}
28
29// GetApplicationTasks returns a list of tasks associated with the provided
30// application GUID.

Callers

nothing calls this directly

Implementers 1

FakeActorcommand/v7/v7fakes/fake_actor.go

Calls 4

TaskStruct · 0.92
WarningsTypeAlias · 0.70
CreateApplicationTaskMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected