MCPcopy
hub / github.com/cloudflare/cloudflared / DeleteVirtualNetwork

Method DeleteVirtualNetwork

cfapi/virtual_network.go:83–105  ·  view source on GitHub ↗
(id uuid.UUID, force bool)

Source from the content-addressed store, hash-verified

81}
82
83func (r *RESTClient) DeleteVirtualNetwork(id uuid.UUID, force bool) error {
84 endpoint := r.baseEndpoints.accountVnets
85 endpoint.Path = path.Join(endpoint.Path, url.PathEscape(id.String()))
86
87 queryParams := url.Values{}
88 if force {
89 queryParams.Set("force", strconv.FormatBool(force))
90 }
91 endpoint.RawQuery = queryParams.Encode()
92
93 resp, err := r.sendRequest("DELETE", endpoint, nil)
94 if err != nil {
95 return errors.Wrap(err, "REST request failed")
96 }
97 defer resp.Body.Close()
98
99 if resp.StatusCode == http.StatusOK {
100 _, err := parseVnet(resp.Body)
101 return err
102 }
103
104 return r.statusCodeToError("delete virtual network", resp)
105}
106
107func (r *RESTClient) UpdateVirtualNetwork(id uuid.UUID, updates UpdateVirtualNetwork) error {
108 endpoint := r.baseEndpoints.accountVnets

Callers

nothing calls this directly

Calls 7

sendRequestMethod · 0.95
statusCodeToErrorMethod · 0.95
parseVnetFunction · 0.85
StringMethod · 0.65
CloseMethod · 0.65
SetMethod · 0.45
EncodeMethod · 0.45

Tested by

no test coverage detected