MCPcopy
hub / github.com/cloudfoundry/cli / RenameServiceInstance

Method RenameServiceInstance

actor/v7action/service_instance.go:192–216  ·  view source on GitHub ↗
(currentServiceInstanceName, spaceGUID, newServiceInstanceName string)

Source from the content-addressed store, hash-verified

190}
191
192func (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
218func (actor Actor) DeleteServiceInstance(serviceInstanceName, spaceGUID string) (chan PollJobEvent, Warnings, error) {
219 var (

Callers

nothing calls this directly

Implementers 1

FakeActorcommand/v7/v7fakes/fake_actor.go

Calls 5

SequentiallyFunction · 0.92
WarningsTypeAlias · 0.70
UpdateServiceInstanceMethod · 0.65
PollJobForStateMethod · 0.65

Tested by

no test coverage detected