(routePath string, spaceGUID string)
| 146 | } |
| 147 | |
| 148 | func (actor Actor) GetRoute(routePath string, spaceGUID string) (resources.Route, Warnings, error) { |
| 149 | filters := []ccv3.Query{ |
| 150 | {Key: ccv3.SpaceGUIDFilter, Values: []string{spaceGUID}}, |
| 151 | {Key: ccv3.PerPage, Values: []string{"1"}}, |
| 152 | {Key: ccv3.Page, Values: []string{"1"}}, |
| 153 | } |
| 154 | |
| 155 | host, path, port, domain, allWarnings, err := actor.parseRoutePath(routePath) |
| 156 | if err != nil { |
| 157 | return resources.Route{}, allWarnings, err |
| 158 | } |
| 159 | |
| 160 | filters = append(filters, ccv3.Query{Key: ccv3.DomainGUIDFilter, |
| 161 | Values: []string{domain.GUID}, |
| 162 | }) |
| 163 | filters = append(filters, ccv3.Query{Key: ccv3.HostsFilter, |
| 164 | Values: []string{host}, |
| 165 | }) |
| 166 | filters = append(filters, ccv3.Query{Key: ccv3.PathsFilter, |
| 167 | Values: []string{path}, |
| 168 | }) |
| 169 | |
| 170 | if domain.IsTCP() { |
| 171 | filters = append(filters, ccv3.Query{Key: ccv3.PortsFilter, |
| 172 | Values: []string{port}, |
| 173 | }) |
| 174 | } |
| 175 | |
| 176 | routes, warnings, err := actor.CloudControllerClient.GetRoutes(filters...) |
| 177 | allWarnings = append(allWarnings, warnings...) |
| 178 | if err != nil { |
| 179 | return resources.Route{}, allWarnings, err |
| 180 | } |
| 181 | if len(routes) == 0 { |
| 182 | return resources.Route{}, allWarnings, actionerror.RouteNotFoundError{ |
| 183 | Host: host, |
| 184 | DomainName: domain.Name, |
| 185 | Path: path, |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | return routes[0], allWarnings, nil |
| 190 | } |
| 191 | |
| 192 | func (actor Actor) GetRoutesByOrg(orgGUID string, labelSelector string) ([]resources.Route, Warnings, error) { |
| 193 | allWarnings := Warnings{} |
no test coverage detected