Skip to content
Start here

Modify stored information about a CNI object

client.networkInterconnects.cnis.update(stringcni, CNIUpdateParams { account_id, id, account, 5 more } params, RequestOptionsoptions?): CNIUpdateResponse { id, account, cust_ip, 4 more }
PUT/accounts/{account_id}/cni/cnis/{cni}

Modify stored information about a CNI object

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Magic WAN WriteMagic Transit Write
ParametersExpand Collapse
cni: string
formatuuid
params: CNIUpdateParams { account_id, id, account, 5 more }
account_id: string

Path param: Customer account tag

id: string

Body param

formatuuid
account: string

Body param: Customer account tag

cust_ip: string

Body param: Customer end of the point-to-point link

This should always be inside the same prefix as p2p_ip.

formatA.B.C.D/N
interconnect: string

Body param: Interconnect identifier hosting this CNI

magic: Magic

Body param

conduit_name: string
description: string
mtu: number
formatint32
minimum0
p2p_ip: string

Body param: Cloudflare end of the point-to-point link

formatA.B.C.D/N
bgp?: BGP

Body param

customer_asn: number

ASN used on the customer end of the BGP session

formatint32
minimum0
extra_prefixes: Array<string>

Extra set of static prefixes to advertise to the customer's end of the session

md5_key?: string | null

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.

ReturnsExpand Collapse
CNIUpdateResponse { id, account, cust_ip, 4 more }
id: string
formatuuid
account: string

Customer account tag

cust_ip: string

Customer end of the point-to-point link

This should always be inside the same prefix as p2p_ip.

formatA.B.C.D/N
interconnect: string

Interconnect identifier hosting this CNI

magic: Magic { conduit_name, description, mtu }
conduit_name: string
description: string
mtu: number
formatint32
minimum0
p2p_ip: string

Cloudflare end of the point-to-point link

formatA.B.C.D/N
bgp?: BGP { customer_asn, extra_prefixes, md5_key }
customer_asn: number

ASN used on the customer end of the BGP session

formatint32
minimum0
extra_prefixes: Array<string>

Extra set of static prefixes to advertise to the customer's end of the session

md5_key?: string | null

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.

Modify stored information about a CNI object

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const cni = await client.networkInterconnects.cnis.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
  account_id: 'account_id',
  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',
});

console.log(cni.id);
{
  "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"
  }
}
Returns Examples
{
  "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"
  }
}