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

Method DeleteRoute

actor/v7action/route.go:343–377  ·  view source on GitHub ↗
(domainName, hostname, path string, port int)

Source from the content-addressed store, hash-verified

341}
342
343func (actor Actor) DeleteRoute(domainName, hostname, path string, port int) (Warnings, error) {
344 allWarnings := Warnings{}
345 domain, warnings, err := actor.GetDomainByName(domainName)
346 allWarnings = append(allWarnings, warnings...)
347
348 if _, ok := err.(actionerror.DomainNotFoundError); ok {
349 allWarnings = append(allWarnings, err.Error())
350 return allWarnings, nil
351 }
352
353 if err != nil {
354 return allWarnings, err
355 }
356
357 route, actorWarnings, err := actor.GetRouteByAttributes(domain, hostname, path, port)
358
359 allWarnings = append(allWarnings, actorWarnings...)
360
361 if err != nil {
362 return allWarnings, err
363 }
364
365 jobURL, apiWarnings, err := actor.CloudControllerClient.DeleteRoute(route.GUID)
366 actorWarnings = Warnings(apiWarnings)
367 allWarnings = append(allWarnings, actorWarnings...)
368
369 if err != nil {
370 return allWarnings, err
371 }
372
373 pollJobWarnings, err := actor.CloudControllerClient.PollJob(jobURL)
374 allWarnings = append(allWarnings, Warnings(pollJobWarnings)...)
375
376 return allWarnings, err
377}
378
379func (actor Actor) GetRouteByAttributes(domain resources.Domain, hostname string, path string, port int) (resources.Route, Warnings, error) {
380 var (

Callers

nothing calls this directly

Implementers 1

FakeActorcommand/v7/v7fakes/fake_actor.go

Calls 6

GetDomainByNameMethod · 0.95
GetRouteByAttributesMethod · 0.95
WarningsTypeAlias · 0.70
ErrorMethod · 0.65
DeleteRouteMethod · 0.65
PollJobMethod · 0.65

Tested by

no test coverage detected