(tunnelID uuid.UUID, res ManagementResource)
| 160 | } |
| 161 | |
| 162 | func (r *RESTClient) GetManagementToken(tunnelID uuid.UUID, res ManagementResource) (token string, err error) { |
| 163 | endpoint := r.baseEndpoints.accountLevel |
| 164 | endpoint.Path = path.Join(endpoint.Path, managementEndpointPath(tunnelID, res)) |
| 165 | |
| 166 | resp, err := r.sendRequest("POST", endpoint, nil) |
| 167 | if err != nil { |
| 168 | return "", errors.Wrap(err, "REST request failed") |
| 169 | } |
| 170 | defer resp.Body.Close() |
| 171 | |
| 172 | if resp.StatusCode == http.StatusOK { |
| 173 | err = parseResponse(resp.Body, &token) |
| 174 | return token, err |
| 175 | } |
| 176 | |
| 177 | return "", r.statusCodeToError("get tunnel token", resp) |
| 178 | } |
| 179 | |
| 180 | func (r *RESTClient) DeleteTunnel(tunnelID uuid.UUID, cascade bool) error { |
| 181 | endpoint := r.baseEndpoints.accountLevel |
nothing calls this directly
no test coverage detected