## Modify stored information about a CNI object `client.NetworkInterconnects.CNIs.Update(ctx, cni, params) (*CNIUpdateResponse, error)` **put** `/accounts/{account_id}/cni/cnis/{cni}` Modify stored information about a CNI object ### Parameters - `cni string` - `params CNIUpdateParams` - `AccountID param.Field[string]` Path param: Customer account tag - `ID param.Field[string]` Body param - `Account param.Field[string]` Body param: Customer account tag - `CustIP param.Field[string]` Body param: Customer end of the point-to-point link This should always be inside the same prefix as `p2p_ip`. - `Interconnect param.Field[string]` Body param: Interconnect identifier hosting this CNI - `Magic param.Field[CNIUpdateParamsMagic]` Body param - `ConduitName string` - `Description string` - `Mtu int64` - `P2pIP param.Field[string]` Body param: Cloudflare end of the point-to-point link - `BGP param.Field[CNIUpdateParamsBGP]` Body param - `CustomerASN int64` ASN used on the customer end of the BGP session - `ExtraPrefixes []string` Extra set of static prefixes to advertise to the customer's end of the session - `Md5Key string` MD5 key to use for session authentication. Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the key is not treated as a secret value. This is *only* supported for preventing misconfiguration, not for defending against malicious attacks. The MD5 key, if set, must be of non-zero length and consist only of the following types of character: * ASCII alphanumerics: `[a-zA-Z0-9]` * Special characters in the set `'!@#$%^&*()+[]{}<>/.,;:_-~`= |` In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A), quotation mark (`"`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed (0x0C), and the question mark (`?`). Requests specifying an MD5 key with one or more of these disallowed characters will be rejected. ### Returns - `type CNIUpdateResponse struct{…}` - `ID string` - `Account string` Customer account tag - `CustIP string` Customer end of the point-to-point link This should always be inside the same prefix as `p2p_ip`. - `Interconnect string` Interconnect identifier hosting this CNI - `Magic CNIUpdateResponseMagic` - `ConduitName string` - `Description string` - `Mtu int64` - `P2pIP string` Cloudflare end of the point-to-point link - `BGP CNIUpdateResponseBGP` - `CustomerASN int64` ASN used on the customer end of the BGP session - `ExtraPrefixes []string` Extra set of static prefixes to advertise to the customer's end of the session - `Md5Key string` MD5 key to use for session authentication. Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the key is not treated as a secret value. This is *only* supported for preventing misconfiguration, not for defending against malicious attacks. The MD5 key, if set, must be of non-zero length and consist only of the following types of character: * ASCII alphanumerics: `[a-zA-Z0-9]` * Special characters in the set `'!@#$%^&*()+[]{}<>/.,;:_-~`= |` In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A), quotation mark (`"`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed (0x0C), and the question mark (`?`). Requests specifying an MD5 key with one or more of these disallowed characters will be rejected. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/network_interconnects" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) cni, err := client.NetworkInterconnects.CNIs.Update( context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", network_interconnects.CNIUpdateParams{ AccountID: cloudflare.F("account_id"), ID: cloudflare.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), Account: cloudflare.F("account"), CustIP: cloudflare.F("192.168.3.4/31"), Interconnect: cloudflare.F("interconnect"), Magic: cloudflare.F(network_interconnects.CNIUpdateParamsMagic{ ConduitName: cloudflare.F("conduit_name"), Description: cloudflare.F("description"), Mtu: cloudflare.F(int64(0)), }), P2pIP: cloudflare.F("192.168.3.4/31"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", cni.ID) } ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "account": "account", "cust_ip": "192.168.3.4/31", "interconnect": "interconnect", "magic": { "conduit_name": "conduit_name", "description": "description", "mtu": 0 }, "p2p_ip": "192.168.3.4/31", "bgp": { "customer_asn": 0, "extra_prefixes": [ "string" ], "md5_key": "md5_key" } } ```