(service, broker string)
| 242 | } |
| 243 | |
| 244 | func (actor *Actor) getServiceOfferings(service, broker string) (map[string]offeringDetails, Warnings, error) { |
| 245 | var offeringsQuery []ccv3.Query |
| 246 | |
| 247 | if broker != "" { |
| 248 | offeringsQuery = append(offeringsQuery, ccv3.Query{ |
| 249 | Key: ccv3.ServiceBrokerNamesFilter, |
| 250 | Values: []string{broker}, |
| 251 | }) |
| 252 | } |
| 253 | |
| 254 | if service != "" { |
| 255 | offeringsQuery = append(offeringsQuery, ccv3.Query{ |
| 256 | Key: ccv3.NameFilter, |
| 257 | Values: []string{service}, |
| 258 | }) |
| 259 | } |
| 260 | |
| 261 | serviceOfferings, warnings, err := actor.CloudControllerClient.GetServiceOfferings(offeringsQuery...) |
| 262 | if err != nil { |
| 263 | return nil, Warnings(warnings), err |
| 264 | } |
| 265 | if len(serviceOfferings) == 0 && len(offeringsQuery) > 0 { |
| 266 | return nil, Warnings(warnings), actionerror.ServiceNotFoundError{Name: service, Broker: broker} |
| 267 | } |
| 268 | |
| 269 | offerings := make(map[string]offeringDetails) |
| 270 | for _, o := range serviceOfferings { |
| 271 | offerings[o.GUID] = offeringDetails{ |
| 272 | offeringName: o.Name, |
| 273 | brokerName: o.ServiceBrokerName, |
| 274 | } |
| 275 | } |
| 276 | return offerings, Warnings(warnings), err |
| 277 | } |
| 278 | |
| 279 | func (actor *Actor) getServicePlanVisibilityDetails(plan ServicePlanWithSpaceAndOrganization) (names []string, warnings Warnings, err error) { |
| 280 | if plan.VisibilityType == resources.ServicePlanVisibilityOrganization { |
no test coverage detected