GetApplicationTasks returns a list of tasks associated with the provided application GUID.
(appGUID string, sortOrder SortOrder)
| 29 | // GetApplicationTasks returns a list of tasks associated with the provided |
| 30 | // application GUID. |
| 31 | func (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 | |
| 52 | func (actor Actor) GetTaskBySequenceIDAndApplication(sequenceID int, appGUID string) (resources.Task, Warnings, error) { |
| 53 | tasks, warnings, err := actor.CloudControllerClient.GetApplicationTasks( |
nothing calls this directly
no test coverage detected