MCPcopy Create free account
hub / github.com/cloudfoundry/cli / getServiceOfferings

Method getServiceOfferings

actor/v7action/service_access.go:244–277  ·  view source on GitHub ↗
(service, broker string)

Source from the content-addressed store, hash-verified

242}
243
244func (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
279func (actor *Actor) getServicePlanVisibilityDetails(plan ServicePlanWithSpaceAndOrganization) (names []string, warnings Warnings, err error) {
280 if plan.VisibilityType == resources.ServicePlanVisibilityOrganization {

Callers 1

GetServiceAccessMethod · 0.95

Implementers 1

FakeActorcommand/v7/v7fakes/fake_actor.go

Calls 2

WarningsTypeAlias · 0.70
GetServiceOfferingsMethod · 0.65

Tested by

no test coverage detected