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

Method UpdateVirtualNetwork

cfapi/virtual_network.go:107–122  ·  view source on GitHub ↗
(id uuid.UUID, updates UpdateVirtualNetwork)

Source from the content-addressed store, hash-verified

105}
106
107func (r *RESTClient) UpdateVirtualNetwork(id uuid.UUID, updates UpdateVirtualNetwork) error {
108 endpoint := r.baseEndpoints.accountVnets
109 endpoint.Path = path.Join(endpoint.Path, url.PathEscape(id.String()))
110 resp, err := r.sendRequest("PATCH", endpoint, updates)
111 if err != nil {
112 return errors.Wrap(err, "REST request failed")
113 }
114 defer resp.Body.Close()
115
116 if resp.StatusCode == http.StatusOK {
117 _, err := parseVnet(resp.Body)
118 return err
119 }
120
121 return r.statusCodeToError("update virtual network", resp)
122}
123
124func parseListVnets(body io.ReadCloser) ([]*VirtualNetwork, error) {
125 var vnets []*VirtualNetwork

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected