forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrevisions.go
37 lines (32 loc) · 1.18 KB
/
revisions.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package ccv3
import (
"code.cloudfoundry.org/cli/api/cloudcontroller/ccv3/internal"
"code.cloudfoundry.org/cli/resources"
)
func (client *Client) GetApplicationRevisions(appGUID string, query ...Query) ([]resources.Revision, Warnings, error) {
var revisions []resources.Revision
_, warnings, err := client.MakeListRequest(RequestParams{
RequestName: internal.GetApplicationRevisionsRequest,
Query: query,
URIParams: internal.Params{"app_guid": appGUID},
ResponseBody: resources.Revision{},
AppendToList: func(item interface{}) error {
revisions = append(revisions, item.(resources.Revision))
return nil
},
})
return revisions, warnings, err
}
func (client *Client) GetApplicationRevisionsDeployed(appGUID string) ([]resources.Revision, Warnings, error) {
var revisions []resources.Revision
_, warnings, err := client.MakeListRequest(RequestParams{
RequestName: internal.GetApplicationRevisionsDeployedRequest,
URIParams: internal.Params{"app_guid": appGUID},
ResponseBody: resources.Revision{},
AppendToList: func(item interface{}) error {
revisions = append(revisions, item.(resources.Revision))
return nil
},
})
return revisions, warnings, err
}