MCPcopy Index your code
hub / github.com/cloudflare/cloudflared / DeleteRoute

Method DeleteRoute

cfapi/ip_route.go:178–194  ·  view source on GitHub ↗

DeleteRoute calls the Tunnelstore DELETE endpoint for a given route.

(id uuid.UUID)

Source from the content-addressed store, hash-verified

176
177// DeleteRoute calls the Tunnelstore DELETE endpoint for a given route.
178func (r *RESTClient) DeleteRoute(id uuid.UUID) error {
179 endpoint := r.baseEndpoints.accountRoutes
180 endpoint.Path = path.Join(endpoint.Path, url.PathEscape(id.String()))
181
182 resp, err := r.sendRequest("DELETE", endpoint, nil)
183 if err != nil {
184 return errors.Wrap(err, "REST request failed")
185 }
186 defer resp.Body.Close()
187
188 if resp.StatusCode == http.StatusOK {
189 _, err := parseRoute(resp.Body)
190 return err
191 }
192
193 return r.statusCodeToError("delete route", resp)
194}
195
196// GetByIP checks which route will proxy a given IP.
197func (r *RESTClient) GetByIP(params GetRouteByIpParams) (DetailedRoute, error) {

Callers

nothing calls this directly

Calls 5

sendRequestMethod · 0.95
statusCodeToErrorMethod · 0.95
parseRouteFunction · 0.85
StringMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected