(tunnelID uuid.UUID, route HostnameRoute)
| 176 | } |
| 177 | |
| 178 | func (r *RESTClient) RouteTunnel(tunnelID uuid.UUID, route HostnameRoute) (HostnameRouteResult, error) { |
| 179 | endpoint := r.baseEndpoints.zoneLevel |
| 180 | endpoint.Path = path.Join(endpoint.Path, fmt.Sprintf("%v/routes", tunnelID)) |
| 181 | resp, err := r.sendRequest("PUT", endpoint, route) |
| 182 | if err != nil { |
| 183 | return nil, errors.Wrap(err, "REST request failed") |
| 184 | } |
| 185 | defer resp.Body.Close() |
| 186 | |
| 187 | if resp.StatusCode == http.StatusOK { |
| 188 | return route.UnmarshalResult(resp.Body) |
| 189 | } |
| 190 | |
| 191 | return nil, r.statusCodeToError("add route", resp) |
| 192 | } |
nothing calls this directly
no test coverage detected