(domainName, hostname, path string, port int)
| 341 | } |
| 342 | |
| 343 | func (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 | |
| 379 | func (actor Actor) GetRouteByAttributes(domain resources.Domain, hostname string, path string, port int) (resources.Route, Warnings, error) { |
| 380 | var ( |
nothing calls this directly
no test coverage detected