(serviceInstanceName, spaceGUID string)
| 216 | } |
| 217 | |
| 218 | func (actor Actor) DeleteServiceInstance(serviceInstanceName, spaceGUID string) (chan PollJobEvent, Warnings, error) { |
| 219 | var ( |
| 220 | serviceInstance resources.ServiceInstance |
| 221 | jobURL ccv3.JobURL |
| 222 | ) |
| 223 | |
| 224 | warnings, err := railway.Sequentially( |
| 225 | func() (warnings ccv3.Warnings, err error) { |
| 226 | serviceInstance, _, warnings, err = actor.CloudControllerClient.GetServiceInstanceByNameAndSpace(serviceInstanceName, spaceGUID) |
| 227 | return |
| 228 | }, |
| 229 | func() (warnings ccv3.Warnings, err error) { |
| 230 | jobURL, warnings, err = actor.CloudControllerClient.DeleteServiceInstance(serviceInstance.GUID) |
| 231 | return |
| 232 | }, |
| 233 | ) |
| 234 | |
| 235 | switch err.(type) { |
| 236 | case nil: |
| 237 | case ccerror.ServiceInstanceNotFoundError: |
| 238 | return nil, Warnings(warnings), actionerror.ServiceInstanceNotFoundError{Name: serviceInstanceName} |
| 239 | default: |
| 240 | return nil, Warnings(warnings), err |
| 241 | } |
| 242 | |
| 243 | switch jobURL { |
| 244 | case "": |
| 245 | return nil, Warnings(warnings), nil |
| 246 | default: |
| 247 | return actor.PollJobToEventStream(jobURL), Warnings(warnings), nil |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | func (actor Actor) PurgeServiceInstance(serviceInstanceName, spaceGUID string) (Warnings, error) { |
| 252 | var serviceInstance resources.ServiceInstance |
nothing calls this directly
no test coverage detected