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

Method GetApplicationTasks

actor/v7action/task.go:31–50  ·  view source on GitHub ↗

GetApplicationTasks returns a list of tasks associated with the provided application GUID.

(appGUID string, sortOrder SortOrder)

Source from the content-addressed store, hash-verified

29// GetApplicationTasks returns a list of tasks associated with the provided
30// application GUID.
31func (actor Actor) GetApplicationTasks(appGUID string, sortOrder SortOrder) ([]resources.Task, Warnings, error) {
32 tasks, warnings, err := actor.CloudControllerClient.GetApplicationTasks(appGUID)
33 actorWarnings := Warnings(warnings)
34 if err != nil {
35 return nil, actorWarnings, err
36 }
37
38 allTasks := []resources.Task{}
39 for _, task := range tasks {
40 allTasks = append(allTasks, resources.Task(task))
41 }
42
43 if sortOrder == Descending {
44 sort.Slice(allTasks, func(i int, j int) bool { return allTasks[i].SequenceID > allTasks[j].SequenceID })
45 } else {
46 sort.Slice(allTasks, func(i int, j int) bool { return allTasks[i].SequenceID < allTasks[j].SequenceID })
47 }
48
49 return allTasks, actorWarnings, nil
50}
51
52func (actor Actor) GetTaskBySequenceIDAndApplication(sequenceID int, appGUID string) (resources.Task, Warnings, error) {
53 tasks, warnings, err := actor.CloudControllerClient.GetApplicationTasks(

Callers

nothing calls this directly

Implementers 1

FakeActorcommand/v7/v7fakes/fake_actor.go

Calls 3

TaskStruct · 0.92
WarningsTypeAlias · 0.70
GetApplicationTasksMethod · 0.65

Tested by

no test coverage detected