(host string, domain models.DomainFields, path string)
| 128 | } |
| 129 | |
| 130 | func (repo CloudControllerRouteRepository) CheckIfExists(host string, domain models.DomainFields, path string) (bool, error) { |
| 131 | path = normalizedPath(path) |
| 132 | |
| 133 | u, err := url.Parse(repo.config.APIEndpoint()) |
| 134 | if err != nil { |
| 135 | return false, err |
| 136 | } |
| 137 | |
| 138 | u.Path = fmt.Sprintf("/v2/routes/reserved/domain/%s/host/%s", domain.GUID, host) |
| 139 | if path != "" { |
| 140 | q := u.Query() |
| 141 | q.Set("path", path) |
| 142 | u.RawQuery = q.Encode() |
| 143 | } |
| 144 | |
| 145 | var rawResponse interface{} |
| 146 | err = repo.gateway.GetResource(u.String(), &rawResponse) |
| 147 | if err != nil { |
| 148 | if _, ok := err.(*errors.HTTPNotFoundError); ok { |
| 149 | return false, nil |
| 150 | } |
| 151 | return false, err |
| 152 | } |
| 153 | |
| 154 | return true, nil |
| 155 | } |
| 156 | |
| 157 | func (repo CloudControllerRouteRepository) CreateInSpace(host, path, domainGUID, spaceGUID string, port int, randomPort bool) (models.Route, error) { |
| 158 | path = normalizedPath(path) |
nothing calls this directly
no test coverage detected