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

Method RenameService

cf/api/services.go:187–195  ·  view source on GitHub ↗
(instance models.ServiceInstance, newName string)

Source from the content-addressed store, hash-verified

185}
186
187func (repo CloudControllerServiceRepository) RenameService(instance models.ServiceInstance, newName string) (apiErr error) {
188 body := fmt.Sprintf(`{"name":"%s"}`, newName)
189 path := fmt.Sprintf("/v2/service_instances/%s?accepts_incomplete=true", instance.GUID)
190
191 if instance.IsUserProvided() {
192 path = fmt.Sprintf("/v2/user_provided_service_instances/%s", instance.GUID)
193 }
194 return repo.gateway.UpdateResource(repo.config.APIEndpoint(), path, strings.NewReader(body))
195}
196
197func (repo CloudControllerServiceRepository) DeleteService(instance models.ServiceInstance) (apiErr error) {
198 if len(instance.ServiceBindings) > 0 || len(instance.ServiceKeys) > 0 {

Callers

nothing calls this directly

Calls 3

IsUserProvidedMethod · 0.80
UpdateResourceMethod · 0.80
APIEndpointMethod · 0.65

Tested by

no test coverage detected