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

Method DeleteServiceInstance

actor/v7action/service_instance.go:218–249  ·  view source on GitHub ↗
(serviceInstanceName, spaceGUID string)

Source from the content-addressed store, hash-verified

216}
217
218func (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
251func (actor Actor) PurgeServiceInstance(serviceInstanceName, spaceGUID string) (Warnings, error) {
252 var serviceInstance resources.ServiceInstance

Callers

nothing calls this directly

Implementers 1

FakeActorcommand/v7/v7fakes/fake_actor.go

Calls 5

PollJobToEventStreamMethod · 0.95
SequentiallyFunction · 0.92
WarningsTypeAlias · 0.70
DeleteServiceInstanceMethod · 0.65

Tested by

no test coverage detected