(currentServiceInstanceName, spaceGUID, newServiceInstanceName string)
| 190 | } |
| 191 | |
| 192 | func (actor Actor) RenameServiceInstance(currentServiceInstanceName, spaceGUID, newServiceInstanceName string) (Warnings, error) { |
| 193 | var ( |
| 194 | serviceInstance resources.ServiceInstance |
| 195 | jobURL ccv3.JobURL |
| 196 | ) |
| 197 | |
| 198 | warnings, err := railway.Sequentially( |
| 199 | func() (warnings ccv3.Warnings, err error) { |
| 200 | serviceInstance, _, warnings, err = actor.getServiceInstanceByNameAndSpace(currentServiceInstanceName, spaceGUID) |
| 201 | return |
| 202 | }, |
| 203 | func() (warnings ccv3.Warnings, err error) { |
| 204 | jobURL, warnings, err = actor.CloudControllerClient.UpdateServiceInstance( |
| 205 | serviceInstance.GUID, |
| 206 | resources.ServiceInstance{Name: newServiceInstanceName}, |
| 207 | ) |
| 208 | return |
| 209 | }, |
| 210 | func() (warnings ccv3.Warnings, err error) { |
| 211 | return actor.CloudControllerClient.PollJobForState(jobURL, constant.JobPolling) |
| 212 | }, |
| 213 | ) |
| 214 | |
| 215 | return Warnings(warnings), err |
| 216 | } |
| 217 | |
| 218 | func (actor Actor) DeleteServiceInstance(serviceInstanceName, spaceGUID string) (chan PollJobEvent, Warnings, error) { |
| 219 | var ( |
nothing calls this directly
no test coverage detected