github.com/sleungcy-sap/cli@v7.1.0+incompatible/api/cloudcontroller/ccv3/sidecar.go (about) 1 package ccv3 2 3 import ( 4 "code.cloudfoundry.org/cli/api/cloudcontroller/ccv3/internal" 5 6 "code.cloudfoundry.org/cli/types" 7 ) 8 9 type Sidecar struct { 10 GUID string `json:"guid"` 11 Name string `json:"name"` 12 Command types.FilteredString `json:"command"` 13 } 14 15 func (client *Client) GetProcessSidecars(processGuid string) ([]Sidecar, Warnings, error) { 16 var resources []Sidecar 17 18 _, warnings, err := client.MakeListRequest(RequestParams{ 19 RequestName: internal.GetProcessSidecarsRequest, 20 URIParams: internal.Params{"process_guid": processGuid}, 21 ResponseBody: Sidecar{}, 22 AppendToList: func(item interface{}) error { 23 resources = append(resources, item.(Sidecar)) 24 return nil 25 }, 26 }) 27 28 return resources, warnings, err 29 }