(id uuid.UUID, updates UpdateVirtualNetwork)
| 105 | } |
| 106 | |
| 107 | func (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 | |
| 124 | func parseListVnets(body io.ReadCloser) ([]*VirtualNetwork, error) { |
| 125 | var vnets []*VirtualNetwork |
nothing calls this directly
no test coverage detected