MCPcopy Index your code
hub / github.com/cloudfoundry/cli / getServiceOfferings

Method getServiceOfferings

cf/api/services.go:98–112  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

96}
97
98func (repo CloudControllerServiceRepository) getServiceOfferings(path string) ([]models.ServiceOffering, error) {
99 var offerings []models.ServiceOffering
100 apiErr := repo.gateway.ListPaginatedResources(
101 repo.config.APIEndpoint(),
102 path,
103 resources.ServiceOfferingResource{},
104 func(resource interface{}) bool {
105 if so, ok := resource.(resources.ServiceOfferingResource); ok {
106 offerings = append(offerings, so.ToModel())
107 }
108 return true
109 })
110
111 return offerings, apiErr
112}
113
114func (repo CloudControllerServiceRepository) FindInstanceByName(name string) (instance models.ServiceInstance, apiErr error) {
115 path := fmt.Sprintf("%s/v2/spaces/%s/service_instances?return_user_provided_service_instances=true&q=%s&inline-relations-depth=1", repo.config.APIEndpoint(), repo.config.SpaceFields().GUID, url.QueryEscape("name:"+name))

Calls 3

APIEndpointMethod · 0.65
ToModelMethod · 0.45

Tested by

no test coverage detected