(instance models.ServiceInstance, newName string)
| 185 | } |
| 186 | |
| 187 | func (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 | |
| 197 | func (repo CloudControllerServiceRepository) DeleteService(instance models.ServiceInstance) (apiErr error) { |
| 198 | if len(instance.ServiceBindings) > 0 || len(instance.ServiceKeys) > 0 { |
nothing calls this directly
no test coverage detected