github.com/swisscom/cloudfoundry-cli@v7.1.0+incompatible/api/cloudcontroller/ccv3/service_instance.go (about) 1 package ccv3 2 3 import ( 4 "code.cloudfoundry.org/cli/api/cloudcontroller/ccv3/internal" 5 "code.cloudfoundry.org/cli/resources" 6 ) 7 8 // GetServiceInstances lists service instances with optional filters. 9 func (client *Client) GetServiceInstances(query ...Query) ([]resources.ServiceInstance, Warnings, error) { 10 var result []resources.ServiceInstance 11 12 _, warnings, err := client.MakeListRequest(RequestParams{ 13 RequestName: internal.GetServiceInstancesRequest, 14 Query: query, 15 ResponseBody: resources.ServiceInstance{}, 16 AppendToList: func(item interface{}) error { 17 result = append(result, item.(resources.ServiceInstance)) 18 return nil 19 }, 20 }) 21 22 return result, warnings, err 23 }