# Magic Transit ## Domain Types ### Health Check - `HealthCheck` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` ### Health Check Rate - `HealthCheckRate = "low" | "mid" | "high"` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` ### Health Check Type - `HealthCheckType = "reply" | "request"` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` # Apps ## List Apps `client.magicTransit.apps.list(AppListParamsparams, RequestOptionsoptions?): SinglePage` **get** `/accounts/{account_id}/magic/apps` Lists Apps associated with an account. ### Parameters - `params: AppListParams` - `account_id: string` Identifier ### Returns - `AppListResponse = MagicAccountApp | MagicManagedApp` Collection of Hostnames and/or IP Subnets to associate with traffic decisions. - `MagicAccountApp` Custom app defined for an account. - `account_app_id: string` Magic account app ID. - `hostnames?: Array` FQDNs to associate with traffic decisions. - `ip_subnets?: Array` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `name?: string` Display name for the app. - `source_subnets?: Array` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `type?: string` Category of the app. - `MagicManagedApp` Managed app defined by Cloudflare. - `managed_app_id: string` Managed app ID. - `hostnames?: Array` FQDNs to associate with traffic decisions. - `ip_subnets?: Array` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `name?: string` Display name for the app. - `source_subnets?: Array` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `type?: string` Category of the app. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const appListResponse of client.magicTransit.apps.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(appListResponse); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "account_app_id": "ac60d3d0435248289d446cedd870bcf4", "hostnames": [ "auth.cloudflare.com" ], "ip_subnets": [ "192.0.2.0/24" ], "name": "Cloudflare Dashboard", "source_subnets": [ "192.0.2.0/24" ], "type": "Development" } ], "success": true } ``` ## Create a new App `client.magicTransit.apps.create(AppCreateParamsparams, RequestOptionsoptions?): AppCreateResponse | null` **post** `/accounts/{account_id}/magic/apps` Creates a new App for an account ### Parameters - `params: AppCreateParams` - `account_id: string` Path param: Identifier - `name: string` Body param: Display name for the app. - `type: string` Body param: Category of the app. - `hostnames?: Array` Body param: FQDNs to associate with traffic decisions. - `ip_subnets?: Array` Body param: IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `source_subnets?: Array` Body param: IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) ### Returns - `AppCreateResponse` Custom app defined for an account. - `account_app_id: string` Magic account app ID. - `hostnames?: Array` FQDNs to associate with traffic decisions. - `ip_subnets?: Array` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `name?: string` Display name for the app. - `source_subnets?: Array` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `type?: string` Category of the app. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const app = await client.magicTransit.apps.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', name: 'Cloudflare Dashboard', type: 'Development', }); console.log(app.account_app_id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "account_app_id": "ac60d3d0435248289d446cedd870bcf4", "hostnames": [ "auth.cloudflare.com" ], "ip_subnets": [ "192.0.2.0/24" ], "name": "Cloudflare Dashboard", "source_subnets": [ "192.0.2.0/24" ], "type": "Development" }, "success": true } ``` ## Update an App `client.magicTransit.apps.update(stringaccountAppId, AppUpdateParamsparams, RequestOptionsoptions?): AppUpdateResponse | null` **put** `/accounts/{account_id}/magic/apps/{account_app_id}` Updates an Account App ### Parameters - `accountAppId: string` Identifier - `params: AppUpdateParams` - `account_id: string` Path param: Identifier - `hostnames?: Array` Body param: FQDNs to associate with traffic decisions. - `ip_subnets?: Array` Body param: IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `name?: string` Body param: Display name for the app. - `source_subnets?: Array` Body param: IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `type?: string` Body param: Category of the app. ### Returns - `AppUpdateResponse` Custom app defined for an account. - `account_app_id: string` Magic account app ID. - `hostnames?: Array` FQDNs to associate with traffic decisions. - `ip_subnets?: Array` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `name?: string` Display name for the app. - `source_subnets?: Array` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `type?: string` Category of the app. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const app = await client.magicTransit.apps.update('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(app.account_app_id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "account_app_id": "ac60d3d0435248289d446cedd870bcf4", "hostnames": [ "auth.cloudflare.com" ], "ip_subnets": [ "192.0.2.0/24" ], "name": "Cloudflare Dashboard", "source_subnets": [ "192.0.2.0/24" ], "type": "Development" }, "success": true } ``` ## Update an App `client.magicTransit.apps.edit(stringaccountAppId, AppEditParamsparams, RequestOptionsoptions?): AppEditResponse | null` **patch** `/accounts/{account_id}/magic/apps/{account_app_id}` Updates an Account App ### Parameters - `accountAppId: string` Identifier - `params: AppEditParams` - `account_id: string` Path param: Identifier - `hostnames?: Array` Body param: FQDNs to associate with traffic decisions. - `ip_subnets?: Array` Body param: IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `name?: string` Body param: Display name for the app. - `source_subnets?: Array` Body param: IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `type?: string` Body param: Category of the app. ### Returns - `AppEditResponse` Custom app defined for an account. - `account_app_id: string` Magic account app ID. - `hostnames?: Array` FQDNs to associate with traffic decisions. - `ip_subnets?: Array` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `name?: string` Display name for the app. - `source_subnets?: Array` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `type?: string` Category of the app. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.magicTransit.apps.edit('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(response.account_app_id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "account_app_id": "ac60d3d0435248289d446cedd870bcf4", "hostnames": [ "auth.cloudflare.com" ], "ip_subnets": [ "192.0.2.0/24" ], "name": "Cloudflare Dashboard", "source_subnets": [ "192.0.2.0/24" ], "type": "Development" }, "success": true } ``` ## Delete Account App `client.magicTransit.apps.delete(stringaccountAppId, AppDeleteParamsparams, RequestOptionsoptions?): AppDeleteResponse | null` **delete** `/accounts/{account_id}/magic/apps/{account_app_id}` Deletes specific Account App. ### Parameters - `accountAppId: string` Identifier - `params: AppDeleteParams` - `account_id: string` Identifier ### Returns - `AppDeleteResponse` Custom app defined for an account. - `account_app_id: string` Magic account app ID. - `hostnames?: Array` FQDNs to associate with traffic decisions. - `ip_subnets?: Array` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `name?: string` Display name for the app. - `source_subnets?: Array` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `type?: string` Category of the app. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const app = await client.magicTransit.apps.delete('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(app.account_app_id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "account_app_id": "ac60d3d0435248289d446cedd870bcf4", "hostnames": [ "auth.cloudflare.com" ], "ip_subnets": [ "192.0.2.0/24" ], "name": "Cloudflare Dashboard", "source_subnets": [ "192.0.2.0/24" ], "type": "Development" }, "success": true } ``` ## Domain Types ### App List Response - `AppListResponse = MagicAccountApp | MagicManagedApp` Collection of Hostnames and/or IP Subnets to associate with traffic decisions. - `MagicAccountApp` Custom app defined for an account. - `account_app_id: string` Magic account app ID. - `hostnames?: Array` FQDNs to associate with traffic decisions. - `ip_subnets?: Array` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `name?: string` Display name for the app. - `source_subnets?: Array` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `type?: string` Category of the app. - `MagicManagedApp` Managed app defined by Cloudflare. - `managed_app_id: string` Managed app ID. - `hostnames?: Array` FQDNs to associate with traffic decisions. - `ip_subnets?: Array` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `name?: string` Display name for the app. - `source_subnets?: Array` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `type?: string` Category of the app. ### App Create Response - `AppCreateResponse` Custom app defined for an account. - `account_app_id: string` Magic account app ID. - `hostnames?: Array` FQDNs to associate with traffic decisions. - `ip_subnets?: Array` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `name?: string` Display name for the app. - `source_subnets?: Array` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `type?: string` Category of the app. ### App Update Response - `AppUpdateResponse` Custom app defined for an account. - `account_app_id: string` Magic account app ID. - `hostnames?: Array` FQDNs to associate with traffic decisions. - `ip_subnets?: Array` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `name?: string` Display name for the app. - `source_subnets?: Array` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `type?: string` Category of the app. ### App Edit Response - `AppEditResponse` Custom app defined for an account. - `account_app_id: string` Magic account app ID. - `hostnames?: Array` FQDNs to associate with traffic decisions. - `ip_subnets?: Array` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `name?: string` Display name for the app. - `source_subnets?: Array` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `type?: string` Category of the app. ### App Delete Response - `AppDeleteResponse` Custom app defined for an account. - `account_app_id: string` Magic account app ID. - `hostnames?: Array` FQDNs to associate with traffic decisions. - `ip_subnets?: Array` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `name?: string` Display name for the app. - `source_subnets?: Array` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `type?: string` Category of the app. # Cf Interconnects ## List interconnects `client.magicTransit.cfInterconnects.list(CfInterconnectListParamsparams, RequestOptionsoptions?): CfInterconnectListResponse` **get** `/accounts/{account_id}/magic/cf_interconnects` Lists interconnects associated with an account. ### Parameters - `params: CfInterconnectListParams` - `account_id: string` Path param: Identifier - `xMagicNewHcTarget?: boolean` Header param: If true, the health check target in the response body will be presented using the new object format. Defaults to false. ### Returns - `CfInterconnectListResponse` - `interconnects?: Array` - `id?: string` Identifier - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `colo_name?: string` The name of the interconnect. The name cannot share a name with other tunnels. - `created_on?: string` The date and time the tunnel was created. - `description?: string` An optional description of the interconnect. - `gre?: GRE` The configuration specific to GRE interconnects. - `cloudflare_endpoint?: string` The IP address assigned to the Cloudflare side of the GRE tunnel created as part of the Interconnect. - `health_check?: HealthCheck` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address?: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `mtu?: number` The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum value is 576. - `name?: string` The name of the interconnect. The name cannot share a name with other tunnels. - `virtual_port_reservation_id?: string` An identifier that correlates this interconnect with the corresponding V2 CNI interconnect resource. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const cfInterconnects = await client.magicTransit.cfInterconnects.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(cfInterconnects.interconnects); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "interconnects": [ { "id": "c4a7362d577a6c3019a474fd6f485821", "automatic_return_routing": true, "colo_name": "pni_ord", "created_on": "2017-06-14T00:00:00Z", "description": "Tunnel for Interconnect to ORD", "gre": { "cloudflare_endpoint": "203.0.113.1" }, "health_check": { "enabled": true, "rate": "low", "target": { "effective": "203.0.113.1", "saved": "203.0.113.1" }, "type": "request" }, "interface_address": "192.0.2.0/31", "interface_address6": "2606:54c1:7:0:a9fe:12d2:1:200/127", "modified_on": "2017-06-14T05:20:00Z", "mtu": 0, "name": "pni_ord", "virtual_port_reservation_id": "c4a7362d577a6c3019a474fd6f485821" } ] }, "success": true } ``` ## List interconnect Details `client.magicTransit.cfInterconnects.get(stringcfInterconnectId, CfInterconnectGetParamsparams, RequestOptionsoptions?): CfInterconnectGetResponse` **get** `/accounts/{account_id}/magic/cf_interconnects/{cf_interconnect_id}` Lists details for a specific interconnect. ### Parameters - `cfInterconnectId: string` Identifier - `params: CfInterconnectGetParams` - `account_id: string` Path param: Identifier - `xMagicNewHcTarget?: boolean` Header param: If true, the health check target in the response body will be presented using the new object format. Defaults to false. ### Returns - `CfInterconnectGetResponse` - `interconnect?: Interconnect` - `id?: string` Identifier - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `colo_name?: string` The name of the interconnect. The name cannot share a name with other tunnels. - `created_on?: string` The date and time the tunnel was created. - `description?: string` An optional description of the interconnect. - `gre?: GRE` The configuration specific to GRE interconnects. - `cloudflare_endpoint?: string` The IP address assigned to the Cloudflare side of the GRE tunnel created as part of the Interconnect. - `health_check?: HealthCheck` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address?: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `mtu?: number` The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum value is 576. - `name?: string` The name of the interconnect. The name cannot share a name with other tunnels. - `virtual_port_reservation_id?: string` An identifier that correlates this interconnect with the corresponding V2 CNI interconnect resource. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const cfInterconnect = await client.magicTransit.cfInterconnects.get( '023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(cfInterconnect.interconnect); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "interconnect": { "id": "c4a7362d577a6c3019a474fd6f485821", "automatic_return_routing": true, "colo_name": "pni_ord", "created_on": "2017-06-14T00:00:00Z", "description": "Tunnel for Interconnect to ORD", "gre": { "cloudflare_endpoint": "203.0.113.1" }, "health_check": { "enabled": true, "rate": "low", "target": { "effective": "203.0.113.1", "saved": "203.0.113.1" }, "type": "request" }, "interface_address": "192.0.2.0/31", "interface_address6": "2606:54c1:7:0:a9fe:12d2:1:200/127", "modified_on": "2017-06-14T05:20:00Z", "mtu": 0, "name": "pni_ord", "virtual_port_reservation_id": "c4a7362d577a6c3019a474fd6f485821" } }, "success": true } ``` ## Update interconnect `client.magicTransit.cfInterconnects.update(stringcfInterconnectId, CfInterconnectUpdateParamsparams, RequestOptionsoptions?): CfInterconnectUpdateResponse` **put** `/accounts/{account_id}/magic/cf_interconnects/{cf_interconnect_id}` Updates a specific interconnect associated with an account. Use `?validate_only=true` as an optional query parameter to only run validation without persisting changes. ### Parameters - `cfInterconnectId: string` Identifier - `params: CfInterconnectUpdateParams` - `account_id: string` Path param: Identifier - `automatic_return_routing?: boolean` Body param: True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `description?: string` Body param: An optional description of the interconnect. - `gre?: GRE` Body param: The configuration specific to GRE interconnects. - `cloudflare_endpoint?: string` The IP address assigned to the Cloudflare side of the GRE tunnel created as part of the Interconnect. - `health_check?: HealthCheck` Body param - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address?: string` Body param: A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `interface_address6?: string` Body param: A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `mtu?: number` Body param: The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum value is 576. - `name?: string` Body param: The name of the interconnect. The name cannot share a name with other tunnels. - `xMagicNewHcTarget?: boolean` Header param: If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false. ### Returns - `CfInterconnectUpdateResponse` - `modified?: boolean` - `modified_interconnect?: ModifiedInterconnect` - `id?: string` Identifier - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `colo_name?: string` The name of the interconnect. The name cannot share a name with other tunnels. - `created_on?: string` The date and time the tunnel was created. - `description?: string` An optional description of the interconnect. - `gre?: GRE` The configuration specific to GRE interconnects. - `cloudflare_endpoint?: string` The IP address assigned to the Cloudflare side of the GRE tunnel created as part of the Interconnect. - `health_check?: HealthCheck` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address?: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `mtu?: number` The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum value is 576. - `name?: string` The name of the interconnect. The name cannot share a name with other tunnels. - `virtual_port_reservation_id?: string` An identifier that correlates this interconnect with the corresponding V2 CNI interconnect resource. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const cfInterconnect = await client.magicTransit.cfInterconnects.update( '023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(cfInterconnect.modified); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "modified": true, "modified_interconnect": { "id": "c4a7362d577a6c3019a474fd6f485821", "automatic_return_routing": true, "colo_name": "pni_ord", "created_on": "2017-06-14T00:00:00Z", "description": "Tunnel for Interconnect to ORD", "gre": { "cloudflare_endpoint": "203.0.113.1" }, "health_check": { "enabled": true, "rate": "low", "target": { "effective": "203.0.113.1", "saved": "203.0.113.1" }, "type": "request" }, "interface_address": "192.0.2.0/31", "interface_address6": "2606:54c1:7:0:a9fe:12d2:1:200/127", "modified_on": "2017-06-14T05:20:00Z", "mtu": 0, "name": "pni_ord", "virtual_port_reservation_id": "c4a7362d577a6c3019a474fd6f485821" } }, "success": true } ``` ## Update multiple interconnects `client.magicTransit.cfInterconnects.bulkUpdate(CfInterconnectBulkUpdateParamsparams, RequestOptionsoptions?): CfInterconnectBulkUpdateResponse` **put** `/accounts/{account_id}/magic/cf_interconnects` Updates multiple interconnects associated with an account. Use `?validate_only=true` as an optional query parameter to only run validation without persisting changes. ### Parameters - `params: CfInterconnectBulkUpdateParams` - `account_id: string` Path param: Identifier - `body: unknown` Body param - `xMagicNewHcTarget?: boolean` Header param: If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false. ### Returns - `CfInterconnectBulkUpdateResponse` - `modified?: boolean` - `modified_interconnects?: Array` - `id?: string` Identifier - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `colo_name?: string` The name of the interconnect. The name cannot share a name with other tunnels. - `created_on?: string` The date and time the tunnel was created. - `description?: string` An optional description of the interconnect. - `gre?: GRE` The configuration specific to GRE interconnects. - `cloudflare_endpoint?: string` The IP address assigned to the Cloudflare side of the GRE tunnel created as part of the Interconnect. - `health_check?: HealthCheck` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address?: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `mtu?: number` The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum value is 576. - `name?: string` The name of the interconnect. The name cannot share a name with other tunnels. - `virtual_port_reservation_id?: string` An identifier that correlates this interconnect with the corresponding V2 CNI interconnect resource. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.magicTransit.cfInterconnects.bulkUpdate({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', body: {}, }); console.log(response.modified); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "modified": true, "modified_interconnects": [ { "id": "c4a7362d577a6c3019a474fd6f485821", "automatic_return_routing": true, "colo_name": "pni_ord", "created_on": "2017-06-14T00:00:00Z", "description": "Tunnel for Interconnect to ORD", "gre": { "cloudflare_endpoint": "203.0.113.1" }, "health_check": { "enabled": true, "rate": "low", "target": { "effective": "203.0.113.1", "saved": "203.0.113.1" }, "type": "request" }, "interface_address": "192.0.2.0/31", "interface_address6": "2606:54c1:7:0:a9fe:12d2:1:200/127", "modified_on": "2017-06-14T05:20:00Z", "mtu": 0, "name": "pni_ord", "virtual_port_reservation_id": "c4a7362d577a6c3019a474fd6f485821" } ] }, "success": true } ``` ## Domain Types ### Cf Interconnect List Response - `CfInterconnectListResponse` - `interconnects?: Array` - `id?: string` Identifier - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `colo_name?: string` The name of the interconnect. The name cannot share a name with other tunnels. - `created_on?: string` The date and time the tunnel was created. - `description?: string` An optional description of the interconnect. - `gre?: GRE` The configuration specific to GRE interconnects. - `cloudflare_endpoint?: string` The IP address assigned to the Cloudflare side of the GRE tunnel created as part of the Interconnect. - `health_check?: HealthCheck` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address?: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `mtu?: number` The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum value is 576. - `name?: string` The name of the interconnect. The name cannot share a name with other tunnels. - `virtual_port_reservation_id?: string` An identifier that correlates this interconnect with the corresponding V2 CNI interconnect resource. ### Cf Interconnect Get Response - `CfInterconnectGetResponse` - `interconnect?: Interconnect` - `id?: string` Identifier - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `colo_name?: string` The name of the interconnect. The name cannot share a name with other tunnels. - `created_on?: string` The date and time the tunnel was created. - `description?: string` An optional description of the interconnect. - `gre?: GRE` The configuration specific to GRE interconnects. - `cloudflare_endpoint?: string` The IP address assigned to the Cloudflare side of the GRE tunnel created as part of the Interconnect. - `health_check?: HealthCheck` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address?: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `mtu?: number` The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum value is 576. - `name?: string` The name of the interconnect. The name cannot share a name with other tunnels. - `virtual_port_reservation_id?: string` An identifier that correlates this interconnect with the corresponding V2 CNI interconnect resource. ### Cf Interconnect Update Response - `CfInterconnectUpdateResponse` - `modified?: boolean` - `modified_interconnect?: ModifiedInterconnect` - `id?: string` Identifier - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `colo_name?: string` The name of the interconnect. The name cannot share a name with other tunnels. - `created_on?: string` The date and time the tunnel was created. - `description?: string` An optional description of the interconnect. - `gre?: GRE` The configuration specific to GRE interconnects. - `cloudflare_endpoint?: string` The IP address assigned to the Cloudflare side of the GRE tunnel created as part of the Interconnect. - `health_check?: HealthCheck` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address?: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `mtu?: number` The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum value is 576. - `name?: string` The name of the interconnect. The name cannot share a name with other tunnels. - `virtual_port_reservation_id?: string` An identifier that correlates this interconnect with the corresponding V2 CNI interconnect resource. ### Cf Interconnect Bulk Update Response - `CfInterconnectBulkUpdateResponse` - `modified?: boolean` - `modified_interconnects?: Array` - `id?: string` Identifier - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `colo_name?: string` The name of the interconnect. The name cannot share a name with other tunnels. - `created_on?: string` The date and time the tunnel was created. - `description?: string` An optional description of the interconnect. - `gre?: GRE` The configuration specific to GRE interconnects. - `cloudflare_endpoint?: string` The IP address assigned to the Cloudflare side of the GRE tunnel created as part of the Interconnect. - `health_check?: HealthCheck` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address?: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `mtu?: number` The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum value is 576. - `name?: string` The name of the interconnect. The name cannot share a name with other tunnels. - `virtual_port_reservation_id?: string` An identifier that correlates this interconnect with the corresponding V2 CNI interconnect resource. # GRE Tunnels ## List GRE tunnels `client.magicTransit.greTunnels.list(GRETunnelListParamsparams, RequestOptionsoptions?): GRETunnelListResponse` **get** `/accounts/{account_id}/magic/gre_tunnels` Lists GRE tunnels associated with an account. ### Parameters - `params: GRETunnelListParams` - `account_id: string` Path param: Identifier - `xMagicNewHcTarget?: boolean` Header param: If true, the health check target in the response body will be presented using the new object format. Defaults to false. ### Returns - `GRETunnelListResponse` - `gre_tunnels?: Array` - `id: string` Identifier - `cloudflare_gre_endpoint: string` The IP address assigned to the Cloudflare side of the GRE tunnel. - `customer_gre_endpoint: string` The IP address assigned to the customer side of the GRE tunnel. - `interface_address: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel. - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `bgp_status?: BGPStatus` - `state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"` - `"BGP_DOWN"` - `"BGP_UP"` - `"BGP_ESTABLISHING"` - `tcp_established: boolean` - `updated_at: string` - `bgp_state?: string` - `cf_speaker_ip?: string` - `cf_speaker_port?: number` - `customer_speaker_ip?: string` - `customer_speaker_port?: number` - `created_on?: string` The date and time the tunnel was created. - `description?: string` An optional description of the GRE tunnel. - `health_check?: HealthCheck` - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `mtu?: number` Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576. - `ttl?: number` Time To Live (TTL) in number of hops of the GRE tunnel. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const greTunnels = await client.magicTransit.greTunnels.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(greTunnels.gre_tunnels); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "gre_tunnels": [ { "id": "c4a7362d577a6c3019a474fd6f485821", "cloudflare_gre_endpoint": "203.0.113.1", "customer_gre_endpoint": "203.0.113.1", "interface_address": "192.0.2.0/31", "name": "GRE_1", "automatic_return_routing": true, "bgp": { "customer_asn": 0, "extra_prefixes": [ "string" ], "md5_key": "md5_key" }, "bgp_status": { "state": "BGP_DOWN", "tcp_established": true, "updated_at": "2019-12-27T18:11:19.117Z", "bgp_state": "bgp_state", "cf_speaker_ip": "192.168.1.1", "cf_speaker_port": 1, "customer_speaker_ip": "192.168.1.1", "customer_speaker_port": 1 }, "created_on": "2017-06-14T00:00:00Z", "description": "Tunnel for ISP X", "health_check": { "direction": "bidirectional", "enabled": true, "rate": "low", "target": { "effective": "203.0.113.1", "saved": "203.0.113.1" }, "type": "request" }, "interface_address6": "2606:54c1:7:0:a9fe:12d2:1:200/127", "modified_on": "2017-06-14T05:20:00Z", "mtu": 0, "ttl": 0 } ] }, "success": true } ``` ## List GRE Tunnel Details `client.magicTransit.greTunnels.get(stringgreTunnelId, GRETunnelGetParamsparams, RequestOptionsoptions?): GRETunnelGetResponse` **get** `/accounts/{account_id}/magic/gre_tunnels/{gre_tunnel_id}` Lists informtion for a specific GRE tunnel. ### Parameters - `greTunnelId: string` Identifier - `params: GRETunnelGetParams` - `account_id: string` Path param: Identifier - `xMagicNewHcTarget?: boolean` Header param: If true, the health check target in the response body will be presented using the new object format. Defaults to false. ### Returns - `GRETunnelGetResponse` - `gre_tunnel?: GRETunnel` - `id: string` Identifier - `cloudflare_gre_endpoint: string` The IP address assigned to the Cloudflare side of the GRE tunnel. - `customer_gre_endpoint: string` The IP address assigned to the customer side of the GRE tunnel. - `interface_address: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel. - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `bgp_status?: BGPStatus` - `state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"` - `"BGP_DOWN"` - `"BGP_UP"` - `"BGP_ESTABLISHING"` - `tcp_established: boolean` - `updated_at: string` - `bgp_state?: string` - `cf_speaker_ip?: string` - `cf_speaker_port?: number` - `customer_speaker_ip?: string` - `customer_speaker_port?: number` - `created_on?: string` The date and time the tunnel was created. - `description?: string` An optional description of the GRE tunnel. - `health_check?: HealthCheck` - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `mtu?: number` Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576. - `ttl?: number` Time To Live (TTL) in number of hops of the GRE tunnel. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const greTunnel = await client.magicTransit.greTunnels.get('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(greTunnel.gre_tunnel); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "gre_tunnel": { "id": "c4a7362d577a6c3019a474fd6f485821", "cloudflare_gre_endpoint": "203.0.113.1", "customer_gre_endpoint": "203.0.113.1", "interface_address": "192.0.2.0/31", "name": "GRE_1", "automatic_return_routing": true, "bgp": { "customer_asn": 0, "extra_prefixes": [ "string" ], "md5_key": "md5_key" }, "bgp_status": { "state": "BGP_DOWN", "tcp_established": true, "updated_at": "2019-12-27T18:11:19.117Z", "bgp_state": "bgp_state", "cf_speaker_ip": "192.168.1.1", "cf_speaker_port": 1, "customer_speaker_ip": "192.168.1.1", "customer_speaker_port": 1 }, "created_on": "2017-06-14T00:00:00Z", "description": "Tunnel for ISP X", "health_check": { "direction": "bidirectional", "enabled": true, "rate": "low", "target": { "effective": "203.0.113.1", "saved": "203.0.113.1" }, "type": "request" }, "interface_address6": "2606:54c1:7:0:a9fe:12d2:1:200/127", "modified_on": "2017-06-14T05:20:00Z", "mtu": 0, "ttl": 0 } }, "success": true } ``` ## Create a GRE tunnel `client.magicTransit.greTunnels.create(GRETunnelCreateParamsparams, RequestOptionsoptions?): GRETunnelCreateResponse` **post** `/accounts/{account_id}/magic/gre_tunnels` Creates a new GRE tunnel. Use `?validate_only=true` as an optional query parameter to only run validation without persisting changes. ### Parameters - `params: GRETunnelCreateParams` - `account_id: string` Path param: Identifier - `cloudflare_gre_endpoint: string` Body param: The IP address assigned to the Cloudflare side of the GRE tunnel. - `customer_gre_endpoint: string` Body param: The IP address assigned to the customer side of the GRE tunnel. - `interface_address: string` Body param: A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` Body param: The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel. - `automatic_return_routing?: boolean` Body param: True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` Body param - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `description?: string` Body param: An optional description of the GRE tunnel. - `health_check?: HealthCheck` Body param - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` Body param: A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `mtu?: number` Body param: Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576. - `ttl?: number` Body param: Time To Live (TTL) in number of hops of the GRE tunnel. - `xMagicNewHcTarget?: boolean` Header param: If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false. ### Returns - `GRETunnelCreateResponse` - `id: string` Identifier - `cloudflare_gre_endpoint: string` The IP address assigned to the Cloudflare side of the GRE tunnel. - `customer_gre_endpoint: string` The IP address assigned to the customer side of the GRE tunnel. - `interface_address: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel. - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `bgp_status?: BGPStatus` - `state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"` - `"BGP_DOWN"` - `"BGP_UP"` - `"BGP_ESTABLISHING"` - `tcp_established: boolean` - `updated_at: string` - `bgp_state?: string` - `cf_speaker_ip?: string` - `cf_speaker_port?: number` - `customer_speaker_ip?: string` - `customer_speaker_port?: number` - `created_on?: string` The date and time the tunnel was created. - `description?: string` An optional description of the GRE tunnel. - `health_check?: HealthCheck` - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `mtu?: number` Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576. - `ttl?: number` Time To Live (TTL) in number of hops of the GRE tunnel. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const greTunnel = await client.magicTransit.greTunnels.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', cloudflare_gre_endpoint: '203.0.113.1', customer_gre_endpoint: '203.0.113.1', interface_address: '192.0.2.0/31', name: 'GRE_1', }); console.log(greTunnel.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "c4a7362d577a6c3019a474fd6f485821", "cloudflare_gre_endpoint": "203.0.113.1", "customer_gre_endpoint": "203.0.113.1", "interface_address": "192.0.2.0/31", "name": "GRE_1", "automatic_return_routing": true, "bgp": { "customer_asn": 0, "extra_prefixes": [ "string" ], "md5_key": "md5_key" }, "bgp_status": { "state": "BGP_DOWN", "tcp_established": true, "updated_at": "2019-12-27T18:11:19.117Z", "bgp_state": "bgp_state", "cf_speaker_ip": "192.168.1.1", "cf_speaker_port": 1, "customer_speaker_ip": "192.168.1.1", "customer_speaker_port": 1 }, "created_on": "2017-06-14T00:00:00Z", "description": "Tunnel for ISP X", "health_check": { "direction": "bidirectional", "enabled": true, "rate": "low", "target": { "effective": "203.0.113.1", "saved": "203.0.113.1" }, "type": "request" }, "interface_address6": "2606:54c1:7:0:a9fe:12d2:1:200/127", "modified_on": "2017-06-14T05:20:00Z", "mtu": 0, "ttl": 0 }, "success": true } ``` ## Update GRE Tunnel `client.magicTransit.greTunnels.update(stringgreTunnelId, GRETunnelUpdateParamsparams, RequestOptionsoptions?): GRETunnelUpdateResponse` **put** `/accounts/{account_id}/magic/gre_tunnels/{gre_tunnel_id}` Updates a specific GRE tunnel. Use `?validate_only=true` as an optional query parameter to only run validation without persisting changes. ### Parameters - `greTunnelId: string` Identifier - `params: GRETunnelUpdateParams` - `account_id: string` Path param: Identifier - `cloudflare_gre_endpoint: string` Body param: The IP address assigned to the Cloudflare side of the GRE tunnel. - `customer_gre_endpoint: string` Body param: The IP address assigned to the customer side of the GRE tunnel. - `interface_address: string` Body param: A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` Body param: The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel. - `automatic_return_routing?: boolean` Body param: True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `description?: string` Body param: An optional description of the GRE tunnel. - `health_check?: HealthCheck` Body param - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` Body param: A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `mtu?: number` Body param: Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576. - `ttl?: number` Body param: Time To Live (TTL) in number of hops of the GRE tunnel. - `xMagicNewHcTarget?: boolean` Header param: If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false. ### Returns - `GRETunnelUpdateResponse` - `modified?: boolean` - `modified_gre_tunnel?: ModifiedGRETunnel` - `id: string` Identifier - `cloudflare_gre_endpoint: string` The IP address assigned to the Cloudflare side of the GRE tunnel. - `customer_gre_endpoint: string` The IP address assigned to the customer side of the GRE tunnel. - `interface_address: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel. - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `bgp_status?: BGPStatus` - `state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"` - `"BGP_DOWN"` - `"BGP_UP"` - `"BGP_ESTABLISHING"` - `tcp_established: boolean` - `updated_at: string` - `bgp_state?: string` - `cf_speaker_ip?: string` - `cf_speaker_port?: number` - `customer_speaker_ip?: string` - `customer_speaker_port?: number` - `created_on?: string` The date and time the tunnel was created. - `description?: string` An optional description of the GRE tunnel. - `health_check?: HealthCheck` - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `mtu?: number` Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576. - `ttl?: number` Time To Live (TTL) in number of hops of the GRE tunnel. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const greTunnel = await client.magicTransit.greTunnels.update('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', cloudflare_gre_endpoint: '203.0.113.1', customer_gre_endpoint: '203.0.113.1', interface_address: '192.0.2.0/31', name: 'GRE_1', }); console.log(greTunnel.modified); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "modified": true, "modified_gre_tunnel": { "id": "c4a7362d577a6c3019a474fd6f485821", "cloudflare_gre_endpoint": "203.0.113.1", "customer_gre_endpoint": "203.0.113.1", "interface_address": "192.0.2.0/31", "name": "GRE_1", "automatic_return_routing": true, "bgp": { "customer_asn": 0, "extra_prefixes": [ "string" ], "md5_key": "md5_key" }, "bgp_status": { "state": "BGP_DOWN", "tcp_established": true, "updated_at": "2019-12-27T18:11:19.117Z", "bgp_state": "bgp_state", "cf_speaker_ip": "192.168.1.1", "cf_speaker_port": 1, "customer_speaker_ip": "192.168.1.1", "customer_speaker_port": 1 }, "created_on": "2017-06-14T00:00:00Z", "description": "Tunnel for ISP X", "health_check": { "direction": "bidirectional", "enabled": true, "rate": "low", "target": { "effective": "203.0.113.1", "saved": "203.0.113.1" }, "type": "request" }, "interface_address6": "2606:54c1:7:0:a9fe:12d2:1:200/127", "modified_on": "2017-06-14T05:20:00Z", "mtu": 0, "ttl": 0 } }, "success": true } ``` ## Delete GRE Tunnel `client.magicTransit.greTunnels.delete(stringgreTunnelId, GRETunnelDeleteParamsparams, RequestOptionsoptions?): GRETunnelDeleteResponse` **delete** `/accounts/{account_id}/magic/gre_tunnels/{gre_tunnel_id}` Disables and removes a specific static GRE tunnel. Use `?validate_only=true` as an optional query parameter to only run validation without persisting changes. ### Parameters - `greTunnelId: string` Identifier - `params: GRETunnelDeleteParams` - `account_id: string` Path param: Identifier - `xMagicNewHcTarget?: boolean` Header param: If true, the health check target in the response body will be presented using the new object format. Defaults to false. ### Returns - `GRETunnelDeleteResponse` - `deleted?: boolean` - `deleted_gre_tunnel?: DeletedGRETunnel` - `id: string` Identifier - `cloudflare_gre_endpoint: string` The IP address assigned to the Cloudflare side of the GRE tunnel. - `customer_gre_endpoint: string` The IP address assigned to the customer side of the GRE tunnel. - `interface_address: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel. - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `bgp_status?: BGPStatus` - `state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"` - `"BGP_DOWN"` - `"BGP_UP"` - `"BGP_ESTABLISHING"` - `tcp_established: boolean` - `updated_at: string` - `bgp_state?: string` - `cf_speaker_ip?: string` - `cf_speaker_port?: number` - `customer_speaker_ip?: string` - `customer_speaker_port?: number` - `created_on?: string` The date and time the tunnel was created. - `description?: string` An optional description of the GRE tunnel. - `health_check?: HealthCheck` - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `mtu?: number` Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576. - `ttl?: number` Time To Live (TTL) in number of hops of the GRE tunnel. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const greTunnel = await client.magicTransit.greTunnels.delete('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(greTunnel.deleted); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "deleted": true, "deleted_gre_tunnel": { "id": "c4a7362d577a6c3019a474fd6f485821", "cloudflare_gre_endpoint": "203.0.113.1", "customer_gre_endpoint": "203.0.113.1", "interface_address": "192.0.2.0/31", "name": "GRE_1", "automatic_return_routing": true, "bgp": { "customer_asn": 0, "extra_prefixes": [ "string" ], "md5_key": "md5_key" }, "bgp_status": { "state": "BGP_DOWN", "tcp_established": true, "updated_at": "2019-12-27T18:11:19.117Z", "bgp_state": "bgp_state", "cf_speaker_ip": "192.168.1.1", "cf_speaker_port": 1, "customer_speaker_ip": "192.168.1.1", "customer_speaker_port": 1 }, "created_on": "2017-06-14T00:00:00Z", "description": "Tunnel for ISP X", "health_check": { "direction": "bidirectional", "enabled": true, "rate": "low", "target": { "effective": "203.0.113.1", "saved": "203.0.113.1" }, "type": "request" }, "interface_address6": "2606:54c1:7:0:a9fe:12d2:1:200/127", "modified_on": "2017-06-14T05:20:00Z", "mtu": 0, "ttl": 0 } }, "success": true } ``` ## Update multiple GRE tunnels `client.magicTransit.greTunnels.bulkUpdate(GRETunnelBulkUpdateParamsparams, RequestOptionsoptions?): GRETunnelBulkUpdateResponse` **put** `/accounts/{account_id}/magic/gre_tunnels` Updates multiple GRE tunnels. Use `?validate_only=true` as an optional query parameter to only run validation without persisting changes. ### Parameters - `params: GRETunnelBulkUpdateParams` - `account_id: string` Path param: Identifier - `body: unknown` Body param - `xMagicNewHcTarget?: boolean` Header param: If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false. ### Returns - `GRETunnelBulkUpdateResponse` - `modified?: boolean` - `modified_gre_tunnels?: Array` - `id: string` Identifier - `cloudflare_gre_endpoint: string` The IP address assigned to the Cloudflare side of the GRE tunnel. - `customer_gre_endpoint: string` The IP address assigned to the customer side of the GRE tunnel. - `interface_address: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel. - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `bgp_status?: BGPStatus` - `state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"` - `"BGP_DOWN"` - `"BGP_UP"` - `"BGP_ESTABLISHING"` - `tcp_established: boolean` - `updated_at: string` - `bgp_state?: string` - `cf_speaker_ip?: string` - `cf_speaker_port?: number` - `customer_speaker_ip?: string` - `customer_speaker_port?: number` - `created_on?: string` The date and time the tunnel was created. - `description?: string` An optional description of the GRE tunnel. - `health_check?: HealthCheck` - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `mtu?: number` Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576. - `ttl?: number` Time To Live (TTL) in number of hops of the GRE tunnel. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.magicTransit.greTunnels.bulkUpdate({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', body: {}, }); console.log(response.modified); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "modified": true, "modified_gre_tunnels": [ { "id": "c4a7362d577a6c3019a474fd6f485821", "cloudflare_gre_endpoint": "203.0.113.1", "customer_gre_endpoint": "203.0.113.1", "interface_address": "192.0.2.0/31", "name": "GRE_1", "automatic_return_routing": true, "bgp": { "customer_asn": 0, "extra_prefixes": [ "string" ], "md5_key": "md5_key" }, "bgp_status": { "state": "BGP_DOWN", "tcp_established": true, "updated_at": "2019-12-27T18:11:19.117Z", "bgp_state": "bgp_state", "cf_speaker_ip": "192.168.1.1", "cf_speaker_port": 1, "customer_speaker_ip": "192.168.1.1", "customer_speaker_port": 1 }, "created_on": "2017-06-14T00:00:00Z", "description": "Tunnel for ISP X", "health_check": { "direction": "bidirectional", "enabled": true, "rate": "low", "target": { "effective": "203.0.113.1", "saved": "203.0.113.1" }, "type": "request" }, "interface_address6": "2606:54c1:7:0:a9fe:12d2:1:200/127", "modified_on": "2017-06-14T05:20:00Z", "mtu": 0, "ttl": 0 } ] }, "success": true } ``` ## Domain Types ### GRE Tunnel List Response - `GRETunnelListResponse` - `gre_tunnels?: Array` - `id: string` Identifier - `cloudflare_gre_endpoint: string` The IP address assigned to the Cloudflare side of the GRE tunnel. - `customer_gre_endpoint: string` The IP address assigned to the customer side of the GRE tunnel. - `interface_address: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel. - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `bgp_status?: BGPStatus` - `state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"` - `"BGP_DOWN"` - `"BGP_UP"` - `"BGP_ESTABLISHING"` - `tcp_established: boolean` - `updated_at: string` - `bgp_state?: string` - `cf_speaker_ip?: string` - `cf_speaker_port?: number` - `customer_speaker_ip?: string` - `customer_speaker_port?: number` - `created_on?: string` The date and time the tunnel was created. - `description?: string` An optional description of the GRE tunnel. - `health_check?: HealthCheck` - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `mtu?: number` Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576. - `ttl?: number` Time To Live (TTL) in number of hops of the GRE tunnel. ### GRE Tunnel Get Response - `GRETunnelGetResponse` - `gre_tunnel?: GRETunnel` - `id: string` Identifier - `cloudflare_gre_endpoint: string` The IP address assigned to the Cloudflare side of the GRE tunnel. - `customer_gre_endpoint: string` The IP address assigned to the customer side of the GRE tunnel. - `interface_address: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel. - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `bgp_status?: BGPStatus` - `state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"` - `"BGP_DOWN"` - `"BGP_UP"` - `"BGP_ESTABLISHING"` - `tcp_established: boolean` - `updated_at: string` - `bgp_state?: string` - `cf_speaker_ip?: string` - `cf_speaker_port?: number` - `customer_speaker_ip?: string` - `customer_speaker_port?: number` - `created_on?: string` The date and time the tunnel was created. - `description?: string` An optional description of the GRE tunnel. - `health_check?: HealthCheck` - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `mtu?: number` Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576. - `ttl?: number` Time To Live (TTL) in number of hops of the GRE tunnel. ### GRE Tunnel Create Response - `GRETunnelCreateResponse` - `id: string` Identifier - `cloudflare_gre_endpoint: string` The IP address assigned to the Cloudflare side of the GRE tunnel. - `customer_gre_endpoint: string` The IP address assigned to the customer side of the GRE tunnel. - `interface_address: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel. - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `bgp_status?: BGPStatus` - `state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"` - `"BGP_DOWN"` - `"BGP_UP"` - `"BGP_ESTABLISHING"` - `tcp_established: boolean` - `updated_at: string` - `bgp_state?: string` - `cf_speaker_ip?: string` - `cf_speaker_port?: number` - `customer_speaker_ip?: string` - `customer_speaker_port?: number` - `created_on?: string` The date and time the tunnel was created. - `description?: string` An optional description of the GRE tunnel. - `health_check?: HealthCheck` - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `mtu?: number` Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576. - `ttl?: number` Time To Live (TTL) in number of hops of the GRE tunnel. ### GRE Tunnel Update Response - `GRETunnelUpdateResponse` - `modified?: boolean` - `modified_gre_tunnel?: ModifiedGRETunnel` - `id: string` Identifier - `cloudflare_gre_endpoint: string` The IP address assigned to the Cloudflare side of the GRE tunnel. - `customer_gre_endpoint: string` The IP address assigned to the customer side of the GRE tunnel. - `interface_address: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel. - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `bgp_status?: BGPStatus` - `state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"` - `"BGP_DOWN"` - `"BGP_UP"` - `"BGP_ESTABLISHING"` - `tcp_established: boolean` - `updated_at: string` - `bgp_state?: string` - `cf_speaker_ip?: string` - `cf_speaker_port?: number` - `customer_speaker_ip?: string` - `customer_speaker_port?: number` - `created_on?: string` The date and time the tunnel was created. - `description?: string` An optional description of the GRE tunnel. - `health_check?: HealthCheck` - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `mtu?: number` Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576. - `ttl?: number` Time To Live (TTL) in number of hops of the GRE tunnel. ### GRE Tunnel Delete Response - `GRETunnelDeleteResponse` - `deleted?: boolean` - `deleted_gre_tunnel?: DeletedGRETunnel` - `id: string` Identifier - `cloudflare_gre_endpoint: string` The IP address assigned to the Cloudflare side of the GRE tunnel. - `customer_gre_endpoint: string` The IP address assigned to the customer side of the GRE tunnel. - `interface_address: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel. - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `bgp_status?: BGPStatus` - `state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"` - `"BGP_DOWN"` - `"BGP_UP"` - `"BGP_ESTABLISHING"` - `tcp_established: boolean` - `updated_at: string` - `bgp_state?: string` - `cf_speaker_ip?: string` - `cf_speaker_port?: number` - `customer_speaker_ip?: string` - `customer_speaker_port?: number` - `created_on?: string` The date and time the tunnel was created. - `description?: string` An optional description of the GRE tunnel. - `health_check?: HealthCheck` - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `mtu?: number` Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576. - `ttl?: number` Time To Live (TTL) in number of hops of the GRE tunnel. ### GRE Tunnel Bulk Update Response - `GRETunnelBulkUpdateResponse` - `modified?: boolean` - `modified_gre_tunnels?: Array` - `id: string` Identifier - `cloudflare_gre_endpoint: string` The IP address assigned to the Cloudflare side of the GRE tunnel. - `customer_gre_endpoint: string` The IP address assigned to the customer side of the GRE tunnel. - `interface_address: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel. - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `bgp_status?: BGPStatus` - `state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"` - `"BGP_DOWN"` - `"BGP_UP"` - `"BGP_ESTABLISHING"` - `tcp_established: boolean` - `updated_at: string` - `bgp_state?: string` - `cf_speaker_ip?: string` - `cf_speaker_port?: number` - `customer_speaker_ip?: string` - `customer_speaker_port?: number` - `created_on?: string` The date and time the tunnel was created. - `description?: string` An optional description of the GRE tunnel. - `health_check?: HealthCheck` - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `mtu?: number` Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576. - `ttl?: number` Time To Live (TTL) in number of hops of the GRE tunnel. # IPSEC Tunnels ## List IPsec tunnels `client.magicTransit.ipsecTunnels.list(IPSECTunnelListParamsparams, RequestOptionsoptions?): IPSECTunnelListResponse` **get** `/accounts/{account_id}/magic/ipsec_tunnels` Lists IPsec tunnels associated with an account. ### Parameters - `params: IPSECTunnelListParams` - `account_id: string` Path param: Identifier - `xMagicNewHcTarget?: boolean` Header param: If true, the health check target in the response body will be presented using the new object format. Defaults to false. ### Returns - `IPSECTunnelListResponse` - `ipsec_tunnels?: Array` - `id: string` Identifier - `cloudflare_endpoint: string` The IP address assigned to the Cloudflare side of the IPsec tunnel. - `interface_address: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` The name of the IPsec tunnel. The name cannot share a name with other tunnels. - `allow_null_cipher?: boolean` When `true`, the tunnel can use a null-cipher (`ENCR_NULL`) in the ESP tunnel (Phase 2). - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `bgp_status?: BGPStatus` - `state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"` - `"BGP_DOWN"` - `"BGP_UP"` - `"BGP_ESTABLISHING"` - `tcp_established: boolean` - `updated_at: string` - `bgp_state?: string` - `cf_speaker_ip?: string` - `cf_speaker_port?: number` - `customer_speaker_ip?: string` - `customer_speaker_port?: number` - `created_on?: string` The date and time the tunnel was created. - `custom_remote_identities?: CustomRemoteIdentities` - `fqdn_id?: string` A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The generated IKE IDs can still be used even if this custom value is specified. Must be of the form `..custom.ipsec.cloudflare.com`. This custom ID does not need to be unique. Two IPsec tunnels may have the same custom fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels cannot have the same cloudflare_endpoint. - `customer_endpoint?: string` The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work. - `description?: string` An optional description forthe IPsec tunnel. - `health_check?: HealthCheck` - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `psk_metadata?: PSKMetadata` The PSK metadata that includes when the PSK was generated. - `last_generated_on?: string` The date and time the tunnel was last modified. - `replay_protection?: boolean` If `true`, then IPsec replay protection will be supported in the Cloudflare-to-customer direction. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const ipsecTunnels = await client.magicTransit.ipsecTunnels.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(ipsecTunnels.ipsec_tunnels); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "ipsec_tunnels": [ { "id": "c4a7362d577a6c3019a474fd6f485821", "cloudflare_endpoint": "203.0.113.1", "interface_address": "192.0.2.0/31", "name": "IPsec_1", "allow_null_cipher": true, "automatic_return_routing": true, "bgp": { "customer_asn": 0, "extra_prefixes": [ "string" ], "md5_key": "md5_key" }, "bgp_status": { "state": "BGP_DOWN", "tcp_established": true, "updated_at": "2019-12-27T18:11:19.117Z", "bgp_state": "bgp_state", "cf_speaker_ip": "192.168.1.1", "cf_speaker_port": 1, "customer_speaker_ip": "192.168.1.1", "customer_speaker_port": 1 }, "created_on": "2017-06-14T00:00:00Z", "custom_remote_identities": { "fqdn_id": "fqdn_id" }, "customer_endpoint": "203.0.113.1", "description": "Tunnel for ISP X", "health_check": { "direction": "bidirectional", "enabled": true, "rate": "low", "target": { "effective": "203.0.113.1", "saved": "203.0.113.1" }, "type": "request" }, "interface_address6": "2606:54c1:7:0:a9fe:12d2:1:200/127", "modified_on": "2017-06-14T05:20:00Z", "psk_metadata": { "last_generated_on": "2017-06-14T05:20:00Z" }, "replay_protection": false } ] }, "success": true } ``` ## List IPsec tunnel details `client.magicTransit.ipsecTunnels.get(stringipsecTunnelId, IPSECTunnelGetParamsparams, RequestOptionsoptions?): IPSECTunnelGetResponse` **get** `/accounts/{account_id}/magic/ipsec_tunnels/{ipsec_tunnel_id}` Lists details for a specific IPsec tunnel. ### Parameters - `ipsecTunnelId: string` Identifier - `params: IPSECTunnelGetParams` - `account_id: string` Path param: Identifier - `xMagicNewHcTarget?: boolean` Header param: If true, the health check target in the response body will be presented using the new object format. Defaults to false. ### Returns - `IPSECTunnelGetResponse` - `ipsec_tunnel?: IPSECTunnel` - `id: string` Identifier - `cloudflare_endpoint: string` The IP address assigned to the Cloudflare side of the IPsec tunnel. - `interface_address: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` The name of the IPsec tunnel. The name cannot share a name with other tunnels. - `allow_null_cipher?: boolean` When `true`, the tunnel can use a null-cipher (`ENCR_NULL`) in the ESP tunnel (Phase 2). - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `bgp_status?: BGPStatus` - `state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"` - `"BGP_DOWN"` - `"BGP_UP"` - `"BGP_ESTABLISHING"` - `tcp_established: boolean` - `updated_at: string` - `bgp_state?: string` - `cf_speaker_ip?: string` - `cf_speaker_port?: number` - `customer_speaker_ip?: string` - `customer_speaker_port?: number` - `created_on?: string` The date and time the tunnel was created. - `custom_remote_identities?: CustomRemoteIdentities` - `fqdn_id?: string` A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The generated IKE IDs can still be used even if this custom value is specified. Must be of the form `..custom.ipsec.cloudflare.com`. This custom ID does not need to be unique. Two IPsec tunnels may have the same custom fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels cannot have the same cloudflare_endpoint. - `customer_endpoint?: string` The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work. - `description?: string` An optional description forthe IPsec tunnel. - `health_check?: HealthCheck` - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `psk_metadata?: PSKMetadata` The PSK metadata that includes when the PSK was generated. - `last_generated_on?: string` The date and time the tunnel was last modified. - `replay_protection?: boolean` If `true`, then IPsec replay protection will be supported in the Cloudflare-to-customer direction. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const ipsecTunnel = await client.magicTransit.ipsecTunnels.get('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(ipsecTunnel.ipsec_tunnel); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "ipsec_tunnel": { "id": "c4a7362d577a6c3019a474fd6f485821", "cloudflare_endpoint": "203.0.113.1", "interface_address": "192.0.2.0/31", "name": "IPsec_1", "allow_null_cipher": true, "automatic_return_routing": true, "bgp": { "customer_asn": 0, "extra_prefixes": [ "string" ], "md5_key": "md5_key" }, "bgp_status": { "state": "BGP_DOWN", "tcp_established": true, "updated_at": "2019-12-27T18:11:19.117Z", "bgp_state": "bgp_state", "cf_speaker_ip": "192.168.1.1", "cf_speaker_port": 1, "customer_speaker_ip": "192.168.1.1", "customer_speaker_port": 1 }, "created_on": "2017-06-14T00:00:00Z", "custom_remote_identities": { "fqdn_id": "fqdn_id" }, "customer_endpoint": "203.0.113.1", "description": "Tunnel for ISP X", "health_check": { "direction": "bidirectional", "enabled": true, "rate": "low", "target": { "effective": "203.0.113.1", "saved": "203.0.113.1" }, "type": "request" }, "interface_address6": "2606:54c1:7:0:a9fe:12d2:1:200/127", "modified_on": "2017-06-14T05:20:00Z", "psk_metadata": { "last_generated_on": "2017-06-14T05:20:00Z" }, "replay_protection": false } }, "success": true } ``` ## Create an IPsec tunnel `client.magicTransit.ipsecTunnels.create(IPSECTunnelCreateParamsparams, RequestOptionsoptions?): IPSECTunnelCreateResponse` **post** `/accounts/{account_id}/magic/ipsec_tunnels` Creates a new IPsec tunnel associated with an account. Use `?validate_only=true` as an optional query parameter to only run validation without persisting changes. ### Parameters - `params: IPSECTunnelCreateParams` - `account_id: string` Path param: Identifier - `cloudflare_endpoint: string` Body param: The IP address assigned to the Cloudflare side of the IPsec tunnel. - `interface_address: string` Body param: A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` Body param: The name of the IPsec tunnel. The name cannot share a name with other tunnels. - `automatic_return_routing?: boolean` Body param: True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` Body param - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `custom_remote_identities?: CustomRemoteIdentities` Body param - `fqdn_id?: string` A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The generated IKE IDs can still be used even if this custom value is specified. Must be of the form `..custom.ipsec.cloudflare.com`. This custom ID does not need to be unique. Two IPsec tunnels may have the same custom fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels cannot have the same cloudflare_endpoint. - `customer_endpoint?: string` Body param: The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work. - `description?: string` Body param: An optional description forthe IPsec tunnel. - `health_check?: HealthCheck` Body param - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` Body param: A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `psk?: string` Body param: A randomly generated or provided string for use in the IPsec tunnel. - `replay_protection?: boolean` Body param: If `true`, then IPsec replay protection will be supported in the Cloudflare-to-customer direction. - `xMagicNewHcTarget?: boolean` Header param: If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false. ### Returns - `IPSECTunnelCreateResponse` - `id: string` Identifier - `cloudflare_endpoint: string` The IP address assigned to the Cloudflare side of the IPsec tunnel. - `interface_address: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` The name of the IPsec tunnel. The name cannot share a name with other tunnels. - `allow_null_cipher?: boolean` When `true`, the tunnel can use a null-cipher (`ENCR_NULL`) in the ESP tunnel (Phase 2). - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `bgp_status?: BGPStatus` - `state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"` - `"BGP_DOWN"` - `"BGP_UP"` - `"BGP_ESTABLISHING"` - `tcp_established: boolean` - `updated_at: string` - `bgp_state?: string` - `cf_speaker_ip?: string` - `cf_speaker_port?: number` - `customer_speaker_ip?: string` - `customer_speaker_port?: number` - `created_on?: string` The date and time the tunnel was created. - `custom_remote_identities?: CustomRemoteIdentities` - `fqdn_id?: string` A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The generated IKE IDs can still be used even if this custom value is specified. Must be of the form `..custom.ipsec.cloudflare.com`. This custom ID does not need to be unique. Two IPsec tunnels may have the same custom fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels cannot have the same cloudflare_endpoint. - `customer_endpoint?: string` The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work. - `description?: string` An optional description forthe IPsec tunnel. - `health_check?: HealthCheck` - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `psk_metadata?: PSKMetadata` The PSK metadata that includes when the PSK was generated. - `last_generated_on?: string` The date and time the tunnel was last modified. - `replay_protection?: boolean` If `true`, then IPsec replay protection will be supported in the Cloudflare-to-customer direction. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const ipsecTunnel = await client.magicTransit.ipsecTunnels.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', cloudflare_endpoint: '203.0.113.1', interface_address: '192.0.2.0/31', name: 'IPsec_1', }); console.log(ipsecTunnel.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "c4a7362d577a6c3019a474fd6f485821", "cloudflare_endpoint": "203.0.113.1", "interface_address": "192.0.2.0/31", "name": "IPsec_1", "allow_null_cipher": true, "automatic_return_routing": true, "bgp": { "customer_asn": 0, "extra_prefixes": [ "string" ], "md5_key": "md5_key" }, "bgp_status": { "state": "BGP_DOWN", "tcp_established": true, "updated_at": "2019-12-27T18:11:19.117Z", "bgp_state": "bgp_state", "cf_speaker_ip": "192.168.1.1", "cf_speaker_port": 1, "customer_speaker_ip": "192.168.1.1", "customer_speaker_port": 1 }, "created_on": "2017-06-14T00:00:00Z", "custom_remote_identities": { "fqdn_id": "fqdn_id" }, "customer_endpoint": "203.0.113.1", "description": "Tunnel for ISP X", "health_check": { "direction": "bidirectional", "enabled": true, "rate": "low", "target": { "effective": "203.0.113.1", "saved": "203.0.113.1" }, "type": "request" }, "interface_address6": "2606:54c1:7:0:a9fe:12d2:1:200/127", "modified_on": "2017-06-14T05:20:00Z", "psk_metadata": { "last_generated_on": "2017-06-14T05:20:00Z" }, "replay_protection": false }, "success": true } ``` ## Update IPsec Tunnel `client.magicTransit.ipsecTunnels.update(stringipsecTunnelId, IPSECTunnelUpdateParamsparams, RequestOptionsoptions?): IPSECTunnelUpdateResponse` **put** `/accounts/{account_id}/magic/ipsec_tunnels/{ipsec_tunnel_id}` Updates a specific IPsec tunnel associated with an account. Use `?validate_only=true` as an optional query parameter to only run validation without persisting changes. ### Parameters - `ipsecTunnelId: string` Identifier - `params: IPSECTunnelUpdateParams` - `account_id: string` Path param: Identifier - `cloudflare_endpoint: string` Body param: The IP address assigned to the Cloudflare side of the IPsec tunnel. - `interface_address: string` Body param: A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` Body param: The name of the IPsec tunnel. The name cannot share a name with other tunnels. - `automatic_return_routing?: boolean` Body param: True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` Body param - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `custom_remote_identities?: CustomRemoteIdentities` Body param - `fqdn_id?: string` A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The generated IKE IDs can still be used even if this custom value is specified. Must be of the form `..custom.ipsec.cloudflare.com`. This custom ID does not need to be unique. Two IPsec tunnels may have the same custom fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels cannot have the same cloudflare_endpoint. - `customer_endpoint?: string` Body param: The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work. - `description?: string` Body param: An optional description forthe IPsec tunnel. - `health_check?: HealthCheck` Body param - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` Body param: A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `psk?: string` Body param: A randomly generated or provided string for use in the IPsec tunnel. - `replay_protection?: boolean` Body param: If `true`, then IPsec replay protection will be supported in the Cloudflare-to-customer direction. - `xMagicNewHcTarget?: boolean` Header param: If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false. ### Returns - `IPSECTunnelUpdateResponse` - `modified?: boolean` - `modified_ipsec_tunnel?: ModifiedIPSECTunnel` - `id: string` Identifier - `cloudflare_endpoint: string` The IP address assigned to the Cloudflare side of the IPsec tunnel. - `interface_address: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` The name of the IPsec tunnel. The name cannot share a name with other tunnels. - `allow_null_cipher?: boolean` When `true`, the tunnel can use a null-cipher (`ENCR_NULL`) in the ESP tunnel (Phase 2). - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `bgp_status?: BGPStatus` - `state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"` - `"BGP_DOWN"` - `"BGP_UP"` - `"BGP_ESTABLISHING"` - `tcp_established: boolean` - `updated_at: string` - `bgp_state?: string` - `cf_speaker_ip?: string` - `cf_speaker_port?: number` - `customer_speaker_ip?: string` - `customer_speaker_port?: number` - `created_on?: string` The date and time the tunnel was created. - `custom_remote_identities?: CustomRemoteIdentities` - `fqdn_id?: string` A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The generated IKE IDs can still be used even if this custom value is specified. Must be of the form `..custom.ipsec.cloudflare.com`. This custom ID does not need to be unique. Two IPsec tunnels may have the same custom fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels cannot have the same cloudflare_endpoint. - `customer_endpoint?: string` The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work. - `description?: string` An optional description forthe IPsec tunnel. - `health_check?: HealthCheck` - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `psk_metadata?: PSKMetadata` The PSK metadata that includes when the PSK was generated. - `last_generated_on?: string` The date and time the tunnel was last modified. - `replay_protection?: boolean` If `true`, then IPsec replay protection will be supported in the Cloudflare-to-customer direction. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const ipsecTunnel = await client.magicTransit.ipsecTunnels.update( '023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', cloudflare_endpoint: '203.0.113.1', interface_address: '192.0.2.0/31', name: 'IPsec_1', }, ); console.log(ipsecTunnel.modified); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "modified": true, "modified_ipsec_tunnel": { "id": "c4a7362d577a6c3019a474fd6f485821", "cloudflare_endpoint": "203.0.113.1", "interface_address": "192.0.2.0/31", "name": "IPsec_1", "allow_null_cipher": true, "automatic_return_routing": true, "bgp": { "customer_asn": 0, "extra_prefixes": [ "string" ], "md5_key": "md5_key" }, "bgp_status": { "state": "BGP_DOWN", "tcp_established": true, "updated_at": "2019-12-27T18:11:19.117Z", "bgp_state": "bgp_state", "cf_speaker_ip": "192.168.1.1", "cf_speaker_port": 1, "customer_speaker_ip": "192.168.1.1", "customer_speaker_port": 1 }, "created_on": "2017-06-14T00:00:00Z", "custom_remote_identities": { "fqdn_id": "fqdn_id" }, "customer_endpoint": "203.0.113.1", "description": "Tunnel for ISP X", "health_check": { "direction": "bidirectional", "enabled": true, "rate": "low", "target": { "effective": "203.0.113.1", "saved": "203.0.113.1" }, "type": "request" }, "interface_address6": "2606:54c1:7:0:a9fe:12d2:1:200/127", "modified_on": "2017-06-14T05:20:00Z", "psk_metadata": { "last_generated_on": "2017-06-14T05:20:00Z" }, "replay_protection": false } }, "success": true } ``` ## Delete IPsec Tunnel `client.magicTransit.ipsecTunnels.delete(stringipsecTunnelId, IPSECTunnelDeleteParamsparams, RequestOptionsoptions?): IPSECTunnelDeleteResponse` **delete** `/accounts/{account_id}/magic/ipsec_tunnels/{ipsec_tunnel_id}` Disables and removes a specific static IPsec Tunnel associated with an account. Use `?validate_only=true` as an optional query parameter to only run validation without persisting changes. ### Parameters - `ipsecTunnelId: string` Identifier - `params: IPSECTunnelDeleteParams` - `account_id: string` Path param: Identifier - `xMagicNewHcTarget?: boolean` Header param: If true, the health check target in the response body will be presented using the new object format. Defaults to false. ### Returns - `IPSECTunnelDeleteResponse` - `deleted?: boolean` - `deleted_ipsec_tunnel?: DeletedIPSECTunnel` - `id: string` Identifier - `cloudflare_endpoint: string` The IP address assigned to the Cloudflare side of the IPsec tunnel. - `interface_address: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` The name of the IPsec tunnel. The name cannot share a name with other tunnels. - `allow_null_cipher?: boolean` When `true`, the tunnel can use a null-cipher (`ENCR_NULL`) in the ESP tunnel (Phase 2). - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `bgp_status?: BGPStatus` - `state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"` - `"BGP_DOWN"` - `"BGP_UP"` - `"BGP_ESTABLISHING"` - `tcp_established: boolean` - `updated_at: string` - `bgp_state?: string` - `cf_speaker_ip?: string` - `cf_speaker_port?: number` - `customer_speaker_ip?: string` - `customer_speaker_port?: number` - `created_on?: string` The date and time the tunnel was created. - `custom_remote_identities?: CustomRemoteIdentities` - `fqdn_id?: string` A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The generated IKE IDs can still be used even if this custom value is specified. Must be of the form `..custom.ipsec.cloudflare.com`. This custom ID does not need to be unique. Two IPsec tunnels may have the same custom fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels cannot have the same cloudflare_endpoint. - `customer_endpoint?: string` The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work. - `description?: string` An optional description forthe IPsec tunnel. - `health_check?: HealthCheck` - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `psk_metadata?: PSKMetadata` The PSK metadata that includes when the PSK was generated. - `last_generated_on?: string` The date and time the tunnel was last modified. - `replay_protection?: boolean` If `true`, then IPsec replay protection will be supported in the Cloudflare-to-customer direction. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const ipsecTunnel = await client.magicTransit.ipsecTunnels.delete( '023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(ipsecTunnel.deleted); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "deleted": true, "deleted_ipsec_tunnel": { "id": "c4a7362d577a6c3019a474fd6f485821", "cloudflare_endpoint": "203.0.113.1", "interface_address": "192.0.2.0/31", "name": "IPsec_1", "allow_null_cipher": true, "automatic_return_routing": true, "bgp": { "customer_asn": 0, "extra_prefixes": [ "string" ], "md5_key": "md5_key" }, "bgp_status": { "state": "BGP_DOWN", "tcp_established": true, "updated_at": "2019-12-27T18:11:19.117Z", "bgp_state": "bgp_state", "cf_speaker_ip": "192.168.1.1", "cf_speaker_port": 1, "customer_speaker_ip": "192.168.1.1", "customer_speaker_port": 1 }, "created_on": "2017-06-14T00:00:00Z", "custom_remote_identities": { "fqdn_id": "fqdn_id" }, "customer_endpoint": "203.0.113.1", "description": "Tunnel for ISP X", "health_check": { "direction": "bidirectional", "enabled": true, "rate": "low", "target": { "effective": "203.0.113.1", "saved": "203.0.113.1" }, "type": "request" }, "interface_address6": "2606:54c1:7:0:a9fe:12d2:1:200/127", "modified_on": "2017-06-14T05:20:00Z", "psk_metadata": { "last_generated_on": "2017-06-14T05:20:00Z" }, "replay_protection": false } }, "success": true } ``` ## Update multiple IPsec tunnels `client.magicTransit.ipsecTunnels.bulkUpdate(IPSECTunnelBulkUpdateParamsparams, RequestOptionsoptions?): IPSECTunnelBulkUpdateResponse` **put** `/accounts/{account_id}/magic/ipsec_tunnels` Update multiple IPsec tunnels associated with an account. Use `?validate_only=true` as an optional query parameter to only run validation without persisting changes. ### Parameters - `params: IPSECTunnelBulkUpdateParams` - `account_id: string` Path param: Identifier - `body: unknown` Body param - `xMagicNewHcTarget?: boolean` Header param: If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false. ### Returns - `IPSECTunnelBulkUpdateResponse` - `modified?: boolean` - `modified_ipsec_tunnels?: Array` - `id: string` Identifier - `cloudflare_endpoint: string` The IP address assigned to the Cloudflare side of the IPsec tunnel. - `interface_address: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` The name of the IPsec tunnel. The name cannot share a name with other tunnels. - `allow_null_cipher?: boolean` When `true`, the tunnel can use a null-cipher (`ENCR_NULL`) in the ESP tunnel (Phase 2). - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `bgp_status?: BGPStatus` - `state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"` - `"BGP_DOWN"` - `"BGP_UP"` - `"BGP_ESTABLISHING"` - `tcp_established: boolean` - `updated_at: string` - `bgp_state?: string` - `cf_speaker_ip?: string` - `cf_speaker_port?: number` - `customer_speaker_ip?: string` - `customer_speaker_port?: number` - `created_on?: string` The date and time the tunnel was created. - `custom_remote_identities?: CustomRemoteIdentities` - `fqdn_id?: string` A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The generated IKE IDs can still be used even if this custom value is specified. Must be of the form `..custom.ipsec.cloudflare.com`. This custom ID does not need to be unique. Two IPsec tunnels may have the same custom fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels cannot have the same cloudflare_endpoint. - `customer_endpoint?: string` The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work. - `description?: string` An optional description forthe IPsec tunnel. - `health_check?: HealthCheck` - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `psk_metadata?: PSKMetadata` The PSK metadata that includes when the PSK was generated. - `last_generated_on?: string` The date and time the tunnel was last modified. - `replay_protection?: boolean` If `true`, then IPsec replay protection will be supported in the Cloudflare-to-customer direction. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.magicTransit.ipsecTunnels.bulkUpdate({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', body: {}, }); console.log(response.modified); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "modified": true, "modified_ipsec_tunnels": [ { "id": "c4a7362d577a6c3019a474fd6f485821", "cloudflare_endpoint": "203.0.113.1", "interface_address": "192.0.2.0/31", "name": "IPsec_1", "allow_null_cipher": true, "automatic_return_routing": true, "bgp": { "customer_asn": 0, "extra_prefixes": [ "string" ], "md5_key": "md5_key" }, "bgp_status": { "state": "BGP_DOWN", "tcp_established": true, "updated_at": "2019-12-27T18:11:19.117Z", "bgp_state": "bgp_state", "cf_speaker_ip": "192.168.1.1", "cf_speaker_port": 1, "customer_speaker_ip": "192.168.1.1", "customer_speaker_port": 1 }, "created_on": "2017-06-14T00:00:00Z", "custom_remote_identities": { "fqdn_id": "fqdn_id" }, "customer_endpoint": "203.0.113.1", "description": "Tunnel for ISP X", "health_check": { "direction": "bidirectional", "enabled": true, "rate": "low", "target": { "effective": "203.0.113.1", "saved": "203.0.113.1" }, "type": "request" }, "interface_address6": "2606:54c1:7:0:a9fe:12d2:1:200/127", "modified_on": "2017-06-14T05:20:00Z", "psk_metadata": { "last_generated_on": "2017-06-14T05:20:00Z" }, "replay_protection": false } ] }, "success": true } ``` ## Generate Pre Shared Key (PSK) for IPsec tunnels `client.magicTransit.ipsecTunnels.pskGenerate(stringipsecTunnelId, IPSECTunnelPSKGenerateParamsparams, RequestOptionsoptions?): IPSECTunnelPSKGenerateResponse` **post** `/accounts/{account_id}/magic/ipsec_tunnels/{ipsec_tunnel_id}/psk_generate` Generates a Pre Shared Key for a specific IPsec tunnel used in the IKE session. Use `?validate_only=true` as an optional query parameter to only run validation without persisting changes. After a PSK is generated, the PSK is immediately persisted to Cloudflare's edge and cannot be retrieved later. Note the PSK in a safe place. ### Parameters - `ipsecTunnelId: string` Identifier - `params: IPSECTunnelPSKGenerateParams` - `account_id: string` Path param: Identifier - `body: unknown` Body param ### Returns - `IPSECTunnelPSKGenerateResponse` - `ipsec_tunnel_id?: string` Identifier - `psk?: string` A randomly generated or provided string for use in the IPsec tunnel. - `psk_metadata?: PSKMetadata` The PSK metadata that includes when the PSK was generated. - `last_generated_on?: string` The date and time the tunnel was last modified. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.magicTransit.ipsecTunnels.pskGenerate( '023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', body: {}, }, ); console.log(response.ipsec_tunnel_id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "ipsec_tunnel_id": "023e105f4ecef8ad9ca31a8372d0c353", "psk": "O3bwKSjnaoCxDoUxjcq4Rk8ZKkezQUiy", "psk_metadata": { "last_generated_on": "2017-06-14T05:20:00Z" } }, "success": true } ``` ## Domain Types ### PSK Metadata - `PSKMetadata` The PSK metadata that includes when the PSK was generated. - `last_generated_on?: string` The date and time the tunnel was last modified. ### IPSEC Tunnel List Response - `IPSECTunnelListResponse` - `ipsec_tunnels?: Array` - `id: string` Identifier - `cloudflare_endpoint: string` The IP address assigned to the Cloudflare side of the IPsec tunnel. - `interface_address: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` The name of the IPsec tunnel. The name cannot share a name with other tunnels. - `allow_null_cipher?: boolean` When `true`, the tunnel can use a null-cipher (`ENCR_NULL`) in the ESP tunnel (Phase 2). - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `bgp_status?: BGPStatus` - `state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"` - `"BGP_DOWN"` - `"BGP_UP"` - `"BGP_ESTABLISHING"` - `tcp_established: boolean` - `updated_at: string` - `bgp_state?: string` - `cf_speaker_ip?: string` - `cf_speaker_port?: number` - `customer_speaker_ip?: string` - `customer_speaker_port?: number` - `created_on?: string` The date and time the tunnel was created. - `custom_remote_identities?: CustomRemoteIdentities` - `fqdn_id?: string` A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The generated IKE IDs can still be used even if this custom value is specified. Must be of the form `..custom.ipsec.cloudflare.com`. This custom ID does not need to be unique. Two IPsec tunnels may have the same custom fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels cannot have the same cloudflare_endpoint. - `customer_endpoint?: string` The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work. - `description?: string` An optional description forthe IPsec tunnel. - `health_check?: HealthCheck` - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `psk_metadata?: PSKMetadata` The PSK metadata that includes when the PSK was generated. - `last_generated_on?: string` The date and time the tunnel was last modified. - `replay_protection?: boolean` If `true`, then IPsec replay protection will be supported in the Cloudflare-to-customer direction. ### IPSEC Tunnel Get Response - `IPSECTunnelGetResponse` - `ipsec_tunnel?: IPSECTunnel` - `id: string` Identifier - `cloudflare_endpoint: string` The IP address assigned to the Cloudflare side of the IPsec tunnel. - `interface_address: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` The name of the IPsec tunnel. The name cannot share a name with other tunnels. - `allow_null_cipher?: boolean` When `true`, the tunnel can use a null-cipher (`ENCR_NULL`) in the ESP tunnel (Phase 2). - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `bgp_status?: BGPStatus` - `state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"` - `"BGP_DOWN"` - `"BGP_UP"` - `"BGP_ESTABLISHING"` - `tcp_established: boolean` - `updated_at: string` - `bgp_state?: string` - `cf_speaker_ip?: string` - `cf_speaker_port?: number` - `customer_speaker_ip?: string` - `customer_speaker_port?: number` - `created_on?: string` The date and time the tunnel was created. - `custom_remote_identities?: CustomRemoteIdentities` - `fqdn_id?: string` A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The generated IKE IDs can still be used even if this custom value is specified. Must be of the form `..custom.ipsec.cloudflare.com`. This custom ID does not need to be unique. Two IPsec tunnels may have the same custom fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels cannot have the same cloudflare_endpoint. - `customer_endpoint?: string` The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work. - `description?: string` An optional description forthe IPsec tunnel. - `health_check?: HealthCheck` - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `psk_metadata?: PSKMetadata` The PSK metadata that includes when the PSK was generated. - `last_generated_on?: string` The date and time the tunnel was last modified. - `replay_protection?: boolean` If `true`, then IPsec replay protection will be supported in the Cloudflare-to-customer direction. ### IPSEC Tunnel Create Response - `IPSECTunnelCreateResponse` - `id: string` Identifier - `cloudflare_endpoint: string` The IP address assigned to the Cloudflare side of the IPsec tunnel. - `interface_address: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` The name of the IPsec tunnel. The name cannot share a name with other tunnels. - `allow_null_cipher?: boolean` When `true`, the tunnel can use a null-cipher (`ENCR_NULL`) in the ESP tunnel (Phase 2). - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `bgp_status?: BGPStatus` - `state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"` - `"BGP_DOWN"` - `"BGP_UP"` - `"BGP_ESTABLISHING"` - `tcp_established: boolean` - `updated_at: string` - `bgp_state?: string` - `cf_speaker_ip?: string` - `cf_speaker_port?: number` - `customer_speaker_ip?: string` - `customer_speaker_port?: number` - `created_on?: string` The date and time the tunnel was created. - `custom_remote_identities?: CustomRemoteIdentities` - `fqdn_id?: string` A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The generated IKE IDs can still be used even if this custom value is specified. Must be of the form `..custom.ipsec.cloudflare.com`. This custom ID does not need to be unique. Two IPsec tunnels may have the same custom fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels cannot have the same cloudflare_endpoint. - `customer_endpoint?: string` The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work. - `description?: string` An optional description forthe IPsec tunnel. - `health_check?: HealthCheck` - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `psk_metadata?: PSKMetadata` The PSK metadata that includes when the PSK was generated. - `last_generated_on?: string` The date and time the tunnel was last modified. - `replay_protection?: boolean` If `true`, then IPsec replay protection will be supported in the Cloudflare-to-customer direction. ### IPSEC Tunnel Update Response - `IPSECTunnelUpdateResponse` - `modified?: boolean` - `modified_ipsec_tunnel?: ModifiedIPSECTunnel` - `id: string` Identifier - `cloudflare_endpoint: string` The IP address assigned to the Cloudflare side of the IPsec tunnel. - `interface_address: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` The name of the IPsec tunnel. The name cannot share a name with other tunnels. - `allow_null_cipher?: boolean` When `true`, the tunnel can use a null-cipher (`ENCR_NULL`) in the ESP tunnel (Phase 2). - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `bgp_status?: BGPStatus` - `state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"` - `"BGP_DOWN"` - `"BGP_UP"` - `"BGP_ESTABLISHING"` - `tcp_established: boolean` - `updated_at: string` - `bgp_state?: string` - `cf_speaker_ip?: string` - `cf_speaker_port?: number` - `customer_speaker_ip?: string` - `customer_speaker_port?: number` - `created_on?: string` The date and time the tunnel was created. - `custom_remote_identities?: CustomRemoteIdentities` - `fqdn_id?: string` A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The generated IKE IDs can still be used even if this custom value is specified. Must be of the form `..custom.ipsec.cloudflare.com`. This custom ID does not need to be unique. Two IPsec tunnels may have the same custom fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels cannot have the same cloudflare_endpoint. - `customer_endpoint?: string` The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work. - `description?: string` An optional description forthe IPsec tunnel. - `health_check?: HealthCheck` - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `psk_metadata?: PSKMetadata` The PSK metadata that includes when the PSK was generated. - `last_generated_on?: string` The date and time the tunnel was last modified. - `replay_protection?: boolean` If `true`, then IPsec replay protection will be supported in the Cloudflare-to-customer direction. ### IPSEC Tunnel Delete Response - `IPSECTunnelDeleteResponse` - `deleted?: boolean` - `deleted_ipsec_tunnel?: DeletedIPSECTunnel` - `id: string` Identifier - `cloudflare_endpoint: string` The IP address assigned to the Cloudflare side of the IPsec tunnel. - `interface_address: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` The name of the IPsec tunnel. The name cannot share a name with other tunnels. - `allow_null_cipher?: boolean` When `true`, the tunnel can use a null-cipher (`ENCR_NULL`) in the ESP tunnel (Phase 2). - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `bgp_status?: BGPStatus` - `state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"` - `"BGP_DOWN"` - `"BGP_UP"` - `"BGP_ESTABLISHING"` - `tcp_established: boolean` - `updated_at: string` - `bgp_state?: string` - `cf_speaker_ip?: string` - `cf_speaker_port?: number` - `customer_speaker_ip?: string` - `customer_speaker_port?: number` - `created_on?: string` The date and time the tunnel was created. - `custom_remote_identities?: CustomRemoteIdentities` - `fqdn_id?: string` A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The generated IKE IDs can still be used even if this custom value is specified. Must be of the form `..custom.ipsec.cloudflare.com`. This custom ID does not need to be unique. Two IPsec tunnels may have the same custom fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels cannot have the same cloudflare_endpoint. - `customer_endpoint?: string` The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work. - `description?: string` An optional description forthe IPsec tunnel. - `health_check?: HealthCheck` - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `psk_metadata?: PSKMetadata` The PSK metadata that includes when the PSK was generated. - `last_generated_on?: string` The date and time the tunnel was last modified. - `replay_protection?: boolean` If `true`, then IPsec replay protection will be supported in the Cloudflare-to-customer direction. ### IPSEC Tunnel Bulk Update Response - `IPSECTunnelBulkUpdateResponse` - `modified?: boolean` - `modified_ipsec_tunnels?: Array` - `id: string` Identifier - `cloudflare_endpoint: string` The IP address assigned to the Cloudflare side of the IPsec tunnel. - `interface_address: string` A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - `name: string` The name of the IPsec tunnel. The name cannot share a name with other tunnels. - `allow_null_cipher?: boolean` When `true`, the tunnel can use a null-cipher (`ENCR_NULL`) in the ESP tunnel (Phase 2). - `automatic_return_routing?: boolean` True if automatic stateful return routing should be enabled for a tunnel, false otherwise. - `bgp?: BGP` - `customer_asn: number` ASN used on the customer end of the BGP session - `extra_prefixes?: Array` Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table. - `md5_key?: 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. - `bgp_status?: BGPStatus` - `state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"` - `"BGP_DOWN"` - `"BGP_UP"` - `"BGP_ESTABLISHING"` - `tcp_established: boolean` - `updated_at: string` - `bgp_state?: string` - `cf_speaker_ip?: string` - `cf_speaker_port?: number` - `customer_speaker_ip?: string` - `customer_speaker_port?: number` - `created_on?: string` The date and time the tunnel was created. - `custom_remote_identities?: CustomRemoteIdentities` - `fqdn_id?: string` A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The generated IKE IDs can still be used even if this custom value is specified. Must be of the form `..custom.ipsec.cloudflare.com`. This custom ID does not need to be unique. Two IPsec tunnels may have the same custom fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels cannot have the same cloudflare_endpoint. - `customer_endpoint?: string` The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work. - `description?: string` An optional description forthe IPsec tunnel. - `health_check?: HealthCheck` - `direction?: "unidirectional" | "bidirectional"` The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel. - `"unidirectional"` - `"bidirectional"` - `enabled?: boolean` Determines whether to run healthchecks for a tunnel. - `rate?: HealthCheckRate` How frequent the health check is run. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `target?: MagicHealthCheckTarget | string` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false. - `MagicHealthCheckTarget` The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. - `effective?: string` The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests. - `saved?: string` The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used. - `string` - `type?: HealthCheckType` The type of healthcheck to run, reply or request. The default value is `reply`. - `"reply"` - `"request"` - `interface_address6?: string` A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 - `modified_on?: string` The date and time the tunnel was last modified. - `psk_metadata?: PSKMetadata` The PSK metadata that includes when the PSK was generated. - `last_generated_on?: string` The date and time the tunnel was last modified. - `replay_protection?: boolean` If `true`, then IPsec replay protection will be supported in the Cloudflare-to-customer direction. ### IPSEC Tunnel PSK Generate Response - `IPSECTunnelPSKGenerateResponse` - `ipsec_tunnel_id?: string` Identifier - `psk?: string` A randomly generated or provided string for use in the IPsec tunnel. - `psk_metadata?: PSKMetadata` The PSK metadata that includes when the PSK was generated. - `last_generated_on?: string` The date and time the tunnel was last modified. # Routes ## List Routes `client.magicTransit.routes.list(RouteListParamsparams, RequestOptionsoptions?): RouteListResponse` **get** `/accounts/{account_id}/magic/routes` List all Magic static routes. ### Parameters - `params: RouteListParams` - `account_id: string` Identifier ### Returns - `RouteListResponse` - `routes?: Array` - `id: string` Identifier - `nexthop: string` The next-hop IP Address for the static route. - `prefix: string` IP Prefix in Classless Inter-Domain Routing format. - `priority: number` Priority of the static route. - `created_on?: string` When the route was created. - `description?: string` An optional human provided description of the static route. - `modified_on?: string` When the route was last modified. - `scope?: Scope` Used only for ECMP routes. - `colo_names?: Array` List of colo names for the ECMP scope. - `colo_regions?: Array` List of colo regions for the ECMP scope. - `weight?: number` Optional weight of the ECMP scope - if provided. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const routes = await client.magicTransit.routes.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(routes.routes); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "routes": [ { "id": "023e105f4ecef8ad9ca31a8372d0c353", "nexthop": "203.0.113.1", "prefix": "192.0.2.0/24", "priority": 0, "created_on": "2017-06-14T00:00:00Z", "description": "New route for new prefix 203.0.113.1", "modified_on": "2017-06-14T05:20:00Z", "scope": { "colo_names": [ "den01" ], "colo_regions": [ "APAC" ] }, "weight": 0 } ] }, "success": true } ``` ## Route Details `client.magicTransit.routes.get(stringrouteId, RouteGetParamsparams, RequestOptionsoptions?): RouteGetResponse` **get** `/accounts/{account_id}/magic/routes/{route_id}` Get a specific Magic static route. ### Parameters - `routeId: string` Identifier - `params: RouteGetParams` - `account_id: string` Identifier ### Returns - `RouteGetResponse` - `route?: Route` - `id: string` Identifier - `nexthop: string` The next-hop IP Address for the static route. - `prefix: string` IP Prefix in Classless Inter-Domain Routing format. - `priority: number` Priority of the static route. - `created_on?: string` When the route was created. - `description?: string` An optional human provided description of the static route. - `modified_on?: string` When the route was last modified. - `scope?: Scope` Used only for ECMP routes. - `colo_names?: Array` List of colo names for the ECMP scope. - `colo_regions?: Array` List of colo regions for the ECMP scope. - `weight?: number` Optional weight of the ECMP scope - if provided. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const route = await client.magicTransit.routes.get('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(route.route); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "route": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "nexthop": "203.0.113.1", "prefix": "192.0.2.0/24", "priority": 0, "created_on": "2017-06-14T00:00:00Z", "description": "New route for new prefix 203.0.113.1", "modified_on": "2017-06-14T05:20:00Z", "scope": { "colo_names": [ "den01" ], "colo_regions": [ "APAC" ] }, "weight": 0 } }, "success": true } ``` ## Create a Route `client.magicTransit.routes.create(RouteCreateParamsparams, RequestOptionsoptions?): RouteCreateResponse` **post** `/accounts/{account_id}/magic/routes` Creates a new Magic static route. Use `?validate_only=true` as an optional query parameter to run validation only without persisting changes. ### Parameters - `params: RouteCreateParams` - `account_id: string` Path param: Identifier - `nexthop: string` Body param: The next-hop IP Address for the static route. - `prefix: string` Body param: IP Prefix in Classless Inter-Domain Routing format. - `priority: number` Body param: Priority of the static route. - `description?: string` Body param: An optional human provided description of the static route. - `scope?: Scope` Body param: Used only for ECMP routes. - `colo_names?: Array` List of colo names for the ECMP scope. - `colo_regions?: Array` List of colo regions for the ECMP scope. - `weight?: number` Body param: Optional weight of the ECMP scope - if provided. ### Returns - `RouteCreateResponse` - `id: string` Identifier - `nexthop: string` The next-hop IP Address for the static route. - `prefix: string` IP Prefix in Classless Inter-Domain Routing format. - `priority: number` Priority of the static route. - `created_on?: string` When the route was created. - `description?: string` An optional human provided description of the static route. - `modified_on?: string` When the route was last modified. - `scope?: Scope` Used only for ECMP routes. - `colo_names?: Array` List of colo names for the ECMP scope. - `colo_regions?: Array` List of colo regions for the ECMP scope. - `weight?: number` Optional weight of the ECMP scope - if provided. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const route = await client.magicTransit.routes.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', nexthop: '203.0.113.1', prefix: '192.0.2.0/24', priority: 0, }); console.log(route.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "nexthop": "203.0.113.1", "prefix": "192.0.2.0/24", "priority": 0, "created_on": "2017-06-14T00:00:00Z", "description": "New route for new prefix 203.0.113.1", "modified_on": "2017-06-14T05:20:00Z", "scope": { "colo_names": [ "den01" ], "colo_regions": [ "APAC" ] }, "weight": 0 }, "success": true } ``` ## Update Route `client.magicTransit.routes.update(stringrouteId, RouteUpdateParamsparams, RequestOptionsoptions?): RouteUpdateResponse` **put** `/accounts/{account_id}/magic/routes/{route_id}` Update a specific Magic static route. Use `?validate_only=true` as an optional query parameter to run validation only without persisting changes. ### Parameters - `routeId: string` Identifier - `params: RouteUpdateParams` - `account_id: string` Path param: Identifier - `nexthop: string` Body param: The next-hop IP Address for the static route. - `prefix: string` Body param: IP Prefix in Classless Inter-Domain Routing format. - `priority: number` Body param: Priority of the static route. - `description?: string` Body param: An optional human provided description of the static route. - `scope?: Scope` Body param: Used only for ECMP routes. - `colo_names?: Array` List of colo names for the ECMP scope. - `colo_regions?: Array` List of colo regions for the ECMP scope. - `weight?: number` Body param: Optional weight of the ECMP scope - if provided. ### Returns - `RouteUpdateResponse` - `modified?: boolean` - `modified_route?: ModifiedRoute` - `id: string` Identifier - `nexthop: string` The next-hop IP Address for the static route. - `prefix: string` IP Prefix in Classless Inter-Domain Routing format. - `priority: number` Priority of the static route. - `created_on?: string` When the route was created. - `description?: string` An optional human provided description of the static route. - `modified_on?: string` When the route was last modified. - `scope?: Scope` Used only for ECMP routes. - `colo_names?: Array` List of colo names for the ECMP scope. - `colo_regions?: Array` List of colo regions for the ECMP scope. - `weight?: number` Optional weight of the ECMP scope - if provided. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const route = await client.magicTransit.routes.update('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', nexthop: '203.0.113.1', prefix: '192.0.2.0/24', priority: 0, }); console.log(route.modified); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "modified": true, "modified_route": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "nexthop": "203.0.113.1", "prefix": "192.0.2.0/24", "priority": 0, "created_on": "2017-06-14T00:00:00Z", "description": "New route for new prefix 203.0.113.1", "modified_on": "2017-06-14T05:20:00Z", "scope": { "colo_names": [ "den01" ], "colo_regions": [ "APAC" ] }, "weight": 0 } }, "success": true } ``` ## Delete Route `client.magicTransit.routes.delete(stringrouteId, RouteDeleteParamsparams, RequestOptionsoptions?): RouteDeleteResponse` **delete** `/accounts/{account_id}/magic/routes/{route_id}` Disable and remove a specific Magic static route. ### Parameters - `routeId: string` Identifier - `params: RouteDeleteParams` - `account_id: string` Identifier ### Returns - `RouteDeleteResponse` - `deleted?: boolean` - `deleted_route?: DeletedRoute` - `id: string` Identifier - `nexthop: string` The next-hop IP Address for the static route. - `prefix: string` IP Prefix in Classless Inter-Domain Routing format. - `priority: number` Priority of the static route. - `created_on?: string` When the route was created. - `description?: string` An optional human provided description of the static route. - `modified_on?: string` When the route was last modified. - `scope?: Scope` Used only for ECMP routes. - `colo_names?: Array` List of colo names for the ECMP scope. - `colo_regions?: Array` List of colo regions for the ECMP scope. - `weight?: number` Optional weight of the ECMP scope - if provided. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const route = await client.magicTransit.routes.delete('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(route.deleted); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "deleted": true, "deleted_route": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "nexthop": "203.0.113.1", "prefix": "192.0.2.0/24", "priority": 0, "created_on": "2017-06-14T00:00:00Z", "description": "New route for new prefix 203.0.113.1", "modified_on": "2017-06-14T05:20:00Z", "scope": { "colo_names": [ "den01" ], "colo_regions": [ "APAC" ] }, "weight": 0 } }, "success": true } ``` ## Update Many Routes `client.magicTransit.routes.bulkUpdate(RouteBulkUpdateParamsparams, RequestOptionsoptions?): RouteBulkUpdateResponse` **put** `/accounts/{account_id}/magic/routes` Update multiple Magic static routes. Use `?validate_only=true` as an optional query parameter to run validation only without persisting changes. Only fields for a route that need to be changed need be provided. ### Parameters - `params: RouteBulkUpdateParams` - `account_id: string` Path param: Identifier - `routes: Array` Body param - `id: string` Identifier - `nexthop: string` The next-hop IP Address for the static route. - `prefix: string` IP Prefix in Classless Inter-Domain Routing format. - `priority: number` Priority of the static route. - `description?: string` An optional human provided description of the static route. - `scope?: Scope` Used only for ECMP routes. - `colo_names?: Array` List of colo names for the ECMP scope. - `colo_regions?: Array` List of colo regions for the ECMP scope. - `weight?: number` Optional weight of the ECMP scope - if provided. ### Returns - `RouteBulkUpdateResponse` - `modified?: boolean` - `modified_routes?: Array` - `id: string` Identifier - `nexthop: string` The next-hop IP Address for the static route. - `prefix: string` IP Prefix in Classless Inter-Domain Routing format. - `priority: number` Priority of the static route. - `created_on?: string` When the route was created. - `description?: string` An optional human provided description of the static route. - `modified_on?: string` When the route was last modified. - `scope?: Scope` Used only for ECMP routes. - `colo_names?: Array` List of colo names for the ECMP scope. - `colo_regions?: Array` List of colo regions for the ECMP scope. - `weight?: number` Optional weight of the ECMP scope - if provided. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.magicTransit.routes.bulkUpdate({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', routes: [ { id: '023e105f4ecef8ad9ca31a8372d0c353', nexthop: '203.0.113.1', prefix: '192.0.2.0/24', priority: 0, }, ], }); console.log(response.modified); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "modified": true, "modified_routes": [ { "id": "023e105f4ecef8ad9ca31a8372d0c353", "nexthop": "203.0.113.1", "prefix": "192.0.2.0/24", "priority": 0, "created_on": "2017-06-14T00:00:00Z", "description": "New route for new prefix 203.0.113.1", "modified_on": "2017-06-14T05:20:00Z", "scope": { "colo_names": [ "den01" ], "colo_regions": [ "APAC" ] }, "weight": 0 } ] }, "success": true } ``` ## Delete Many Routes `client.magicTransit.routes.empty(RouteEmptyParamsparams, RequestOptionsoptions?): RouteEmptyResponse` **delete** `/accounts/{account_id}/magic/routes` Delete multiple Magic static routes. ### Parameters - `params: RouteEmptyParams` - `account_id: string` Identifier ### Returns - `RouteEmptyResponse` - `deleted?: boolean` - `deleted_routes?: Array` - `id: string` Identifier - `nexthop: string` The next-hop IP Address for the static route. - `prefix: string` IP Prefix in Classless Inter-Domain Routing format. - `priority: number` Priority of the static route. - `created_on?: string` When the route was created. - `description?: string` An optional human provided description of the static route. - `modified_on?: string` When the route was last modified. - `scope?: Scope` Used only for ECMP routes. - `colo_names?: Array` List of colo names for the ECMP scope. - `colo_regions?: Array` List of colo regions for the ECMP scope. - `weight?: number` Optional weight of the ECMP scope - if provided. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.magicTransit.routes.empty({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(response.deleted); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "deleted": true, "deleted_routes": [ { "id": "023e105f4ecef8ad9ca31a8372d0c353", "nexthop": "203.0.113.1", "prefix": "192.0.2.0/24", "priority": 0, "created_on": "2017-06-14T00:00:00Z", "description": "New route for new prefix 203.0.113.1", "modified_on": "2017-06-14T05:20:00Z", "scope": { "colo_names": [ "den01" ], "colo_regions": [ "APAC" ] }, "weight": 0 } ] }, "success": true } ``` ## Domain Types ### Scope - `Scope` Used only for ECMP routes. - `colo_names?: Array` List of colo names for the ECMP scope. - `colo_regions?: Array` List of colo regions for the ECMP scope. ### Route List Response - `RouteListResponse` - `routes?: Array` - `id: string` Identifier - `nexthop: string` The next-hop IP Address for the static route. - `prefix: string` IP Prefix in Classless Inter-Domain Routing format. - `priority: number` Priority of the static route. - `created_on?: string` When the route was created. - `description?: string` An optional human provided description of the static route. - `modified_on?: string` When the route was last modified. - `scope?: Scope` Used only for ECMP routes. - `colo_names?: Array` List of colo names for the ECMP scope. - `colo_regions?: Array` List of colo regions for the ECMP scope. - `weight?: number` Optional weight of the ECMP scope - if provided. ### Route Get Response - `RouteGetResponse` - `route?: Route` - `id: string` Identifier - `nexthop: string` The next-hop IP Address for the static route. - `prefix: string` IP Prefix in Classless Inter-Domain Routing format. - `priority: number` Priority of the static route. - `created_on?: string` When the route was created. - `description?: string` An optional human provided description of the static route. - `modified_on?: string` When the route was last modified. - `scope?: Scope` Used only for ECMP routes. - `colo_names?: Array` List of colo names for the ECMP scope. - `colo_regions?: Array` List of colo regions for the ECMP scope. - `weight?: number` Optional weight of the ECMP scope - if provided. ### Route Create Response - `RouteCreateResponse` - `id: string` Identifier - `nexthop: string` The next-hop IP Address for the static route. - `prefix: string` IP Prefix in Classless Inter-Domain Routing format. - `priority: number` Priority of the static route. - `created_on?: string` When the route was created. - `description?: string` An optional human provided description of the static route. - `modified_on?: string` When the route was last modified. - `scope?: Scope` Used only for ECMP routes. - `colo_names?: Array` List of colo names for the ECMP scope. - `colo_regions?: Array` List of colo regions for the ECMP scope. - `weight?: number` Optional weight of the ECMP scope - if provided. ### Route Update Response - `RouteUpdateResponse` - `modified?: boolean` - `modified_route?: ModifiedRoute` - `id: string` Identifier - `nexthop: string` The next-hop IP Address for the static route. - `prefix: string` IP Prefix in Classless Inter-Domain Routing format. - `priority: number` Priority of the static route. - `created_on?: string` When the route was created. - `description?: string` An optional human provided description of the static route. - `modified_on?: string` When the route was last modified. - `scope?: Scope` Used only for ECMP routes. - `colo_names?: Array` List of colo names for the ECMP scope. - `colo_regions?: Array` List of colo regions for the ECMP scope. - `weight?: number` Optional weight of the ECMP scope - if provided. ### Route Delete Response - `RouteDeleteResponse` - `deleted?: boolean` - `deleted_route?: DeletedRoute` - `id: string` Identifier - `nexthop: string` The next-hop IP Address for the static route. - `prefix: string` IP Prefix in Classless Inter-Domain Routing format. - `priority: number` Priority of the static route. - `created_on?: string` When the route was created. - `description?: string` An optional human provided description of the static route. - `modified_on?: string` When the route was last modified. - `scope?: Scope` Used only for ECMP routes. - `colo_names?: Array` List of colo names for the ECMP scope. - `colo_regions?: Array` List of colo regions for the ECMP scope. - `weight?: number` Optional weight of the ECMP scope - if provided. ### Route Bulk Update Response - `RouteBulkUpdateResponse` - `modified?: boolean` - `modified_routes?: Array` - `id: string` Identifier - `nexthop: string` The next-hop IP Address for the static route. - `prefix: string` IP Prefix in Classless Inter-Domain Routing format. - `priority: number` Priority of the static route. - `created_on?: string` When the route was created. - `description?: string` An optional human provided description of the static route. - `modified_on?: string` When the route was last modified. - `scope?: Scope` Used only for ECMP routes. - `colo_names?: Array` List of colo names for the ECMP scope. - `colo_regions?: Array` List of colo regions for the ECMP scope. - `weight?: number` Optional weight of the ECMP scope - if provided. ### Route Empty Response - `RouteEmptyResponse` - `deleted?: boolean` - `deleted_routes?: Array` - `id: string` Identifier - `nexthop: string` The next-hop IP Address for the static route. - `prefix: string` IP Prefix in Classless Inter-Domain Routing format. - `priority: number` Priority of the static route. - `created_on?: string` When the route was created. - `description?: string` An optional human provided description of the static route. - `modified_on?: string` When the route was last modified. - `scope?: Scope` Used only for ECMP routes. - `colo_names?: Array` List of colo names for the ECMP scope. - `colo_regions?: Array` List of colo regions for the ECMP scope. - `weight?: number` Optional weight of the ECMP scope - if provided. # Sites ## List Sites `client.magicTransit.sites.list(SiteListParamsparams, RequestOptionsoptions?): SinglePage` **get** `/accounts/{account_id}/magic/sites` Lists Sites associated with an account. Use connectorid query param to return sites where connectorid matches either site.ConnectorID or site.SecondaryConnectorID. ### Parameters - `params: SiteListParams` - `account_id: string` Path param: Identifier - `connectorid?: string` Query param: Identifier ### Returns - `Site` - `id?: string` Identifier - `connector_id?: string` Magic Connector identifier tag. - `description?: string` - `ha_mode?: boolean` Site high availability mode. If set to true, the site can have two connectors and runs in high availability mode. - `location?: SiteLocation` Location of site in latitude and longitude. - `lat?: string` Latitude - `lon?: string` Longitude - `name?: string` The name of the site. - `secondary_connector_id?: string` Magic Connector identifier tag. Used when high availability mode is on. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const site of client.magicTransit.sites.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(site.id); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "id": "023e105f4ecef8ad9ca31a8372d0c353", "connector_id": "ac60d3d0435248289d446cedd870bcf4", "description": "description", "ha_mode": true, "location": { "lat": "37.6192", "lon": "122.3816" }, "name": "site_1", "secondary_connector_id": "8d67040d3835dbcf46ce29da440dc482" } ], "success": true } ``` ## Site Details `client.magicTransit.sites.get(stringsiteId, SiteGetParamsparams, RequestOptionsoptions?): Site` **get** `/accounts/{account_id}/magic/sites/{site_id}` Get a specific Site. ### Parameters - `siteId: string` Identifier - `params: SiteGetParams` - `account_id: string` Path param: Identifier - `xMagicNewHcTarget?: boolean` Header param: If true, the health check target in the response body will be presented using the new object format. Defaults to false. ### Returns - `Site` - `id?: string` Identifier - `connector_id?: string` Magic Connector identifier tag. - `description?: string` - `ha_mode?: boolean` Site high availability mode. If set to true, the site can have two connectors and runs in high availability mode. - `location?: SiteLocation` Location of site in latitude and longitude. - `lat?: string` Latitude - `lon?: string` Longitude - `name?: string` The name of the site. - `secondary_connector_id?: string` Magic Connector identifier tag. Used when high availability mode is on. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const site = await client.magicTransit.sites.get('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(site.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "connector_id": "ac60d3d0435248289d446cedd870bcf4", "description": "description", "ha_mode": true, "location": { "lat": "37.6192", "lon": "122.3816" }, "name": "site_1", "secondary_connector_id": "8d67040d3835dbcf46ce29da440dc482" }, "success": true } ``` ## Create a new Site `client.magicTransit.sites.create(SiteCreateParamsparams, RequestOptionsoptions?): Site` **post** `/accounts/{account_id}/magic/sites` Creates a new Site ### Parameters - `params: SiteCreateParams` - `account_id: string` Path param: Identifier - `name: string` Body param: The name of the site. - `connector_id?: string` Body param: Magic Connector identifier tag. - `description?: string` Body param - `ha_mode?: boolean` Body param: Site high availability mode. If set to true, the site can have two connectors and runs in high availability mode. - `location?: SiteLocation` Body param: Location of site in latitude and longitude. - `lat?: string` Latitude - `lon?: string` Longitude - `secondary_connector_id?: string` Body param: Magic Connector identifier tag. Used when high availability mode is on. ### Returns - `Site` - `id?: string` Identifier - `connector_id?: string` Magic Connector identifier tag. - `description?: string` - `ha_mode?: boolean` Site high availability mode. If set to true, the site can have two connectors and runs in high availability mode. - `location?: SiteLocation` Location of site in latitude and longitude. - `lat?: string` Latitude - `lon?: string` Longitude - `name?: string` The name of the site. - `secondary_connector_id?: string` Magic Connector identifier tag. Used when high availability mode is on. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const site = await client.magicTransit.sites.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', name: 'site_1', }); console.log(site.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "connector_id": "ac60d3d0435248289d446cedd870bcf4", "description": "description", "ha_mode": true, "location": { "lat": "37.6192", "lon": "122.3816" }, "name": "site_1", "secondary_connector_id": "8d67040d3835dbcf46ce29da440dc482" }, "success": true } ``` ## Update Site `client.magicTransit.sites.update(stringsiteId, SiteUpdateParamsparams, RequestOptionsoptions?): Site` **put** `/accounts/{account_id}/magic/sites/{site_id}` Update a specific Site. ### Parameters - `siteId: string` Identifier - `params: SiteUpdateParams` - `account_id: string` Path param: Identifier - `connector_id?: string` Body param: Magic Connector identifier tag. - `description?: string` Body param - `location?: SiteLocation` Body param: Location of site in latitude and longitude. - `lat?: string` Latitude - `lon?: string` Longitude - `name?: string` Body param: The name of the site. - `secondary_connector_id?: string` Body param: Magic Connector identifier tag. Used when high availability mode is on. ### Returns - `Site` - `id?: string` Identifier - `connector_id?: string` Magic Connector identifier tag. - `description?: string` - `ha_mode?: boolean` Site high availability mode. If set to true, the site can have two connectors and runs in high availability mode. - `location?: SiteLocation` Location of site in latitude and longitude. - `lat?: string` Latitude - `lon?: string` Longitude - `name?: string` The name of the site. - `secondary_connector_id?: string` Magic Connector identifier tag. Used when high availability mode is on. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const site = await client.magicTransit.sites.update('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(site.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "connector_id": "ac60d3d0435248289d446cedd870bcf4", "description": "description", "ha_mode": true, "location": { "lat": "37.6192", "lon": "122.3816" }, "name": "site_1", "secondary_connector_id": "8d67040d3835dbcf46ce29da440dc482" }, "success": true } ``` ## Patch Site `client.magicTransit.sites.edit(stringsiteId, SiteEditParamsparams, RequestOptionsoptions?): Site` **patch** `/accounts/{account_id}/magic/sites/{site_id}` Patch a specific Site. ### Parameters - `siteId: string` Identifier - `params: SiteEditParams` - `account_id: string` Path param: Identifier - `connector_id?: string` Body param: Magic Connector identifier tag. - `description?: string` Body param - `location?: SiteLocation` Body param: Location of site in latitude and longitude. - `lat?: string` Latitude - `lon?: string` Longitude - `name?: string` Body param: The name of the site. - `secondary_connector_id?: string` Body param: Magic Connector identifier tag. Used when high availability mode is on. ### Returns - `Site` - `id?: string` Identifier - `connector_id?: string` Magic Connector identifier tag. - `description?: string` - `ha_mode?: boolean` Site high availability mode. If set to true, the site can have two connectors and runs in high availability mode. - `location?: SiteLocation` Location of site in latitude and longitude. - `lat?: string` Latitude - `lon?: string` Longitude - `name?: string` The name of the site. - `secondary_connector_id?: string` Magic Connector identifier tag. Used when high availability mode is on. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const site = await client.magicTransit.sites.edit('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(site.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "connector_id": "ac60d3d0435248289d446cedd870bcf4", "description": "description", "ha_mode": true, "location": { "lat": "37.6192", "lon": "122.3816" }, "name": "site_1", "secondary_connector_id": "8d67040d3835dbcf46ce29da440dc482" }, "success": true } ``` ## Delete Site `client.magicTransit.sites.delete(stringsiteId, SiteDeleteParamsparams, RequestOptionsoptions?): Site` **delete** `/accounts/{account_id}/magic/sites/{site_id}` Remove a specific Site. ### Parameters - `siteId: string` Identifier - `params: SiteDeleteParams` - `account_id: string` Identifier ### Returns - `Site` - `id?: string` Identifier - `connector_id?: string` Magic Connector identifier tag. - `description?: string` - `ha_mode?: boolean` Site high availability mode. If set to true, the site can have two connectors and runs in high availability mode. - `location?: SiteLocation` Location of site in latitude and longitude. - `lat?: string` Latitude - `lon?: string` Longitude - `name?: string` The name of the site. - `secondary_connector_id?: string` Magic Connector identifier tag. Used when high availability mode is on. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const site = await client.magicTransit.sites.delete('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(site.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "connector_id": "ac60d3d0435248289d446cedd870bcf4", "description": "description", "ha_mode": true, "location": { "lat": "37.6192", "lon": "122.3816" }, "name": "site_1", "secondary_connector_id": "8d67040d3835dbcf46ce29da440dc482" }, "success": true } ``` ## Domain Types ### Site - `Site` - `id?: string` Identifier - `connector_id?: string` Magic Connector identifier tag. - `description?: string` - `ha_mode?: boolean` Site high availability mode. If set to true, the site can have two connectors and runs in high availability mode. - `location?: SiteLocation` Location of site in latitude and longitude. - `lat?: string` Latitude - `lon?: string` Longitude - `name?: string` The name of the site. - `secondary_connector_id?: string` Magic Connector identifier tag. Used when high availability mode is on. ### Site Location - `SiteLocation` Location of site in latitude and longitude. - `lat?: string` Latitude - `lon?: string` Longitude # App Configuration # ACLs ## List Site ACLs `client.magicTransit.sites.acls.list(stringsiteId, ACLListParamsparams, RequestOptionsoptions?): SinglePage` **get** `/accounts/{account_id}/magic/sites/{site_id}/acls` Lists Site ACLs associated with an account. ### Parameters - `siteId: string` Identifier - `params: ACLListParams` - `account_id: string` Identifier ### Returns - `ACL` Bidirectional ACL policy for network traffic within a site. - `id?: string` Identifier - `description?: string` Description for the ACL. - `forward_locally?: boolean` The desired forwarding action for this ACL policy. If set to "false", the policy will forward traffic to Cloudflare. If set to "true", the policy will forward traffic locally on the Magic Connector. If not included in request, will default to false. - `lan_1?: ACLConfiguration` - `lan_id: string` The identifier for the LAN you want to create an ACL policy with. - `lan_name?: string` The name of the LAN based on the provided lan_id. - `port_ranges?: Array` Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed. - `ports?: Array` Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed. - `subnets?: Array` Array of subnet IPs within the LAN that will be included in the ACL. If no subnets are provided, communication on any subnets on this LAN are allowed. - `lan_2?: ACLConfiguration` - `name?: string` The name of the ACL. - `protocols?: Array` - `"tcp"` - `"udp"` - `"icmp"` - `unidirectional?: boolean` The desired traffic direction for this ACL policy. If set to "false", the policy will allow bidirectional traffic. If set to "true", the policy will only allow traffic in one direction. If not included in request, will default to false. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const acl of client.magicTransit.sites.acls.list('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(acl.id); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "id": "023e105f4ecef8ad9ca31a8372d0c353", "description": "Allows local traffic between PIN pads and cash register.", "forward_locally": true, "lan_1": { "lan_id": "lan_id", "lan_name": "lan_name", "port_ranges": [ "8080-9000" ], "ports": [ 1 ], "subnets": [ "192.0.2.1" ] }, "lan_2": { "lan_id": "lan_id", "lan_name": "lan_name", "port_ranges": [ "8080-9000" ], "ports": [ 1 ], "subnets": [ "192.0.2.1" ] }, "name": "PIN Pad - Cash Register", "protocols": [ "tcp" ], "unidirectional": true } ], "success": true } ``` ## Site ACL Details `client.magicTransit.sites.acls.get(stringsiteId, stringaclId, ACLGetParamsparams, RequestOptionsoptions?): ACL` **get** `/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_id}` Get a specific Site ACL. ### Parameters - `siteId: string` Identifier - `aclId: string` Identifier - `params: ACLGetParams` - `account_id: string` Identifier ### Returns - `ACL` Bidirectional ACL policy for network traffic within a site. - `id?: string` Identifier - `description?: string` Description for the ACL. - `forward_locally?: boolean` The desired forwarding action for this ACL policy. If set to "false", the policy will forward traffic to Cloudflare. If set to "true", the policy will forward traffic locally on the Magic Connector. If not included in request, will default to false. - `lan_1?: ACLConfiguration` - `lan_id: string` The identifier for the LAN you want to create an ACL policy with. - `lan_name?: string` The name of the LAN based on the provided lan_id. - `port_ranges?: Array` Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed. - `ports?: Array` Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed. - `subnets?: Array` Array of subnet IPs within the LAN that will be included in the ACL. If no subnets are provided, communication on any subnets on this LAN are allowed. - `lan_2?: ACLConfiguration` - `name?: string` The name of the ACL. - `protocols?: Array` - `"tcp"` - `"udp"` - `"icmp"` - `unidirectional?: boolean` The desired traffic direction for this ACL policy. If set to "false", the policy will allow bidirectional traffic. If set to "true", the policy will only allow traffic in one direction. If not included in request, will default to false. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const acl = await client.magicTransit.sites.acls.get( '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(acl.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "description": "Allows local traffic between PIN pads and cash register.", "forward_locally": true, "lan_1": { "lan_id": "lan_id", "lan_name": "lan_name", "port_ranges": [ "8080-9000" ], "ports": [ 1 ], "subnets": [ "192.0.2.1" ] }, "lan_2": { "lan_id": "lan_id", "lan_name": "lan_name", "port_ranges": [ "8080-9000" ], "ports": [ 1 ], "subnets": [ "192.0.2.1" ] }, "name": "PIN Pad - Cash Register", "protocols": [ "tcp" ], "unidirectional": true }, "success": true } ``` ## Create a new Site ACL `client.magicTransit.sites.acls.create(stringsiteId, ACLCreateParamsparams, RequestOptionsoptions?): ACL` **post** `/accounts/{account_id}/magic/sites/{site_id}/acls` Creates a new Site ACL. ### Parameters - `siteId: string` Identifier - `params: ACLCreateParams` - `account_id: string` Path param: Identifier - `lan_1: ACLConfiguration` Body param - `lan_id: string` The identifier for the LAN you want to create an ACL policy with. - `lan_name?: string` The name of the LAN based on the provided lan_id. - `port_ranges?: Array` Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed. - `ports?: Array` Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed. - `subnets?: Array` Array of subnet IPs within the LAN that will be included in the ACL. If no subnets are provided, communication on any subnets on this LAN are allowed. - `lan_2: ACLConfiguration` Body param - `name: string` Body param: The name of the ACL. - `description?: string` Body param: Description for the ACL. - `forward_locally?: boolean` Body param: The desired forwarding action for this ACL policy. If set to "false", the policy will forward traffic to Cloudflare. If set to "true", the policy will forward traffic locally on the Magic Connector. If not included in request, will default to false. - `protocols?: Array` Body param - `"tcp"` - `"udp"` - `"icmp"` - `unidirectional?: boolean` Body param: The desired traffic direction for this ACL policy. If set to "false", the policy will allow bidirectional traffic. If set to "true", the policy will only allow traffic in one direction. If not included in request, will default to false. ### Returns - `ACL` Bidirectional ACL policy for network traffic within a site. - `id?: string` Identifier - `description?: string` Description for the ACL. - `forward_locally?: boolean` The desired forwarding action for this ACL policy. If set to "false", the policy will forward traffic to Cloudflare. If set to "true", the policy will forward traffic locally on the Magic Connector. If not included in request, will default to false. - `lan_1?: ACLConfiguration` - `lan_id: string` The identifier for the LAN you want to create an ACL policy with. - `lan_name?: string` The name of the LAN based on the provided lan_id. - `port_ranges?: Array` Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed. - `ports?: Array` Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed. - `subnets?: Array` Array of subnet IPs within the LAN that will be included in the ACL. If no subnets are provided, communication on any subnets on this LAN are allowed. - `lan_2?: ACLConfiguration` - `name?: string` The name of the ACL. - `protocols?: Array` - `"tcp"` - `"udp"` - `"icmp"` - `unidirectional?: boolean` The desired traffic direction for this ACL policy. If set to "false", the policy will allow bidirectional traffic. If set to "true", the policy will only allow traffic in one direction. If not included in request, will default to false. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const acl = await client.magicTransit.sites.acls.create('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', lan_1: { lan_id: 'lan_id' }, lan_2: { lan_id: 'lan_id' }, name: 'PIN Pad - Cash Register', }); console.log(acl.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "description": "Allows local traffic between PIN pads and cash register.", "forward_locally": true, "lan_1": { "lan_id": "lan_id", "lan_name": "lan_name", "port_ranges": [ "8080-9000" ], "ports": [ 1 ], "subnets": [ "192.0.2.1" ] }, "lan_2": { "lan_id": "lan_id", "lan_name": "lan_name", "port_ranges": [ "8080-9000" ], "ports": [ 1 ], "subnets": [ "192.0.2.1" ] }, "name": "PIN Pad - Cash Register", "protocols": [ "tcp" ], "unidirectional": true }, "success": true } ``` ## Update Site ACL `client.magicTransit.sites.acls.update(stringsiteId, stringaclId, ACLUpdateParamsparams, RequestOptionsoptions?): ACL` **put** `/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_id}` Update a specific Site ACL. ### Parameters - `siteId: string` Identifier - `aclId: string` Identifier - `params: ACLUpdateParams` - `account_id: string` Path param: Identifier - `description?: string` Body param: Description for the ACL. - `forward_locally?: boolean` Body param: The desired forwarding action for this ACL policy. If set to "false", the policy will forward traffic to Cloudflare. If set to "true", the policy will forward traffic locally on the Magic Connector. If not included in request, will default to false. - `lan_1?: ACLConfiguration` Body param - `lan_id: string` The identifier for the LAN you want to create an ACL policy with. - `lan_name?: string` The name of the LAN based on the provided lan_id. - `port_ranges?: Array` Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed. - `ports?: Array` Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed. - `subnets?: Array` Array of subnet IPs within the LAN that will be included in the ACL. If no subnets are provided, communication on any subnets on this LAN are allowed. - `lan_2?: ACLConfiguration` Body param - `name?: string` Body param: The name of the ACL. - `protocols?: Array` Body param - `"tcp"` - `"udp"` - `"icmp"` - `unidirectional?: boolean` Body param: The desired traffic direction for this ACL policy. If set to "false", the policy will allow bidirectional traffic. If set to "true", the policy will only allow traffic in one direction. If not included in request, will default to false. ### Returns - `ACL` Bidirectional ACL policy for network traffic within a site. - `id?: string` Identifier - `description?: string` Description for the ACL. - `forward_locally?: boolean` The desired forwarding action for this ACL policy. If set to "false", the policy will forward traffic to Cloudflare. If set to "true", the policy will forward traffic locally on the Magic Connector. If not included in request, will default to false. - `lan_1?: ACLConfiguration` - `lan_id: string` The identifier for the LAN you want to create an ACL policy with. - `lan_name?: string` The name of the LAN based on the provided lan_id. - `port_ranges?: Array` Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed. - `ports?: Array` Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed. - `subnets?: Array` Array of subnet IPs within the LAN that will be included in the ACL. If no subnets are provided, communication on any subnets on this LAN are allowed. - `lan_2?: ACLConfiguration` - `name?: string` The name of the ACL. - `protocols?: Array` - `"tcp"` - `"udp"` - `"icmp"` - `unidirectional?: boolean` The desired traffic direction for this ACL policy. If set to "false", the policy will allow bidirectional traffic. If set to "true", the policy will only allow traffic in one direction. If not included in request, will default to false. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const acl = await client.magicTransit.sites.acls.update( '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(acl.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "description": "Allows local traffic between PIN pads and cash register.", "forward_locally": true, "lan_1": { "lan_id": "lan_id", "lan_name": "lan_name", "port_ranges": [ "8080-9000" ], "ports": [ 1 ], "subnets": [ "192.0.2.1" ] }, "lan_2": { "lan_id": "lan_id", "lan_name": "lan_name", "port_ranges": [ "8080-9000" ], "ports": [ 1 ], "subnets": [ "192.0.2.1" ] }, "name": "PIN Pad - Cash Register", "protocols": [ "tcp" ], "unidirectional": true }, "success": true } ``` ## Patch Site ACL `client.magicTransit.sites.acls.edit(stringsiteId, stringaclId, ACLEditParamsparams, RequestOptionsoptions?): ACL` **patch** `/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_id}` Patch a specific Site ACL. ### Parameters - `siteId: string` Identifier - `aclId: string` Identifier - `params: ACLEditParams` - `account_id: string` Path param: Identifier - `description?: string` Body param: Description for the ACL. - `forward_locally?: boolean` Body param: The desired forwarding action for this ACL policy. If set to "false", the policy will forward traffic to Cloudflare. If set to "true", the policy will forward traffic locally on the Magic Connector. If not included in request, will default to false. - `lan_1?: ACLConfiguration` Body param - `lan_id: string` The identifier for the LAN you want to create an ACL policy with. - `lan_name?: string` The name of the LAN based on the provided lan_id. - `port_ranges?: Array` Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed. - `ports?: Array` Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed. - `subnets?: Array` Array of subnet IPs within the LAN that will be included in the ACL. If no subnets are provided, communication on any subnets on this LAN are allowed. - `lan_2?: ACLConfiguration` Body param - `name?: string` Body param: The name of the ACL. - `protocols?: Array` Body param - `"tcp"` - `"udp"` - `"icmp"` - `unidirectional?: boolean` Body param: The desired traffic direction for this ACL policy. If set to "false", the policy will allow bidirectional traffic. If set to "true", the policy will only allow traffic in one direction. If not included in request, will default to false. ### Returns - `ACL` Bidirectional ACL policy for network traffic within a site. - `id?: string` Identifier - `description?: string` Description for the ACL. - `forward_locally?: boolean` The desired forwarding action for this ACL policy. If set to "false", the policy will forward traffic to Cloudflare. If set to "true", the policy will forward traffic locally on the Magic Connector. If not included in request, will default to false. - `lan_1?: ACLConfiguration` - `lan_id: string` The identifier for the LAN you want to create an ACL policy with. - `lan_name?: string` The name of the LAN based on the provided lan_id. - `port_ranges?: Array` Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed. - `ports?: Array` Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed. - `subnets?: Array` Array of subnet IPs within the LAN that will be included in the ACL. If no subnets are provided, communication on any subnets on this LAN are allowed. - `lan_2?: ACLConfiguration` - `name?: string` The name of the ACL. - `protocols?: Array` - `"tcp"` - `"udp"` - `"icmp"` - `unidirectional?: boolean` The desired traffic direction for this ACL policy. If set to "false", the policy will allow bidirectional traffic. If set to "true", the policy will only allow traffic in one direction. If not included in request, will default to false. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const acl = await client.magicTransit.sites.acls.edit( '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(acl.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "description": "Allows local traffic between PIN pads and cash register.", "forward_locally": true, "lan_1": { "lan_id": "lan_id", "lan_name": "lan_name", "port_ranges": [ "8080-9000" ], "ports": [ 1 ], "subnets": [ "192.0.2.1" ] }, "lan_2": { "lan_id": "lan_id", "lan_name": "lan_name", "port_ranges": [ "8080-9000" ], "ports": [ 1 ], "subnets": [ "192.0.2.1" ] }, "name": "PIN Pad - Cash Register", "protocols": [ "tcp" ], "unidirectional": true }, "success": true } ``` ## Delete Site ACL `client.magicTransit.sites.acls.delete(stringsiteId, stringaclId, ACLDeleteParamsparams, RequestOptionsoptions?): ACL` **delete** `/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_id}` Remove a specific Site ACL. ### Parameters - `siteId: string` Identifier - `aclId: string` Identifier - `params: ACLDeleteParams` - `account_id: string` Identifier ### Returns - `ACL` Bidirectional ACL policy for network traffic within a site. - `id?: string` Identifier - `description?: string` Description for the ACL. - `forward_locally?: boolean` The desired forwarding action for this ACL policy. If set to "false", the policy will forward traffic to Cloudflare. If set to "true", the policy will forward traffic locally on the Magic Connector. If not included in request, will default to false. - `lan_1?: ACLConfiguration` - `lan_id: string` The identifier for the LAN you want to create an ACL policy with. - `lan_name?: string` The name of the LAN based on the provided lan_id. - `port_ranges?: Array` Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed. - `ports?: Array` Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed. - `subnets?: Array` Array of subnet IPs within the LAN that will be included in the ACL. If no subnets are provided, communication on any subnets on this LAN are allowed. - `lan_2?: ACLConfiguration` - `name?: string` The name of the ACL. - `protocols?: Array` - `"tcp"` - `"udp"` - `"icmp"` - `unidirectional?: boolean` The desired traffic direction for this ACL policy. If set to "false", the policy will allow bidirectional traffic. If set to "true", the policy will only allow traffic in one direction. If not included in request, will default to false. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const acl = await client.magicTransit.sites.acls.delete( '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(acl.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "description": "Allows local traffic between PIN pads and cash register.", "forward_locally": true, "lan_1": { "lan_id": "lan_id", "lan_name": "lan_name", "port_ranges": [ "8080-9000" ], "ports": [ 1 ], "subnets": [ "192.0.2.1" ] }, "lan_2": { "lan_id": "lan_id", "lan_name": "lan_name", "port_ranges": [ "8080-9000" ], "ports": [ 1 ], "subnets": [ "192.0.2.1" ] }, "name": "PIN Pad - Cash Register", "protocols": [ "tcp" ], "unidirectional": true }, "success": true } ``` ## Domain Types ### ACL - `ACL` Bidirectional ACL policy for network traffic within a site. - `id?: string` Identifier - `description?: string` Description for the ACL. - `forward_locally?: boolean` The desired forwarding action for this ACL policy. If set to "false", the policy will forward traffic to Cloudflare. If set to "true", the policy will forward traffic locally on the Magic Connector. If not included in request, will default to false. - `lan_1?: ACLConfiguration` - `lan_id: string` The identifier for the LAN you want to create an ACL policy with. - `lan_name?: string` The name of the LAN based on the provided lan_id. - `port_ranges?: Array` Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed. - `ports?: Array` Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed. - `subnets?: Array` Array of subnet IPs within the LAN that will be included in the ACL. If no subnets are provided, communication on any subnets on this LAN are allowed. - `lan_2?: ACLConfiguration` - `name?: string` The name of the ACL. - `protocols?: Array` - `"tcp"` - `"udp"` - `"icmp"` - `unidirectional?: boolean` The desired traffic direction for this ACL policy. If set to "false", the policy will allow bidirectional traffic. If set to "true", the policy will only allow traffic in one direction. If not included in request, will default to false. ### ACL Configuration - `ACLConfiguration` - `lan_id: string` The identifier for the LAN you want to create an ACL policy with. - `lan_name?: string` The name of the LAN based on the provided lan_id. - `port_ranges?: Array` Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed. - `ports?: Array` Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed. - `subnets?: Array` Array of subnet IPs within the LAN that will be included in the ACL. If no subnets are provided, communication on any subnets on this LAN are allowed. ### Allowed Protocol - `AllowedProtocol = "tcp" | "udp" | "icmp"` Array of allowed communication protocols between configured LANs. If no protocols are provided, all protocols are allowed. - `"tcp"` - `"udp"` - `"icmp"` ### Subnet - `Subnet = string` A valid IPv4 address. # LANs ## List Site LANs `client.magicTransit.sites.lans.list(stringsiteId, LANListParamsparams, RequestOptionsoptions?): SinglePage` **get** `/accounts/{account_id}/magic/sites/{site_id}/lans` Lists Site LANs associated with an account. ### Parameters - `siteId: string` Identifier - `params: LANListParams` - `account_id: string` Identifier ### Returns - `LAN` - `id?: string` Identifier - `bond_id?: number` - `ha_link?: boolean` mark true to use this LAN for HA probing. only works for site with HA turned on. only one LAN can be set as the ha_link. - `is_breakout?: boolean` mark true to use this LAN for source-based breakout traffic - `is_prioritized?: boolean` mark true to use this LAN for source-based prioritized traffic - `name?: string` - `nat?: Nat` - `static_prefix?: string` A valid CIDR notation representing an IP range. - `physport?: number` - `routed_subnets?: Array` - `next_hop: string` A valid IPv4 address. - `prefix: string` A valid CIDR notation representing an IP range. - `nat?: Nat` - `site_id?: string` Identifier - `static_addressing?: LANStaticAddressing` If the site is not configured in high availability mode, this configuration is optional (if omitted, use DHCP). However, if in high availability mode, static_address is required along with secondary and virtual address. - `address: string` A valid CIDR notation representing an IP range. - `dhcp_relay?: DHCPRelay` - `server_addresses?: Array` List of DHCP server IPs. - `dhcp_server?: DHCPServer` - `dhcp_pool_end?: string` A valid IPv4 address. - `dhcp_pool_start?: string` A valid IPv4 address. - `dns_server?: string` A valid IPv4 address. - `dns_servers?: Array` - `reservations?: Record` Mapping of MAC addresses to IP addresses - `secondary_address?: string` A valid CIDR notation representing an IP range. - `virtual_address?: string` A valid CIDR notation representing an IP range. - `vlan_tag?: number` VLAN ID. Use zero for untagged. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const lan of client.magicTransit.sites.lans.list('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(lan.id); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "id": "023e105f4ecef8ad9ca31a8372d0c353", "bond_id": 2, "ha_link": true, "is_breakout": true, "is_prioritized": true, "name": "name", "nat": { "static_prefix": "192.0.2.0/24" }, "physport": 1, "routed_subnets": [ { "next_hop": "192.0.2.1", "prefix": "192.0.2.0/24", "nat": { "static_prefix": "192.0.2.0/24" } } ], "site_id": "023e105f4ecef8ad9ca31a8372d0c353", "static_addressing": { "address": "192.0.2.0/24", "dhcp_relay": { "server_addresses": [ "192.0.2.1" ] }, "dhcp_server": { "dhcp_pool_end": "192.0.2.1", "dhcp_pool_start": "192.0.2.1", "dns_server": "192.0.2.1", "dns_servers": [ "192.0.2.1" ], "reservations": { "00:11:22:33:44:55": "192.0.2.100", "AA:BB:CC:DD:EE:FF": "192.168.1.101" } }, "secondary_address": "192.0.2.0/24", "virtual_address": "192.0.2.0/24" }, "vlan_tag": 42 } ], "success": true } ``` ## Site LAN Details `client.magicTransit.sites.lans.get(stringsiteId, stringlanId, LANGetParamsparams, RequestOptionsoptions?): LAN` **get** `/accounts/{account_id}/magic/sites/{site_id}/lans/{lan_id}` Get a specific Site LAN. ### Parameters - `siteId: string` Identifier - `lanId: string` Identifier - `params: LANGetParams` - `account_id: string` Identifier ### Returns - `LAN` - `id?: string` Identifier - `bond_id?: number` - `ha_link?: boolean` mark true to use this LAN for HA probing. only works for site with HA turned on. only one LAN can be set as the ha_link. - `is_breakout?: boolean` mark true to use this LAN for source-based breakout traffic - `is_prioritized?: boolean` mark true to use this LAN for source-based prioritized traffic - `name?: string` - `nat?: Nat` - `static_prefix?: string` A valid CIDR notation representing an IP range. - `physport?: number` - `routed_subnets?: Array` - `next_hop: string` A valid IPv4 address. - `prefix: string` A valid CIDR notation representing an IP range. - `nat?: Nat` - `site_id?: string` Identifier - `static_addressing?: LANStaticAddressing` If the site is not configured in high availability mode, this configuration is optional (if omitted, use DHCP). However, if in high availability mode, static_address is required along with secondary and virtual address. - `address: string` A valid CIDR notation representing an IP range. - `dhcp_relay?: DHCPRelay` - `server_addresses?: Array` List of DHCP server IPs. - `dhcp_server?: DHCPServer` - `dhcp_pool_end?: string` A valid IPv4 address. - `dhcp_pool_start?: string` A valid IPv4 address. - `dns_server?: string` A valid IPv4 address. - `dns_servers?: Array` - `reservations?: Record` Mapping of MAC addresses to IP addresses - `secondary_address?: string` A valid CIDR notation representing an IP range. - `virtual_address?: string` A valid CIDR notation representing an IP range. - `vlan_tag?: number` VLAN ID. Use zero for untagged. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const lan = await client.magicTransit.sites.lans.get( '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(lan.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "bond_id": 2, "ha_link": true, "is_breakout": true, "is_prioritized": true, "name": "name", "nat": { "static_prefix": "192.0.2.0/24" }, "physport": 1, "routed_subnets": [ { "next_hop": "192.0.2.1", "prefix": "192.0.2.0/24", "nat": { "static_prefix": "192.0.2.0/24" } } ], "site_id": "023e105f4ecef8ad9ca31a8372d0c353", "static_addressing": { "address": "192.0.2.0/24", "dhcp_relay": { "server_addresses": [ "192.0.2.1" ] }, "dhcp_server": { "dhcp_pool_end": "192.0.2.1", "dhcp_pool_start": "192.0.2.1", "dns_server": "192.0.2.1", "dns_servers": [ "192.0.2.1" ], "reservations": { "00:11:22:33:44:55": "192.0.2.100", "AA:BB:CC:DD:EE:FF": "192.168.1.101" } }, "secondary_address": "192.0.2.0/24", "virtual_address": "192.0.2.0/24" }, "vlan_tag": 42 }, "success": true } ``` ## Create a new Site LAN `client.magicTransit.sites.lans.create(stringsiteId, LANCreateParamsparams, RequestOptionsoptions?): SinglePage` **post** `/accounts/{account_id}/magic/sites/{site_id}/lans` Creates a new Site LAN. If the site is in high availability mode, static_addressing is required along with secondary and virtual address. ### Parameters - `siteId: string` Identifier - `params: LANCreateParams` - `account_id: string` Path param: Identifier - `bond_id?: number` Body param - `ha_link?: boolean` Body param: mark true to use this LAN for HA probing. only works for site with HA turned on. only one LAN can be set as the ha_link. - `is_breakout?: boolean` Body param: mark true to use this LAN for source-based breakout traffic - `is_prioritized?: boolean` Body param: mark true to use this LAN for source-based prioritized traffic - `name?: string` Body param - `nat?: Nat` Body param - `static_prefix?: string` A valid CIDR notation representing an IP range. - `physport?: number` Body param - `routed_subnets?: Array` Body param - `next_hop: string` A valid IPv4 address. - `prefix: string` A valid CIDR notation representing an IP range. - `nat?: Nat` - `static_addressing?: LANStaticAddressing` Body param: If the site is not configured in high availability mode, this configuration is optional (if omitted, use DHCP). However, if in high availability mode, static_address is required along with secondary and virtual address. - `address: string` A valid CIDR notation representing an IP range. - `dhcp_relay?: DHCPRelay` - `server_addresses?: Array` List of DHCP server IPs. - `dhcp_server?: DHCPServer` - `dhcp_pool_end?: string` A valid IPv4 address. - `dhcp_pool_start?: string` A valid IPv4 address. - `dns_server?: string` A valid IPv4 address. - `dns_servers?: Array` - `reservations?: Record` Mapping of MAC addresses to IP addresses - `secondary_address?: string` A valid CIDR notation representing an IP range. - `virtual_address?: string` A valid CIDR notation representing an IP range. - `vlan_tag?: number` Body param: VLAN ID. Use zero for untagged. ### Returns - `LAN` - `id?: string` Identifier - `bond_id?: number` - `ha_link?: boolean` mark true to use this LAN for HA probing. only works for site with HA turned on. only one LAN can be set as the ha_link. - `is_breakout?: boolean` mark true to use this LAN for source-based breakout traffic - `is_prioritized?: boolean` mark true to use this LAN for source-based prioritized traffic - `name?: string` - `nat?: Nat` - `static_prefix?: string` A valid CIDR notation representing an IP range. - `physport?: number` - `routed_subnets?: Array` - `next_hop: string` A valid IPv4 address. - `prefix: string` A valid CIDR notation representing an IP range. - `nat?: Nat` - `site_id?: string` Identifier - `static_addressing?: LANStaticAddressing` If the site is not configured in high availability mode, this configuration is optional (if omitted, use DHCP). However, if in high availability mode, static_address is required along with secondary and virtual address. - `address: string` A valid CIDR notation representing an IP range. - `dhcp_relay?: DHCPRelay` - `server_addresses?: Array` List of DHCP server IPs. - `dhcp_server?: DHCPServer` - `dhcp_pool_end?: string` A valid IPv4 address. - `dhcp_pool_start?: string` A valid IPv4 address. - `dns_server?: string` A valid IPv4 address. - `dns_servers?: Array` - `reservations?: Record` Mapping of MAC addresses to IP addresses - `secondary_address?: string` A valid CIDR notation representing an IP range. - `virtual_address?: string` A valid CIDR notation representing an IP range. - `vlan_tag?: number` VLAN ID. Use zero for untagged. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const lan of client.magicTransit.sites.lans.create('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(lan.id); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "id": "023e105f4ecef8ad9ca31a8372d0c353", "bond_id": 2, "ha_link": true, "is_breakout": true, "is_prioritized": true, "name": "name", "nat": { "static_prefix": "192.0.2.0/24" }, "physport": 1, "routed_subnets": [ { "next_hop": "192.0.2.1", "prefix": "192.0.2.0/24", "nat": { "static_prefix": "192.0.2.0/24" } } ], "site_id": "023e105f4ecef8ad9ca31a8372d0c353", "static_addressing": { "address": "192.0.2.0/24", "dhcp_relay": { "server_addresses": [ "192.0.2.1" ] }, "dhcp_server": { "dhcp_pool_end": "192.0.2.1", "dhcp_pool_start": "192.0.2.1", "dns_server": "192.0.2.1", "dns_servers": [ "192.0.2.1" ], "reservations": { "00:11:22:33:44:55": "192.0.2.100", "AA:BB:CC:DD:EE:FF": "192.168.1.101" } }, "secondary_address": "192.0.2.0/24", "virtual_address": "192.0.2.0/24" }, "vlan_tag": 42 } ], "success": true } ``` ## Update Site LAN `client.magicTransit.sites.lans.update(stringsiteId, stringlanId, LANUpdateParamsparams, RequestOptionsoptions?): LAN` **put** `/accounts/{account_id}/magic/sites/{site_id}/lans/{lan_id}` Update a specific Site LAN. ### Parameters - `siteId: string` Identifier - `lanId: string` Identifier - `params: LANUpdateParams` - `account_id: string` Path param: Identifier - `bond_id?: number` Body param - `is_breakout?: boolean` Body param: mark true to use this LAN for source-based breakout traffic - `is_prioritized?: boolean` Body param: mark true to use this LAN for source-based prioritized traffic - `name?: string` Body param - `nat?: Nat` Body param - `static_prefix?: string` A valid CIDR notation representing an IP range. - `physport?: number` Body param - `routed_subnets?: Array` Body param - `next_hop: string` A valid IPv4 address. - `prefix: string` A valid CIDR notation representing an IP range. - `nat?: Nat` - `static_addressing?: LANStaticAddressing` Body param: If the site is not configured in high availability mode, this configuration is optional (if omitted, use DHCP). However, if in high availability mode, static_address is required along with secondary and virtual address. - `address: string` A valid CIDR notation representing an IP range. - `dhcp_relay?: DHCPRelay` - `server_addresses?: Array` List of DHCP server IPs. - `dhcp_server?: DHCPServer` - `dhcp_pool_end?: string` A valid IPv4 address. - `dhcp_pool_start?: string` A valid IPv4 address. - `dns_server?: string` A valid IPv4 address. - `dns_servers?: Array` - `reservations?: Record` Mapping of MAC addresses to IP addresses - `secondary_address?: string` A valid CIDR notation representing an IP range. - `virtual_address?: string` A valid CIDR notation representing an IP range. - `vlan_tag?: number` Body param: VLAN ID. Use zero for untagged. ### Returns - `LAN` - `id?: string` Identifier - `bond_id?: number` - `ha_link?: boolean` mark true to use this LAN for HA probing. only works for site with HA turned on. only one LAN can be set as the ha_link. - `is_breakout?: boolean` mark true to use this LAN for source-based breakout traffic - `is_prioritized?: boolean` mark true to use this LAN for source-based prioritized traffic - `name?: string` - `nat?: Nat` - `static_prefix?: string` A valid CIDR notation representing an IP range. - `physport?: number` - `routed_subnets?: Array` - `next_hop: string` A valid IPv4 address. - `prefix: string` A valid CIDR notation representing an IP range. - `nat?: Nat` - `site_id?: string` Identifier - `static_addressing?: LANStaticAddressing` If the site is not configured in high availability mode, this configuration is optional (if omitted, use DHCP). However, if in high availability mode, static_address is required along with secondary and virtual address. - `address: string` A valid CIDR notation representing an IP range. - `dhcp_relay?: DHCPRelay` - `server_addresses?: Array` List of DHCP server IPs. - `dhcp_server?: DHCPServer` - `dhcp_pool_end?: string` A valid IPv4 address. - `dhcp_pool_start?: string` A valid IPv4 address. - `dns_server?: string` A valid IPv4 address. - `dns_servers?: Array` - `reservations?: Record` Mapping of MAC addresses to IP addresses - `secondary_address?: string` A valid CIDR notation representing an IP range. - `virtual_address?: string` A valid CIDR notation representing an IP range. - `vlan_tag?: number` VLAN ID. Use zero for untagged. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const lan = await client.magicTransit.sites.lans.update( '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(lan.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "bond_id": 2, "ha_link": true, "is_breakout": true, "is_prioritized": true, "name": "name", "nat": { "static_prefix": "192.0.2.0/24" }, "physport": 1, "routed_subnets": [ { "next_hop": "192.0.2.1", "prefix": "192.0.2.0/24", "nat": { "static_prefix": "192.0.2.0/24" } } ], "site_id": "023e105f4ecef8ad9ca31a8372d0c353", "static_addressing": { "address": "192.0.2.0/24", "dhcp_relay": { "server_addresses": [ "192.0.2.1" ] }, "dhcp_server": { "dhcp_pool_end": "192.0.2.1", "dhcp_pool_start": "192.0.2.1", "dns_server": "192.0.2.1", "dns_servers": [ "192.0.2.1" ], "reservations": { "00:11:22:33:44:55": "192.0.2.100", "AA:BB:CC:DD:EE:FF": "192.168.1.101" } }, "secondary_address": "192.0.2.0/24", "virtual_address": "192.0.2.0/24" }, "vlan_tag": 42 }, "success": true } ``` ## Patch Site LAN `client.magicTransit.sites.lans.edit(stringsiteId, stringlanId, LANEditParamsparams, RequestOptionsoptions?): LAN` **patch** `/accounts/{account_id}/magic/sites/{site_id}/lans/{lan_id}` Patch a specific Site LAN. ### Parameters - `siteId: string` Identifier - `lanId: string` Identifier - `params: LANEditParams` - `account_id: string` Path param: Identifier - `bond_id?: number` Body param - `is_breakout?: boolean` Body param: mark true to use this LAN for source-based breakout traffic - `is_prioritized?: boolean` Body param: mark true to use this LAN for source-based prioritized traffic - `name?: string` Body param - `nat?: Nat` Body param - `static_prefix?: string` A valid CIDR notation representing an IP range. - `physport?: number` Body param - `routed_subnets?: Array` Body param - `next_hop: string` A valid IPv4 address. - `prefix: string` A valid CIDR notation representing an IP range. - `nat?: Nat` - `static_addressing?: LANStaticAddressing` Body param: If the site is not configured in high availability mode, this configuration is optional (if omitted, use DHCP). However, if in high availability mode, static_address is required along with secondary and virtual address. - `address: string` A valid CIDR notation representing an IP range. - `dhcp_relay?: DHCPRelay` - `server_addresses?: Array` List of DHCP server IPs. - `dhcp_server?: DHCPServer` - `dhcp_pool_end?: string` A valid IPv4 address. - `dhcp_pool_start?: string` A valid IPv4 address. - `dns_server?: string` A valid IPv4 address. - `dns_servers?: Array` - `reservations?: Record` Mapping of MAC addresses to IP addresses - `secondary_address?: string` A valid CIDR notation representing an IP range. - `virtual_address?: string` A valid CIDR notation representing an IP range. - `vlan_tag?: number` Body param: VLAN ID. Use zero for untagged. ### Returns - `LAN` - `id?: string` Identifier - `bond_id?: number` - `ha_link?: boolean` mark true to use this LAN for HA probing. only works for site with HA turned on. only one LAN can be set as the ha_link. - `is_breakout?: boolean` mark true to use this LAN for source-based breakout traffic - `is_prioritized?: boolean` mark true to use this LAN for source-based prioritized traffic - `name?: string` - `nat?: Nat` - `static_prefix?: string` A valid CIDR notation representing an IP range. - `physport?: number` - `routed_subnets?: Array` - `next_hop: string` A valid IPv4 address. - `prefix: string` A valid CIDR notation representing an IP range. - `nat?: Nat` - `site_id?: string` Identifier - `static_addressing?: LANStaticAddressing` If the site is not configured in high availability mode, this configuration is optional (if omitted, use DHCP). However, if in high availability mode, static_address is required along with secondary and virtual address. - `address: string` A valid CIDR notation representing an IP range. - `dhcp_relay?: DHCPRelay` - `server_addresses?: Array` List of DHCP server IPs. - `dhcp_server?: DHCPServer` - `dhcp_pool_end?: string` A valid IPv4 address. - `dhcp_pool_start?: string` A valid IPv4 address. - `dns_server?: string` A valid IPv4 address. - `dns_servers?: Array` - `reservations?: Record` Mapping of MAC addresses to IP addresses - `secondary_address?: string` A valid CIDR notation representing an IP range. - `virtual_address?: string` A valid CIDR notation representing an IP range. - `vlan_tag?: number` VLAN ID. Use zero for untagged. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const lan = await client.magicTransit.sites.lans.edit( '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(lan.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "bond_id": 2, "ha_link": true, "is_breakout": true, "is_prioritized": true, "name": "name", "nat": { "static_prefix": "192.0.2.0/24" }, "physport": 1, "routed_subnets": [ { "next_hop": "192.0.2.1", "prefix": "192.0.2.0/24", "nat": { "static_prefix": "192.0.2.0/24" } } ], "site_id": "023e105f4ecef8ad9ca31a8372d0c353", "static_addressing": { "address": "192.0.2.0/24", "dhcp_relay": { "server_addresses": [ "192.0.2.1" ] }, "dhcp_server": { "dhcp_pool_end": "192.0.2.1", "dhcp_pool_start": "192.0.2.1", "dns_server": "192.0.2.1", "dns_servers": [ "192.0.2.1" ], "reservations": { "00:11:22:33:44:55": "192.0.2.100", "AA:BB:CC:DD:EE:FF": "192.168.1.101" } }, "secondary_address": "192.0.2.0/24", "virtual_address": "192.0.2.0/24" }, "vlan_tag": 42 }, "success": true } ``` ## Delete Site LAN `client.magicTransit.sites.lans.delete(stringsiteId, stringlanId, LANDeleteParamsparams, RequestOptionsoptions?): LAN` **delete** `/accounts/{account_id}/magic/sites/{site_id}/lans/{lan_id}` Remove a specific Site LAN. ### Parameters - `siteId: string` Identifier - `lanId: string` Identifier - `params: LANDeleteParams` - `account_id: string` Identifier ### Returns - `LAN` - `id?: string` Identifier - `bond_id?: number` - `ha_link?: boolean` mark true to use this LAN for HA probing. only works for site with HA turned on. only one LAN can be set as the ha_link. - `is_breakout?: boolean` mark true to use this LAN for source-based breakout traffic - `is_prioritized?: boolean` mark true to use this LAN for source-based prioritized traffic - `name?: string` - `nat?: Nat` - `static_prefix?: string` A valid CIDR notation representing an IP range. - `physport?: number` - `routed_subnets?: Array` - `next_hop: string` A valid IPv4 address. - `prefix: string` A valid CIDR notation representing an IP range. - `nat?: Nat` - `site_id?: string` Identifier - `static_addressing?: LANStaticAddressing` If the site is not configured in high availability mode, this configuration is optional (if omitted, use DHCP). However, if in high availability mode, static_address is required along with secondary and virtual address. - `address: string` A valid CIDR notation representing an IP range. - `dhcp_relay?: DHCPRelay` - `server_addresses?: Array` List of DHCP server IPs. - `dhcp_server?: DHCPServer` - `dhcp_pool_end?: string` A valid IPv4 address. - `dhcp_pool_start?: string` A valid IPv4 address. - `dns_server?: string` A valid IPv4 address. - `dns_servers?: Array` - `reservations?: Record` Mapping of MAC addresses to IP addresses - `secondary_address?: string` A valid CIDR notation representing an IP range. - `virtual_address?: string` A valid CIDR notation representing an IP range. - `vlan_tag?: number` VLAN ID. Use zero for untagged. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const lan = await client.magicTransit.sites.lans.delete( '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(lan.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "bond_id": 2, "ha_link": true, "is_breakout": true, "is_prioritized": true, "name": "name", "nat": { "static_prefix": "192.0.2.0/24" }, "physport": 1, "routed_subnets": [ { "next_hop": "192.0.2.1", "prefix": "192.0.2.0/24", "nat": { "static_prefix": "192.0.2.0/24" } } ], "site_id": "023e105f4ecef8ad9ca31a8372d0c353", "static_addressing": { "address": "192.0.2.0/24", "dhcp_relay": { "server_addresses": [ "192.0.2.1" ] }, "dhcp_server": { "dhcp_pool_end": "192.0.2.1", "dhcp_pool_start": "192.0.2.1", "dns_server": "192.0.2.1", "dns_servers": [ "192.0.2.1" ], "reservations": { "00:11:22:33:44:55": "192.0.2.100", "AA:BB:CC:DD:EE:FF": "192.168.1.101" } }, "secondary_address": "192.0.2.0/24", "virtual_address": "192.0.2.0/24" }, "vlan_tag": 42 }, "success": true } ``` ## Domain Types ### DHCP Relay - `DHCPRelay` - `server_addresses?: Array` List of DHCP server IPs. ### DHCP Server - `DHCPServer` - `dhcp_pool_end?: string` A valid IPv4 address. - `dhcp_pool_start?: string` A valid IPv4 address. - `dns_server?: string` A valid IPv4 address. - `dns_servers?: Array` - `reservations?: Record` Mapping of MAC addresses to IP addresses ### LAN - `LAN` - `id?: string` Identifier - `bond_id?: number` - `ha_link?: boolean` mark true to use this LAN for HA probing. only works for site with HA turned on. only one LAN can be set as the ha_link. - `is_breakout?: boolean` mark true to use this LAN for source-based breakout traffic - `is_prioritized?: boolean` mark true to use this LAN for source-based prioritized traffic - `name?: string` - `nat?: Nat` - `static_prefix?: string` A valid CIDR notation representing an IP range. - `physport?: number` - `routed_subnets?: Array` - `next_hop: string` A valid IPv4 address. - `prefix: string` A valid CIDR notation representing an IP range. - `nat?: Nat` - `site_id?: string` Identifier - `static_addressing?: LANStaticAddressing` If the site is not configured in high availability mode, this configuration is optional (if omitted, use DHCP). However, if in high availability mode, static_address is required along with secondary and virtual address. - `address: string` A valid CIDR notation representing an IP range. - `dhcp_relay?: DHCPRelay` - `server_addresses?: Array` List of DHCP server IPs. - `dhcp_server?: DHCPServer` - `dhcp_pool_end?: string` A valid IPv4 address. - `dhcp_pool_start?: string` A valid IPv4 address. - `dns_server?: string` A valid IPv4 address. - `dns_servers?: Array` - `reservations?: Record` Mapping of MAC addresses to IP addresses - `secondary_address?: string` A valid CIDR notation representing an IP range. - `virtual_address?: string` A valid CIDR notation representing an IP range. - `vlan_tag?: number` VLAN ID. Use zero for untagged. ### LAN Static Addressing - `LANStaticAddressing` If the site is not configured in high availability mode, this configuration is optional (if omitted, use DHCP). However, if in high availability mode, static_address is required along with secondary and virtual address. - `address: string` A valid CIDR notation representing an IP range. - `dhcp_relay?: DHCPRelay` - `server_addresses?: Array` List of DHCP server IPs. - `dhcp_server?: DHCPServer` - `dhcp_pool_end?: string` A valid IPv4 address. - `dhcp_pool_start?: string` A valid IPv4 address. - `dns_server?: string` A valid IPv4 address. - `dns_servers?: Array` - `reservations?: Record` Mapping of MAC addresses to IP addresses - `secondary_address?: string` A valid CIDR notation representing an IP range. - `virtual_address?: string` A valid CIDR notation representing an IP range. ### Nat - `Nat` - `static_prefix?: string` A valid CIDR notation representing an IP range. ### Routed Subnet - `RoutedSubnet` - `next_hop: string` A valid IPv4 address. - `prefix: string` A valid CIDR notation representing an IP range. - `nat?: Nat` - `static_prefix?: string` A valid CIDR notation representing an IP range. # WANs ## List Site WANs `client.magicTransit.sites.wans.list(stringsiteId, WANListParamsparams, RequestOptionsoptions?): SinglePage` **get** `/accounts/{account_id}/magic/sites/{site_id}/wans` Lists Site WANs associated with an account. ### Parameters - `siteId: string` Identifier - `params: WANListParams` - `account_id: string` Identifier ### Returns - `WAN` - `id?: string` Identifier - `health_check_rate?: "low" | "mid" | "high"` Magic WAN health check rate for tunnels created on this link. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `name?: string` - `physport?: number` - `priority?: number` Priority of WAN for traffic loadbalancing. - `site_id?: string` Identifier - `static_addressing?: WANStaticAddressing` (optional) if omitted, use DHCP. Submit secondary_address when site is in high availability mode. - `address: string` A valid CIDR notation representing an IP range. - `gateway_address: string` A valid IPv4 address. - `secondary_address?: string` A valid CIDR notation representing an IP range. - `vlan_tag?: number` VLAN ID. Use zero for untagged. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const wan of client.magicTransit.sites.wans.list('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(wan.id); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "id": "023e105f4ecef8ad9ca31a8372d0c353", "health_check_rate": "low", "name": "name", "physport": 1, "priority": 0, "site_id": "023e105f4ecef8ad9ca31a8372d0c353", "static_addressing": { "address": "192.0.2.0/24", "gateway_address": "192.0.2.1", "secondary_address": "192.0.2.0/24" }, "vlan_tag": 42 } ], "success": true } ``` ## Site WAN Details `client.magicTransit.sites.wans.get(stringsiteId, stringwanId, WANGetParamsparams, RequestOptionsoptions?): WAN` **get** `/accounts/{account_id}/magic/sites/{site_id}/wans/{wan_id}` Get a specific Site WAN. ### Parameters - `siteId: string` Identifier - `wanId: string` Identifier - `params: WANGetParams` - `account_id: string` Identifier ### Returns - `WAN` - `id?: string` Identifier - `health_check_rate?: "low" | "mid" | "high"` Magic WAN health check rate for tunnels created on this link. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `name?: string` - `physport?: number` - `priority?: number` Priority of WAN for traffic loadbalancing. - `site_id?: string` Identifier - `static_addressing?: WANStaticAddressing` (optional) if omitted, use DHCP. Submit secondary_address when site is in high availability mode. - `address: string` A valid CIDR notation representing an IP range. - `gateway_address: string` A valid IPv4 address. - `secondary_address?: string` A valid CIDR notation representing an IP range. - `vlan_tag?: number` VLAN ID. Use zero for untagged. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const wan = await client.magicTransit.sites.wans.get( '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(wan.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "health_check_rate": "low", "name": "name", "physport": 1, "priority": 0, "site_id": "023e105f4ecef8ad9ca31a8372d0c353", "static_addressing": { "address": "192.0.2.0/24", "gateway_address": "192.0.2.1", "secondary_address": "192.0.2.0/24" }, "vlan_tag": 42 }, "success": true } ``` ## Create a new Site WAN `client.magicTransit.sites.wans.create(stringsiteId, WANCreateParamsparams, RequestOptionsoptions?): SinglePage` **post** `/accounts/{account_id}/magic/sites/{site_id}/wans` Creates a new Site WAN. ### Parameters - `siteId: string` Identifier - `params: WANCreateParams` - `account_id: string` Path param: Identifier - `physport: number` Body param - `name?: string` Body param - `priority?: number` Body param - `static_addressing?: WANStaticAddressing` Body param: (optional) if omitted, use DHCP. Submit secondary_address when site is in high availability mode. - `address: string` A valid CIDR notation representing an IP range. - `gateway_address: string` A valid IPv4 address. - `secondary_address?: string` A valid CIDR notation representing an IP range. - `vlan_tag?: number` Body param: VLAN ID. Use zero for untagged. ### Returns - `WAN` - `id?: string` Identifier - `health_check_rate?: "low" | "mid" | "high"` Magic WAN health check rate for tunnels created on this link. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `name?: string` - `physport?: number` - `priority?: number` Priority of WAN for traffic loadbalancing. - `site_id?: string` Identifier - `static_addressing?: WANStaticAddressing` (optional) if omitted, use DHCP. Submit secondary_address when site is in high availability mode. - `address: string` A valid CIDR notation representing an IP range. - `gateway_address: string` A valid IPv4 address. - `secondary_address?: string` A valid CIDR notation representing an IP range. - `vlan_tag?: number` VLAN ID. Use zero for untagged. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const wan of client.magicTransit.sites.wans.create('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', physport: 1, })) { console.log(wan.id); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "id": "023e105f4ecef8ad9ca31a8372d0c353", "health_check_rate": "low", "name": "name", "physport": 1, "priority": 0, "site_id": "023e105f4ecef8ad9ca31a8372d0c353", "static_addressing": { "address": "192.0.2.0/24", "gateway_address": "192.0.2.1", "secondary_address": "192.0.2.0/24" }, "vlan_tag": 42 } ], "success": true } ``` ## Update Site WAN `client.magicTransit.sites.wans.update(stringsiteId, stringwanId, WANUpdateParamsparams, RequestOptionsoptions?): WAN` **put** `/accounts/{account_id}/magic/sites/{site_id}/wans/{wan_id}` Update a specific Site WAN. ### Parameters - `siteId: string` Identifier - `wanId: string` Identifier - `params: WANUpdateParams` - `account_id: string` Path param: Identifier - `name?: string` Body param - `physport?: number` Body param - `priority?: number` Body param - `static_addressing?: WANStaticAddressing` Body param: (optional) if omitted, use DHCP. Submit secondary_address when site is in high availability mode. - `address: string` A valid CIDR notation representing an IP range. - `gateway_address: string` A valid IPv4 address. - `secondary_address?: string` A valid CIDR notation representing an IP range. - `vlan_tag?: number` Body param: VLAN ID. Use zero for untagged. ### Returns - `WAN` - `id?: string` Identifier - `health_check_rate?: "low" | "mid" | "high"` Magic WAN health check rate for tunnels created on this link. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `name?: string` - `physport?: number` - `priority?: number` Priority of WAN for traffic loadbalancing. - `site_id?: string` Identifier - `static_addressing?: WANStaticAddressing` (optional) if omitted, use DHCP. Submit secondary_address when site is in high availability mode. - `address: string` A valid CIDR notation representing an IP range. - `gateway_address: string` A valid IPv4 address. - `secondary_address?: string` A valid CIDR notation representing an IP range. - `vlan_tag?: number` VLAN ID. Use zero for untagged. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const wan = await client.magicTransit.sites.wans.update( '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(wan.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "health_check_rate": "low", "name": "name", "physport": 1, "priority": 0, "site_id": "023e105f4ecef8ad9ca31a8372d0c353", "static_addressing": { "address": "192.0.2.0/24", "gateway_address": "192.0.2.1", "secondary_address": "192.0.2.0/24" }, "vlan_tag": 42 }, "success": true } ``` ## Patch Site WAN `client.magicTransit.sites.wans.edit(stringsiteId, stringwanId, WANEditParamsparams, RequestOptionsoptions?): WAN` **patch** `/accounts/{account_id}/magic/sites/{site_id}/wans/{wan_id}` Patch a specific Site WAN. ### Parameters - `siteId: string` Identifier - `wanId: string` Identifier - `params: WANEditParams` - `account_id: string` Path param: Identifier - `name?: string` Body param - `physport?: number` Body param - `priority?: number` Body param - `static_addressing?: WANStaticAddressing` Body param: (optional) if omitted, use DHCP. Submit secondary_address when site is in high availability mode. - `address: string` A valid CIDR notation representing an IP range. - `gateway_address: string` A valid IPv4 address. - `secondary_address?: string` A valid CIDR notation representing an IP range. - `vlan_tag?: number` Body param: VLAN ID. Use zero for untagged. ### Returns - `WAN` - `id?: string` Identifier - `health_check_rate?: "low" | "mid" | "high"` Magic WAN health check rate for tunnels created on this link. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `name?: string` - `physport?: number` - `priority?: number` Priority of WAN for traffic loadbalancing. - `site_id?: string` Identifier - `static_addressing?: WANStaticAddressing` (optional) if omitted, use DHCP. Submit secondary_address when site is in high availability mode. - `address: string` A valid CIDR notation representing an IP range. - `gateway_address: string` A valid IPv4 address. - `secondary_address?: string` A valid CIDR notation representing an IP range. - `vlan_tag?: number` VLAN ID. Use zero for untagged. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const wan = await client.magicTransit.sites.wans.edit( '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(wan.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "health_check_rate": "low", "name": "name", "physport": 1, "priority": 0, "site_id": "023e105f4ecef8ad9ca31a8372d0c353", "static_addressing": { "address": "192.0.2.0/24", "gateway_address": "192.0.2.1", "secondary_address": "192.0.2.0/24" }, "vlan_tag": 42 }, "success": true } ``` ## Delete Site WAN `client.magicTransit.sites.wans.delete(stringsiteId, stringwanId, WANDeleteParamsparams, RequestOptionsoptions?): WAN` **delete** `/accounts/{account_id}/magic/sites/{site_id}/wans/{wan_id}` Remove a specific Site WAN. ### Parameters - `siteId: string` Identifier - `wanId: string` Identifier - `params: WANDeleteParams` - `account_id: string` Identifier ### Returns - `WAN` - `id?: string` Identifier - `health_check_rate?: "low" | "mid" | "high"` Magic WAN health check rate for tunnels created on this link. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `name?: string` - `physport?: number` - `priority?: number` Priority of WAN for traffic loadbalancing. - `site_id?: string` Identifier - `static_addressing?: WANStaticAddressing` (optional) if omitted, use DHCP. Submit secondary_address when site is in high availability mode. - `address: string` A valid CIDR notation representing an IP range. - `gateway_address: string` A valid IPv4 address. - `secondary_address?: string` A valid CIDR notation representing an IP range. - `vlan_tag?: number` VLAN ID. Use zero for untagged. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const wan = await client.magicTransit.sites.wans.delete( '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(wan.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "health_check_rate": "low", "name": "name", "physport": 1, "priority": 0, "site_id": "023e105f4ecef8ad9ca31a8372d0c353", "static_addressing": { "address": "192.0.2.0/24", "gateway_address": "192.0.2.1", "secondary_address": "192.0.2.0/24" }, "vlan_tag": 42 }, "success": true } ``` ## Domain Types ### WAN - `WAN` - `id?: string` Identifier - `health_check_rate?: "low" | "mid" | "high"` Magic WAN health check rate for tunnels created on this link. The default value is `mid`. - `"low"` - `"mid"` - `"high"` - `name?: string` - `physport?: number` - `priority?: number` Priority of WAN for traffic loadbalancing. - `site_id?: string` Identifier - `static_addressing?: WANStaticAddressing` (optional) if omitted, use DHCP. Submit secondary_address when site is in high availability mode. - `address: string` A valid CIDR notation representing an IP range. - `gateway_address: string` A valid IPv4 address. - `secondary_address?: string` A valid CIDR notation representing an IP range. - `vlan_tag?: number` VLAN ID. Use zero for untagged. ### WAN Static Addressing - `WANStaticAddressing` (optional) if omitted, use DHCP. Submit secondary_address when site is in high availability mode. - `address: string` A valid CIDR notation representing an IP range. - `gateway_address: string` A valid IPv4 address. - `secondary_address?: string` A valid CIDR notation representing an IP range. # Connectors ## List Connectors `client.magicTransit.connectors.list(ConnectorListParamsparams, RequestOptionsoptions?): SinglePage` **get** `/accounts/{account_id}/magic/connectors` List Connectors ### Parameters - `params: ConnectorListParams` - `account_id: string` Account identifier ### Returns - `ConnectorListResponse` - `id: string` - `activated: boolean` - `interrupt_window_days_of_week: Array<"Sunday" | "Monday" | "Tuesday" | 4 more>` Allowed days of the week for upgrades. Default is all days. - `"Sunday"` - `"Monday"` - `"Tuesday"` - `"Wednesday"` - `"Thursday"` - `"Friday"` - `"Saturday"` - `interrupt_window_duration_hours: number` - `interrupt_window_embargo_dates: Array` List of dates (YYYY-MM-DD) when upgrades are blocked. - `interrupt_window_hour_of_day: number` - `last_updated: string` - `notes: string` - `timezone: string` - `device?: Device` - `id: string` - `serial_number?: string` - `last_heartbeat?: string` - `last_seen_version?: string` - `license_key?: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const connectorListResponse of client.magicTransit.connectors.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(connectorListResponse.id); } ``` #### Response ```json { "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ], "result": [ { "id": "id", "activated": true, "interrupt_window_days_of_week": [ "Sunday" ], "interrupt_window_duration_hours": 1, "interrupt_window_embargo_dates": [ "string" ], "interrupt_window_hour_of_day": 0, "last_updated": "last_updated", "notes": "notes", "timezone": "timezone", "device": { "id": "id", "serial_number": "serial_number" }, "last_heartbeat": "last_heartbeat", "last_seen_version": "last_seen_version", "license_key": "license_key" } ], "success": true } ``` ## Fetch Connector `client.magicTransit.connectors.get(stringconnectorId, ConnectorGetParamsparams, RequestOptionsoptions?): ConnectorGetResponse` **get** `/accounts/{account_id}/magic/connectors/{connector_id}` Fetch Connector ### Parameters - `connectorId: string` - `params: ConnectorGetParams` - `account_id: string` Account identifier ### Returns - `ConnectorGetResponse` - `id: string` - `activated: boolean` - `interrupt_window_days_of_week: Array<"Sunday" | "Monday" | "Tuesday" | 4 more>` Allowed days of the week for upgrades. Default is all days. - `"Sunday"` - `"Monday"` - `"Tuesday"` - `"Wednesday"` - `"Thursday"` - `"Friday"` - `"Saturday"` - `interrupt_window_duration_hours: number` - `interrupt_window_embargo_dates: Array` List of dates (YYYY-MM-DD) when upgrades are blocked. - `interrupt_window_hour_of_day: number` - `last_updated: string` - `notes: string` - `timezone: string` - `device?: Device` - `id: string` - `serial_number?: string` - `last_heartbeat?: string` - `last_seen_version?: string` - `license_key?: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const connector = await client.magicTransit.connectors.get('connector_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(connector.id); ``` #### Response ```json { "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ], "result": { "id": "id", "activated": true, "interrupt_window_days_of_week": [ "Sunday" ], "interrupt_window_duration_hours": 1, "interrupt_window_embargo_dates": [ "string" ], "interrupt_window_hour_of_day": 0, "last_updated": "last_updated", "notes": "notes", "timezone": "timezone", "device": { "id": "id", "serial_number": "serial_number" }, "last_heartbeat": "last_heartbeat", "last_seen_version": "last_seen_version", "license_key": "license_key" }, "success": true } ``` ## Add a connector to your account `client.magicTransit.connectors.create(ConnectorCreateParamsparams, RequestOptionsoptions?): ConnectorCreateResponse` **post** `/accounts/{account_id}/magic/connectors` Add a connector to your account ### Parameters - `params: ConnectorCreateParams` - `account_id: string` Path param: Account identifier - `device: Device` Body param: Exactly one of id, serial_number, or provision_license must be provided. - `id?: string` - `provision_license?: boolean` When true, create and provision a new licence key for the connector. - `serial_number?: string` - `activated?: boolean` Body param - `interrupt_window_days_of_week?: Array<"Sunday" | "Monday" | "Tuesday" | 4 more>` Body param: Allowed days of the week for upgrades. Default is all days. - `"Sunday"` - `"Monday"` - `"Tuesday"` - `"Wednesday"` - `"Thursday"` - `"Friday"` - `"Saturday"` - `interrupt_window_duration_hours?: number` Body param - `interrupt_window_embargo_dates?: Array` Body param: List of dates (YYYY-MM-DD) when upgrades are blocked. - `interrupt_window_hour_of_day?: number` Body param - `notes?: string` Body param - `timezone?: string` Body param ### Returns - `ConnectorCreateResponse` - `id: string` - `activated: boolean` - `interrupt_window_days_of_week: Array<"Sunday" | "Monday" | "Tuesday" | 4 more>` Allowed days of the week for upgrades. Default is all days. - `"Sunday"` - `"Monday"` - `"Tuesday"` - `"Wednesday"` - `"Thursday"` - `"Friday"` - `"Saturday"` - `interrupt_window_duration_hours: number` - `interrupt_window_embargo_dates: Array` List of dates (YYYY-MM-DD) when upgrades are blocked. - `interrupt_window_hour_of_day: number` - `last_updated: string` - `notes: string` - `timezone: string` - `device?: Device` - `id: string` - `serial_number?: string` - `last_heartbeat?: string` - `last_seen_version?: string` - `license_key?: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const connector = await client.magicTransit.connectors.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', device: {}, }); console.log(connector.id); ``` #### Response ```json { "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ], "result": { "id": "id", "activated": true, "interrupt_window_days_of_week": [ "Sunday" ], "interrupt_window_duration_hours": 1, "interrupt_window_embargo_dates": [ "string" ], "interrupt_window_hour_of_day": 0, "last_updated": "last_updated", "notes": "notes", "timezone": "timezone", "device": { "id": "id", "serial_number": "serial_number" }, "last_heartbeat": "last_heartbeat", "last_seen_version": "last_seen_version", "license_key": "license_key" }, "success": true } ``` ## Replace Connector or Re-provision License Key `client.magicTransit.connectors.update(stringconnectorId, ConnectorUpdateParamsparams, RequestOptionsoptions?): ConnectorUpdateResponse` **put** `/accounts/{account_id}/magic/connectors/{connector_id}` Replace Connector or Re-provision License Key ### Parameters - `connectorId: string` - `params: ConnectorUpdateParams` - `account_id: string` Path param: Account identifier - `activated?: boolean` Body param - `interrupt_window_days_of_week?: Array<"Sunday" | "Monday" | "Tuesday" | 4 more>` Body param: Allowed days of the week for upgrades. Default is all days. - `"Sunday"` - `"Monday"` - `"Tuesday"` - `"Wednesday"` - `"Thursday"` - `"Friday"` - `"Saturday"` - `interrupt_window_duration_hours?: number` Body param - `interrupt_window_embargo_dates?: Array` Body param: List of dates (YYYY-MM-DD) when upgrades are blocked. - `interrupt_window_hour_of_day?: number` Body param - `notes?: string` Body param - `provision_license?: boolean` Body param: When true, regenerate license key for the connector. - `timezone?: string` Body param ### Returns - `ConnectorUpdateResponse` - `id: string` - `activated: boolean` - `interrupt_window_days_of_week: Array<"Sunday" | "Monday" | "Tuesday" | 4 more>` Allowed days of the week for upgrades. Default is all days. - `"Sunday"` - `"Monday"` - `"Tuesday"` - `"Wednesday"` - `"Thursday"` - `"Friday"` - `"Saturday"` - `interrupt_window_duration_hours: number` - `interrupt_window_embargo_dates: Array` List of dates (YYYY-MM-DD) when upgrades are blocked. - `interrupt_window_hour_of_day: number` - `last_updated: string` - `notes: string` - `timezone: string` - `device?: Device` - `id: string` - `serial_number?: string` - `last_heartbeat?: string` - `last_seen_version?: string` - `license_key?: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const connector = await client.magicTransit.connectors.update('connector_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(connector.id); ``` #### Response ```json { "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ], "result": { "id": "id", "activated": true, "interrupt_window_days_of_week": [ "Sunday" ], "interrupt_window_duration_hours": 1, "interrupt_window_embargo_dates": [ "string" ], "interrupt_window_hour_of_day": 0, "last_updated": "last_updated", "notes": "notes", "timezone": "timezone", "device": { "id": "id", "serial_number": "serial_number" }, "last_heartbeat": "last_heartbeat", "last_seen_version": "last_seen_version", "license_key": "license_key" }, "success": true } ``` ## Edit Connector to update specific properties or Re-provision License Key `client.magicTransit.connectors.edit(stringconnectorId, ConnectorEditParamsparams, RequestOptionsoptions?): ConnectorEditResponse` **patch** `/accounts/{account_id}/magic/connectors/{connector_id}` Edit Connector to update specific properties or Re-provision License Key ### Parameters - `connectorId: string` - `params: ConnectorEditParams` - `account_id: string` Path param: Account identifier - `activated?: boolean` Body param - `interrupt_window_days_of_week?: Array<"Sunday" | "Monday" | "Tuesday" | 4 more>` Body param: Allowed days of the week for upgrades. Default is all days. - `"Sunday"` - `"Monday"` - `"Tuesday"` - `"Wednesday"` - `"Thursday"` - `"Friday"` - `"Saturday"` - `interrupt_window_duration_hours?: number` Body param - `interrupt_window_embargo_dates?: Array` Body param: List of dates (YYYY-MM-DD) when upgrades are blocked. - `interrupt_window_hour_of_day?: number` Body param - `notes?: string` Body param - `provision_license?: boolean` Body param: When true, regenerate license key for the connector. - `timezone?: string` Body param ### Returns - `ConnectorEditResponse` - `id: string` - `activated: boolean` - `interrupt_window_days_of_week: Array<"Sunday" | "Monday" | "Tuesday" | 4 more>` Allowed days of the week for upgrades. Default is all days. - `"Sunday"` - `"Monday"` - `"Tuesday"` - `"Wednesday"` - `"Thursday"` - `"Friday"` - `"Saturday"` - `interrupt_window_duration_hours: number` - `interrupt_window_embargo_dates: Array` List of dates (YYYY-MM-DD) when upgrades are blocked. - `interrupt_window_hour_of_day: number` - `last_updated: string` - `notes: string` - `timezone: string` - `device?: Device` - `id: string` - `serial_number?: string` - `last_heartbeat?: string` - `last_seen_version?: string` - `license_key?: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.magicTransit.connectors.edit('connector_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(response.id); ``` #### Response ```json { "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ], "result": { "id": "id", "activated": true, "interrupt_window_days_of_week": [ "Sunday" ], "interrupt_window_duration_hours": 1, "interrupt_window_embargo_dates": [ "string" ], "interrupt_window_hour_of_day": 0, "last_updated": "last_updated", "notes": "notes", "timezone": "timezone", "device": { "id": "id", "serial_number": "serial_number" }, "last_heartbeat": "last_heartbeat", "last_seen_version": "last_seen_version", "license_key": "license_key" }, "success": true } ``` ## Remove a connector from your account `client.magicTransit.connectors.delete(stringconnectorId, ConnectorDeleteParamsparams, RequestOptionsoptions?): ConnectorDeleteResponse` **delete** `/accounts/{account_id}/magic/connectors/{connector_id}` Remove a connector from your account ### Parameters - `connectorId: string` - `params: ConnectorDeleteParams` - `account_id: string` Account identifier ### Returns - `ConnectorDeleteResponse` - `id: string` - `activated: boolean` - `interrupt_window_days_of_week: Array<"Sunday" | "Monday" | "Tuesday" | 4 more>` Allowed days of the week for upgrades. Default is all days. - `"Sunday"` - `"Monday"` - `"Tuesday"` - `"Wednesday"` - `"Thursday"` - `"Friday"` - `"Saturday"` - `interrupt_window_duration_hours: number` - `interrupt_window_embargo_dates: Array` List of dates (YYYY-MM-DD) when upgrades are blocked. - `interrupt_window_hour_of_day: number` - `last_updated: string` - `notes: string` - `timezone: string` - `device?: Device` - `id: string` - `serial_number?: string` - `last_heartbeat?: string` - `last_seen_version?: string` - `license_key?: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const connector = await client.magicTransit.connectors.delete('connector_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(connector.id); ``` #### Response ```json { "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ], "result": { "id": "id", "activated": true, "interrupt_window_days_of_week": [ "Sunday" ], "interrupt_window_duration_hours": 1, "interrupt_window_embargo_dates": [ "string" ], "interrupt_window_hour_of_day": 0, "last_updated": "last_updated", "notes": "notes", "timezone": "timezone", "device": { "id": "id", "serial_number": "serial_number" }, "last_heartbeat": "last_heartbeat", "last_seen_version": "last_seen_version", "license_key": "license_key" }, "success": true } ``` ## Domain Types ### Connector List Response - `ConnectorListResponse` - `id: string` - `activated: boolean` - `interrupt_window_days_of_week: Array<"Sunday" | "Monday" | "Tuesday" | 4 more>` Allowed days of the week for upgrades. Default is all days. - `"Sunday"` - `"Monday"` - `"Tuesday"` - `"Wednesday"` - `"Thursday"` - `"Friday"` - `"Saturday"` - `interrupt_window_duration_hours: number` - `interrupt_window_embargo_dates: Array` List of dates (YYYY-MM-DD) when upgrades are blocked. - `interrupt_window_hour_of_day: number` - `last_updated: string` - `notes: string` - `timezone: string` - `device?: Device` - `id: string` - `serial_number?: string` - `last_heartbeat?: string` - `last_seen_version?: string` - `license_key?: string` ### Connector Get Response - `ConnectorGetResponse` - `id: string` - `activated: boolean` - `interrupt_window_days_of_week: Array<"Sunday" | "Monday" | "Tuesday" | 4 more>` Allowed days of the week for upgrades. Default is all days. - `"Sunday"` - `"Monday"` - `"Tuesday"` - `"Wednesday"` - `"Thursday"` - `"Friday"` - `"Saturday"` - `interrupt_window_duration_hours: number` - `interrupt_window_embargo_dates: Array` List of dates (YYYY-MM-DD) when upgrades are blocked. - `interrupt_window_hour_of_day: number` - `last_updated: string` - `notes: string` - `timezone: string` - `device?: Device` - `id: string` - `serial_number?: string` - `last_heartbeat?: string` - `last_seen_version?: string` - `license_key?: string` ### Connector Create Response - `ConnectorCreateResponse` - `id: string` - `activated: boolean` - `interrupt_window_days_of_week: Array<"Sunday" | "Monday" | "Tuesday" | 4 more>` Allowed days of the week for upgrades. Default is all days. - `"Sunday"` - `"Monday"` - `"Tuesday"` - `"Wednesday"` - `"Thursday"` - `"Friday"` - `"Saturday"` - `interrupt_window_duration_hours: number` - `interrupt_window_embargo_dates: Array` List of dates (YYYY-MM-DD) when upgrades are blocked. - `interrupt_window_hour_of_day: number` - `last_updated: string` - `notes: string` - `timezone: string` - `device?: Device` - `id: string` - `serial_number?: string` - `last_heartbeat?: string` - `last_seen_version?: string` - `license_key?: string` ### Connector Update Response - `ConnectorUpdateResponse` - `id: string` - `activated: boolean` - `interrupt_window_days_of_week: Array<"Sunday" | "Monday" | "Tuesday" | 4 more>` Allowed days of the week for upgrades. Default is all days. - `"Sunday"` - `"Monday"` - `"Tuesday"` - `"Wednesday"` - `"Thursday"` - `"Friday"` - `"Saturday"` - `interrupt_window_duration_hours: number` - `interrupt_window_embargo_dates: Array` List of dates (YYYY-MM-DD) when upgrades are blocked. - `interrupt_window_hour_of_day: number` - `last_updated: string` - `notes: string` - `timezone: string` - `device?: Device` - `id: string` - `serial_number?: string` - `last_heartbeat?: string` - `last_seen_version?: string` - `license_key?: string` ### Connector Edit Response - `ConnectorEditResponse` - `id: string` - `activated: boolean` - `interrupt_window_days_of_week: Array<"Sunday" | "Monday" | "Tuesday" | 4 more>` Allowed days of the week for upgrades. Default is all days. - `"Sunday"` - `"Monday"` - `"Tuesday"` - `"Wednesday"` - `"Thursday"` - `"Friday"` - `"Saturday"` - `interrupt_window_duration_hours: number` - `interrupt_window_embargo_dates: Array` List of dates (YYYY-MM-DD) when upgrades are blocked. - `interrupt_window_hour_of_day: number` - `last_updated: string` - `notes: string` - `timezone: string` - `device?: Device` - `id: string` - `serial_number?: string` - `last_heartbeat?: string` - `last_seen_version?: string` - `license_key?: string` ### Connector Delete Response - `ConnectorDeleteResponse` - `id: string` - `activated: boolean` - `interrupt_window_days_of_week: Array<"Sunday" | "Monday" | "Tuesday" | 4 more>` Allowed days of the week for upgrades. Default is all days. - `"Sunday"` - `"Monday"` - `"Tuesday"` - `"Wednesday"` - `"Thursday"` - `"Friday"` - `"Saturday"` - `interrupt_window_duration_hours: number` - `interrupt_window_embargo_dates: Array` List of dates (YYYY-MM-DD) when upgrades are blocked. - `interrupt_window_hour_of_day: number` - `last_updated: string` - `notes: string` - `timezone: string` - `device?: Device` - `id: string` - `serial_number?: string` - `last_heartbeat?: string` - `last_seen_version?: string` - `license_key?: string` # Events ## List Events `client.magicTransit.connectors.events.list(stringconnectorId, EventListParamsparams, RequestOptionsoptions?): EventListResponse` **get** `/accounts/{account_id}/magic/connectors/{connector_id}/telemetry/events` List Events ### Parameters - `connectorId: string` - `params: EventListParams` - `account_id: string` Path param: Account identifier - `from: number` Query param - `to: number` Query param - `cursor?: string` Query param - `k?: string` Query param: Filter by event kind - `limit?: number` Query param ### Returns - `EventListResponse` - `count: number` - `items: Array` - `a: number` Time the Event was collected (seconds since the Unix epoch) - `k: string` Kind - `n: number` Sequence number, used to order events with the same timestamp - `t: number` Time the Event was recorded (seconds since the Unix epoch) - `cursor?: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const events = await client.magicTransit.connectors.events.list('connector_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', from: 0, to: 0, }); console.log(events.count); ``` #### Response ```json { "result": { "count": 0, "items": [ { "a": 0, "k": "k", "n": 0, "t": 0 } ], "cursor": "cursor" }, "success": true, "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ] } ``` ## Get Event `client.magicTransit.connectors.events.get(stringconnectorId, numbereventT, numbereventN, EventGetParamsparams, RequestOptionsoptions?): EventGetResponse` **get** `/accounts/{account_id}/magic/connectors/{connector_id}/telemetry/events/{event_t}.{event_n}` Get Event ### Parameters - `connectorId: string` - `eventT: number` - `eventN: number` - `params: EventGetParams` - `account_id: string` Account identifier ### Returns - `EventGetResponse` Recorded Event - `e: Init | Leave | StartAttestation | 13 more` - `Init` - `k: "Init"` Initialized process - `"Init"` - `Leave` - `k: "Leave"` Stopped process - `"Leave"` - `StartAttestation` - `k: "StartAttestation"` Started attestation - `"StartAttestation"` - `FinishAttestationSuccess` - `k: "FinishAttestationSuccess"` Finished attestation - `"FinishAttestationSuccess"` - `FinishAttestationFailure` - `k: "FinishAttestationFailure"` Failed attestation - `"FinishAttestationFailure"` - `StartRotateCryptKey` - `k: "StartRotateCryptKey"` Started crypt key rotation - `"StartRotateCryptKey"` - `FinishRotateCryptKeySuccess` - `k: "FinishRotateCryptKeySuccess"` Finished crypt key rotation - `"FinishRotateCryptKeySuccess"` - `FinishRotateCryptKeyFailure` - `k: "FinishRotateCryptKeyFailure"` Failed crypt key rotation - `"FinishRotateCryptKeyFailure"` - `StartRotatePki` - `k: "StartRotatePki"` Started PKI rotation - `"StartRotatePki"` - `FinishRotatePkiSuccess` - `k: "FinishRotatePkiSuccess"` Finished PKI rotation - `"FinishRotatePkiSuccess"` - `FinishRotatePkiFailure` - `k: "FinishRotatePkiFailure"` Failed PKI rotation - `"FinishRotatePkiFailure"` - `StartUpgrade` - `k: "StartUpgrade"` Started upgrade - `"StartUpgrade"` - `url: string` Location of upgrade bundle - `FinishUpgradeSuccess` - `k: "FinishUpgradeSuccess"` Finished upgrade - `"FinishUpgradeSuccess"` - `FinishUpgradeFailure` - `k: "FinishUpgradeFailure"` Failed upgrade - `"FinishUpgradeFailure"` - `Reconcile` - `k: "Reconcile"` Reconciled - `"Reconcile"` - `ConfigureCloudflaredTunnel` - `k: "ConfigureCloudflaredTunnel"` Configured Cloudflared tunnel - `"ConfigureCloudflaredTunnel"` - `n: number` Sequence number, used to order events with the same timestamp - `t: number` Time the Event was recorded (seconds since the Unix epoch) - `v?: string` Version ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const event = await client.magicTransit.connectors.events.get('connector_id', 0, 0, { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(event.e); ``` #### Response ```json { "result": { "e": { "k": "Init" }, "n": 0, "t": 0, "v": "v" }, "success": true, "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ] } ``` ## Domain Types ### Event List Response - `EventListResponse` - `count: number` - `items: Array` - `a: number` Time the Event was collected (seconds since the Unix epoch) - `k: string` Kind - `n: number` Sequence number, used to order events with the same timestamp - `t: number` Time the Event was recorded (seconds since the Unix epoch) - `cursor?: string` ### Event Get Response - `EventGetResponse` Recorded Event - `e: Init | Leave | StartAttestation | 13 more` - `Init` - `k: "Init"` Initialized process - `"Init"` - `Leave` - `k: "Leave"` Stopped process - `"Leave"` - `StartAttestation` - `k: "StartAttestation"` Started attestation - `"StartAttestation"` - `FinishAttestationSuccess` - `k: "FinishAttestationSuccess"` Finished attestation - `"FinishAttestationSuccess"` - `FinishAttestationFailure` - `k: "FinishAttestationFailure"` Failed attestation - `"FinishAttestationFailure"` - `StartRotateCryptKey` - `k: "StartRotateCryptKey"` Started crypt key rotation - `"StartRotateCryptKey"` - `FinishRotateCryptKeySuccess` - `k: "FinishRotateCryptKeySuccess"` Finished crypt key rotation - `"FinishRotateCryptKeySuccess"` - `FinishRotateCryptKeyFailure` - `k: "FinishRotateCryptKeyFailure"` Failed crypt key rotation - `"FinishRotateCryptKeyFailure"` - `StartRotatePki` - `k: "StartRotatePki"` Started PKI rotation - `"StartRotatePki"` - `FinishRotatePkiSuccess` - `k: "FinishRotatePkiSuccess"` Finished PKI rotation - `"FinishRotatePkiSuccess"` - `FinishRotatePkiFailure` - `k: "FinishRotatePkiFailure"` Failed PKI rotation - `"FinishRotatePkiFailure"` - `StartUpgrade` - `k: "StartUpgrade"` Started upgrade - `"StartUpgrade"` - `url: string` Location of upgrade bundle - `FinishUpgradeSuccess` - `k: "FinishUpgradeSuccess"` Finished upgrade - `"FinishUpgradeSuccess"` - `FinishUpgradeFailure` - `k: "FinishUpgradeFailure"` Failed upgrade - `"FinishUpgradeFailure"` - `Reconcile` - `k: "Reconcile"` Reconciled - `"Reconcile"` - `ConfigureCloudflaredTunnel` - `k: "ConfigureCloudflaredTunnel"` Configured Cloudflared tunnel - `"ConfigureCloudflaredTunnel"` - `n: number` Sequence number, used to order events with the same timestamp - `t: number` Time the Event was recorded (seconds since the Unix epoch) - `v?: string` Version # Latest ## Get latest Events `client.magicTransit.connectors.events.latest.list(stringconnectorId, LatestListParamsparams, RequestOptionsoptions?): LatestListResponse` **get** `/accounts/{account_id}/magic/connectors/{connector_id}/telemetry/events/latest` Get latest Events ### Parameters - `connectorId: string` - `params: LatestListParams` - `account_id: string` Account identifier ### Returns - `LatestListResponse` - `count: number` - `items: Array` - `e: Init | Leave | StartAttestation | 13 more` - `Init` - `k: "Init"` Initialized process - `"Init"` - `Leave` - `k: "Leave"` Stopped process - `"Leave"` - `StartAttestation` - `k: "StartAttestation"` Started attestation - `"StartAttestation"` - `FinishAttestationSuccess` - `k: "FinishAttestationSuccess"` Finished attestation - `"FinishAttestationSuccess"` - `FinishAttestationFailure` - `k: "FinishAttestationFailure"` Failed attestation - `"FinishAttestationFailure"` - `StartRotateCryptKey` - `k: "StartRotateCryptKey"` Started crypt key rotation - `"StartRotateCryptKey"` - `FinishRotateCryptKeySuccess` - `k: "FinishRotateCryptKeySuccess"` Finished crypt key rotation - `"FinishRotateCryptKeySuccess"` - `FinishRotateCryptKeyFailure` - `k: "FinishRotateCryptKeyFailure"` Failed crypt key rotation - `"FinishRotateCryptKeyFailure"` - `StartRotatePki` - `k: "StartRotatePki"` Started PKI rotation - `"StartRotatePki"` - `FinishRotatePkiSuccess` - `k: "FinishRotatePkiSuccess"` Finished PKI rotation - `"FinishRotatePkiSuccess"` - `FinishRotatePkiFailure` - `k: "FinishRotatePkiFailure"` Failed PKI rotation - `"FinishRotatePkiFailure"` - `StartUpgrade` - `k: "StartUpgrade"` Started upgrade - `"StartUpgrade"` - `url: string` Location of upgrade bundle - `FinishUpgradeSuccess` - `k: "FinishUpgradeSuccess"` Finished upgrade - `"FinishUpgradeSuccess"` - `FinishUpgradeFailure` - `k: "FinishUpgradeFailure"` Failed upgrade - `"FinishUpgradeFailure"` - `Reconcile` - `k: "Reconcile"` Reconciled - `"Reconcile"` - `ConfigureCloudflaredTunnel` - `k: "ConfigureCloudflaredTunnel"` Configured Cloudflared tunnel - `"ConfigureCloudflaredTunnel"` - `n: number` Sequence number, used to order events with the same timestamp - `t: number` Time the Event was recorded (seconds since the Unix epoch) - `v?: string` Version ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const latests = await client.magicTransit.connectors.events.latest.list('connector_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(latests.count); ``` #### Response ```json { "result": { "count": 0, "items": [ { "e": { "k": "Init" }, "n": 0, "t": 0, "v": "v" } ] }, "success": true, "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ] } ``` ## Domain Types ### Latest List Response - `LatestListResponse` - `count: number` - `items: Array` - `e: Init | Leave | StartAttestation | 13 more` - `Init` - `k: "Init"` Initialized process - `"Init"` - `Leave` - `k: "Leave"` Stopped process - `"Leave"` - `StartAttestation` - `k: "StartAttestation"` Started attestation - `"StartAttestation"` - `FinishAttestationSuccess` - `k: "FinishAttestationSuccess"` Finished attestation - `"FinishAttestationSuccess"` - `FinishAttestationFailure` - `k: "FinishAttestationFailure"` Failed attestation - `"FinishAttestationFailure"` - `StartRotateCryptKey` - `k: "StartRotateCryptKey"` Started crypt key rotation - `"StartRotateCryptKey"` - `FinishRotateCryptKeySuccess` - `k: "FinishRotateCryptKeySuccess"` Finished crypt key rotation - `"FinishRotateCryptKeySuccess"` - `FinishRotateCryptKeyFailure` - `k: "FinishRotateCryptKeyFailure"` Failed crypt key rotation - `"FinishRotateCryptKeyFailure"` - `StartRotatePki` - `k: "StartRotatePki"` Started PKI rotation - `"StartRotatePki"` - `FinishRotatePkiSuccess` - `k: "FinishRotatePkiSuccess"` Finished PKI rotation - `"FinishRotatePkiSuccess"` - `FinishRotatePkiFailure` - `k: "FinishRotatePkiFailure"` Failed PKI rotation - `"FinishRotatePkiFailure"` - `StartUpgrade` - `k: "StartUpgrade"` Started upgrade - `"StartUpgrade"` - `url: string` Location of upgrade bundle - `FinishUpgradeSuccess` - `k: "FinishUpgradeSuccess"` Finished upgrade - `"FinishUpgradeSuccess"` - `FinishUpgradeFailure` - `k: "FinishUpgradeFailure"` Failed upgrade - `"FinishUpgradeFailure"` - `Reconcile` - `k: "Reconcile"` Reconciled - `"Reconcile"` - `ConfigureCloudflaredTunnel` - `k: "ConfigureCloudflaredTunnel"` Configured Cloudflared tunnel - `"ConfigureCloudflaredTunnel"` - `n: number` Sequence number, used to order events with the same timestamp - `t: number` Time the Event was recorded (seconds since the Unix epoch) - `v?: string` Version # Snapshots ## List Snapshots `client.magicTransit.connectors.snapshots.list(stringconnectorId, SnapshotListParamsparams, RequestOptionsoptions?): SnapshotListResponse` **get** `/accounts/{account_id}/magic/connectors/{connector_id}/telemetry/snapshots` List Snapshots ### Parameters - `connectorId: string` - `params: SnapshotListParams` - `account_id: string` Path param: Account identifier - `from: number` Query param - `to: number` Query param - `cursor?: string` Query param - `limit?: number` Query param ### Returns - `SnapshotListResponse` - `count: number` - `items: Array` - `a: number` Time the Snapshot was collected (seconds since the Unix epoch) - `t: number` Time the Snapshot was recorded (seconds since the Unix epoch) - `cursor?: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const snapshots = await client.magicTransit.connectors.snapshots.list('connector_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', from: 0, to: 0, }); console.log(snapshots.count); ``` #### Response ```json { "result": { "count": 0, "items": [ { "a": 0, "t": 0 } ], "cursor": "cursor" }, "success": true, "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ] } ``` ## Get Snapshot `client.magicTransit.connectors.snapshots.get(stringconnectorId, numbersnapshotT, SnapshotGetParamsparams, RequestOptionsoptions?): SnapshotGetResponse` **get** `/accounts/{account_id}/magic/connectors/{connector_id}/telemetry/snapshots/{snapshot_t}` Get Snapshot ### Parameters - `connectorId: string` - `snapshotT: number` - `params: SnapshotGetParams` - `account_id: string` Account identifier ### Returns - `SnapshotGetResponse` Snapshot - `count_reclaim_failures: number` Count of failures to reclaim space - `count_reclaimed_paths: number` Count of reclaimed paths - `count_record_failed: number` Count of failed snapshot recordings - `count_transmit_failures: number` Count of failed snapshot transmissions - `t: number` Time the Snapshot was recorded (seconds since the Unix epoch) - `v: string` Version - `bonds?: Array` - `name: string` Name of the network interface - `status: string` Current status of the network interface - `cpu_count?: number` Count of processors/cores - `cpu_pressure_10s?: number` Percentage of time over a 10 second window that tasks were stalled - `cpu_pressure_300s?: number` Percentage of time over a 5 minute window that tasks were stalled - `cpu_pressure_60s?: number` Percentage of time over a 1 minute window that tasks were stalled - `cpu_pressure_total_us?: number` Total stall time (microseconds) - `cpu_time_guest_ms?: number` Time spent running a virtual CPU or guest OS (milliseconds) - `cpu_time_guest_nice_ms?: number` Time spent running a niced guest (milliseconds) - `cpu_time_idle_ms?: number` Time spent in idle state (milliseconds) - `cpu_time_iowait_ms?: number` Time spent wait for I/O to complete (milliseconds) - `cpu_time_irq_ms?: number` Time spent servicing interrupts (milliseconds) - `cpu_time_nice_ms?: number` Time spent in low-priority user mode (milliseconds) - `cpu_time_softirq_ms?: number` Time spent servicing softirqs (milliseconds) - `cpu_time_steal_ms?: number` Time stolen (milliseconds) - `cpu_time_system_ms?: number` Time spent in system mode (milliseconds) - `cpu_time_user_ms?: number` Time spent in user mode (milliseconds) - `delta?: number` Number of network operations applied during state transition - `dhcp_leases?: Array` - `client_id: string` Client ID of the device the IP Address was leased to - `expiry_time: number` Expiry time of the DHCP lease (seconds since the Unix epoch) - `hostname: string` Hostname of the device the IP Address was leased to - `interface_name: string` Name of the network interface - `ip_address: string` IP Address that was leased - `mac_address: string` MAC Address of the device the IP Address was leased to - `disks?: Array` - `in_progress: number` I/Os currently in progress - `major: number` Device major number - `merged: number` Reads merged - `minor: number` Device minor number - `name: string` Device name - `reads: number` Reads completed successfully - `sectors_read: number` Sectors read successfully - `sectors_written: number` Sectors written successfully - `time_in_progress_ms: number` Time spent doing I/Os (milliseconds) - `time_reading_ms: number` Time spent reading (milliseconds) - `time_writing_ms: number` Time spent writing (milliseconds) - `weighted_time_in_progress_ms: number` Weighted time spent doing I/Os (milliseconds) - `writes: number` Writes completed - `writes_merged: number` Writes merged - `discards?: number` Discards completed successfully - `discards_merged?: number` Discards merged - `flushes?: number` Flushes completed successfully - `sectors_discarded?: number` Sectors discarded - `time_discarding_ms?: number` Time spent discarding (milliseconds) - `time_flushing_ms?: number` Time spent flushing (milliseconds) - `epsilon?: number` Simulated number of network operations applied during state transition - `ha_state?: string` Name of high availability state - `ha_value?: number` Numeric value associated with high availability state (0 = disabled, 1 = active, 2 = standby, 3 = stopped, 4 = fault) - `interfaces?: Array` - `name: string` Name of the network interface - `operstate: string` UP/DOWN state of the network interface - `ip_addresses?: Array` - `interface_name: string` Name of the network interface - `ip_address: string` IP address of the network interface - `speed?: number` Speed of the network interface (bits per second) - `io_pressure_full_10s?: number` Percentage of time over a 10 second window that all tasks were stalled - `io_pressure_full_300s?: number` Percentage of time over a 5 minute window that all tasks were stalled - `io_pressure_full_60s?: number` Percentage of time over a 1 minute window that all tasks were stalled - `io_pressure_full_total_us?: number` Total stall time (microseconds) - `io_pressure_some_10s?: number` Percentage of time over a 10 second window that some tasks were stalled - `io_pressure_some_300s?: number` Percentage of time over a 3 minute window that some tasks were stalled - `io_pressure_some_60s?: number` Percentage of time over a 1 minute window that some tasks were stalled - `io_pressure_some_total_us?: number` Total stall time (microseconds) - `kernel_btime?: number` Boot time (seconds since Unix epoch) - `kernel_ctxt?: number` Number of context switches that the system underwent - `kernel_processes?: number` Number of forks since boot - `kernel_processes_blocked?: number` Number of processes blocked waiting for I/O - `kernel_processes_running?: number` Number of processes in runnable state - `load_average_15m?: number` The fifteen-minute load average - `load_average_1m?: number` The one-minute load average - `load_average_5m?: number` The five-minute load average - `load_average_cur?: number` Number of currently runnable kernel scheduling entities - `load_average_max?: number` Number of kernel scheduling entities that currently exist on the system - `memory_active_bytes?: number` Memory that has been used more recently - `memory_anon_hugepages_bytes?: number` Non-file backed huge pages mapped into user-space page tables - `memory_anon_pages_bytes?: number` Non-file backed pages mapped into user-space page tables - `memory_available_bytes?: number` Estimate of how much memory is available for starting new applications - `memory_bounce_bytes?: number` Memory used for block device bounce buffers - `memory_buffers_bytes?: number` Relatively temporary storage for raw disk blocks - `memory_cached_bytes?: number` In-memory cache for files read from the disk - `memory_cma_free_bytes?: number` Free CMA (Contiguous Memory Allocator) pages - `memory_cma_total_bytes?: number` Total CMA (Contiguous Memory Allocator) pages - `memory_commit_limit_bytes?: number` Total amount of memory currently available to be allocated on the system - `memory_committed_as_bytes?: number` Amount of memory presently allocated on the system - `memory_dirty_bytes?: number` Memory which is waiting to get written back to the disk - `memory_free_bytes?: number` The sum of LowFree and HighFree - `memory_high_free_bytes?: number` Amount of free highmem - `memory_high_total_bytes?: number` Total amount of highmem - `memory_hugepages_free?: number` The number of huge pages in the pool that are not yet allocated - `memory_hugepages_rsvd?: number` Number of huge pages for which a commitment has been made, but no allocation has yet been made - `memory_hugepages_surp?: number` Number of huge pages in the pool above the threshold - `memory_hugepages_total?: number` The size of the pool of huge pages - `memory_hugepagesize_bytes?: number` The size of huge pages - `memory_inactive_bytes?: number` Memory which has been less recently used - `memory_k_reclaimable_bytes?: number` Kernel allocations that the kernel will attempt to reclaim under memory pressure - `memory_kernel_stack_bytes?: number` Amount of memory allocated to kernel stacks - `memory_low_free_bytes?: number` Amount of free lowmem - `memory_low_total_bytes?: number` Total amount of lowmem - `memory_mapped_bytes?: number` Files which have been mapped into memory - `memory_page_tables_bytes?: number` Amount of memory dedicated to the lowest level of page tables - `memory_per_cpu_bytes?: number` Memory allocated to the per-cpu alloctor used to back per-cpu allocations - `memory_pressure_full_10s?: number` Percentage of time over a 10 second window that all tasks were stalled - `memory_pressure_full_300s?: number` Percentage of time over a 5 minute window that all tasks were stalled - `memory_pressure_full_60s?: number` Percentage of time over a 1 minute window that all tasks were stalled - `memory_pressure_full_total_us?: number` Total stall time (microseconds) - `memory_pressure_some_10s?: number` Percentage of time over a 10 second window that some tasks were stalled - `memory_pressure_some_300s?: number` Percentage of time over a 5 minute window that some tasks were stalled - `memory_pressure_some_60s?: number` Percentage of time over a 1 minute window that some tasks were stalled - `memory_pressure_some_total_us?: number` Total stall time (microseconds) - `memory_s_reclaimable_bytes?: number` Part of slab that can be reclaimed on memory pressure - `memory_s_unreclaim_bytes?: number` Part of slab that cannot be reclaimed on memory pressure - `memory_secondary_page_tables_bytes?: number` Amount of memory dedicated to the lowest level of page tables - `memory_shmem_bytes?: number` Amount of memory consumed by tmpfs - `memory_shmem_hugepages_bytes?: number` Memory used by shmem and tmpfs, allocated with huge pages - `memory_shmem_pmd_mapped_bytes?: number` Shared memory mapped into user space with huge pages - `memory_slab_bytes?: number` In-kernel data structures cache - `memory_swap_cached_bytes?: number` Memory swapped out and back in while still in swap file - `memory_swap_free_bytes?: number` Amount of swap space that is currently unused - `memory_swap_total_bytes?: number` Total amount of swap space available - `memory_total_bytes?: number` Total usable RAM - `memory_vmalloc_chunk_bytes?: number` Largest contiguous block of vmalloc area which is free - `memory_vmalloc_total_bytes?: number` Total size of vmalloc memory area - `memory_vmalloc_used_bytes?: number` Amount of vmalloc area which is used - `memory_writeback_bytes?: number` Memory which is actively being written back to the disk - `memory_writeback_tmp_bytes?: number` Memory used by FUSE for temporary writeback buffers - `memory_z_swap_bytes?: number` Memory consumed by the zswap backend, compressed - `memory_z_swapped_bytes?: number` Amount of anonymous memory stored in zswap, uncompressed - `mounts?: Array` - `file_system: string` File system on disk (EXT4, NTFS, etc.) - `kind: string` Kind of disk (HDD, SSD, etc.) - `mount_point: string` Path where disk is mounted - `name: string` Name of the disk mount - `available_bytes?: number` Available disk size (bytes) - `is_read_only?: boolean` Determines whether the disk is read-only - `is_removable?: boolean` Determines whether the disk is removable - `total_bytes?: number` Total disk size (bytes) - `netdevs?: Array` - `name: string` Name of the network device - `recv_bytes: number` Total bytes received - `recv_compressed: number` Compressed packets received - `recv_drop: number` Packets dropped - `recv_errs: number` Bad packets received - `recv_fifo: number` FIFO overruns - `recv_frame: number` Frame alignment errors - `recv_multicast: number` Multicast packets received - `recv_packets: number` Total packets received - `sent_bytes: number` Total bytes transmitted - `sent_carrier: number` Number of packets not sent due to carrier errors - `sent_colls: number` Number of collisions - `sent_compressed: number` Number of compressed packets transmitted - `sent_drop: number` Number of packets dropped during transmission - `sent_errs: number` Number of transmission errors - `sent_fifo: number` FIFO overruns - `sent_packets: number` Total packets transmitted - `snmp_icmp_in_addr_mask_reps?: number` Number of ICMP Address Mask Reply messages received - `snmp_icmp_in_addr_masks?: number` Number of ICMP Address Mask Request messages received - `snmp_icmp_in_csum_errors?: number` Number of ICMP messages received with bad checksums - `snmp_icmp_in_dest_unreachs?: number` Number of ICMP Destination Unreachable messages received - `snmp_icmp_in_echo_reps?: number` Number of ICMP Echo Reply messages received - `snmp_icmp_in_echos?: number` Number of ICMP Echo (request) messages received - `snmp_icmp_in_errors?: number` Number of ICMP messages received with ICMP-specific errors - `snmp_icmp_in_msgs?: number` Number of ICMP messages received - `snmp_icmp_in_parm_probs?: number` Number of ICMP Parameter Problem messages received - `snmp_icmp_in_redirects?: number` Number of ICMP Redirect messages received - `snmp_icmp_in_src_quenchs?: number` Number of ICMP Source Quench messages received - `snmp_icmp_in_time_excds?: number` Number of ICMP Time Exceeded messages received - `snmp_icmp_in_timestamp_reps?: number` Number of ICMP Address Mask Request messages received - `snmp_icmp_in_timestamps?: number` Number of ICMP Timestamp (request) messages received - `snmp_icmp_out_addr_mask_reps?: number` Number of ICMP Address Mask Reply messages sent - `snmp_icmp_out_addr_masks?: number` Number of ICMP Address Mask Request messages sent - `snmp_icmp_out_dest_unreachs?: number` Number of ICMP Destination Unreachable messages sent - `snmp_icmp_out_echo_reps?: number` Number of ICMP Echo Reply messages sent - `snmp_icmp_out_echos?: number` Number of ICMP Echo (request) messages sent - `snmp_icmp_out_errors?: number` Number of ICMP messages which this entity did not send due to ICMP-specific errors - `snmp_icmp_out_msgs?: number` Number of ICMP messages attempted to send - `snmp_icmp_out_parm_probs?: number` Number of ICMP Parameter Problem messages sent - `snmp_icmp_out_redirects?: number` Number of ICMP Redirect messages sent - `snmp_icmp_out_src_quenchs?: number` Number of ICMP Source Quench messages sent - `snmp_icmp_out_time_excds?: number` Number of ICMP Time Exceeded messages sent - `snmp_icmp_out_timestamp_reps?: number` Number of ICMP Timestamp Reply messages sent - `snmp_icmp_out_timestamps?: number` Number of ICMP Timestamp (request) messages sent - `snmp_ip_default_ttl?: number` Default value of the Time-To-Live field of the IP header - `snmp_ip_forw_datagrams?: number` Number of datagrams forwarded to their final destination - `snmp_ip_forwarding_enabled?: boolean` Set when acting as an IP gateway - `snmp_ip_frag_creates?: number` Number of datagrams generated by fragmentation - `snmp_ip_frag_fails?: number` Number of datagrams discarded because fragmentation failed - `snmp_ip_frag_oks?: number` Number of datagrams successfully fragmented - `snmp_ip_in_addr_errors?: number` Number of input datagrams discarded due to errors in the IP address - `snmp_ip_in_delivers?: number` Number of input datagrams successfully delivered to IP user-protocols - `snmp_ip_in_discards?: number` Number of input datagrams otherwise discarded - `snmp_ip_in_hdr_errors?: number` Number of input datagrams discarded due to errors in the IP header - `snmp_ip_in_receives?: number` Number of input datagrams received from interfaces - `snmp_ip_in_unknown_protos?: number` Number of input datagrams discarded due unknown or unsupported protocol - `snmp_ip_out_discards?: number` Number of output datagrams otherwise discarded - `snmp_ip_out_no_routes?: number` Number of output datagrams discarded because no route matched - `snmp_ip_out_requests?: number` Number of datagrams supplied for transmission - `snmp_ip_reasm_fails?: number` Number of failures detected by the reassembly algorithm - `snmp_ip_reasm_oks?: number` Number of datagrams successfully reassembled - `snmp_ip_reasm_reqds?: number` Number of fragments received which needed to be reassembled - `snmp_ip_reasm_timeout?: number` Number of seconds fragments are held while awaiting reassembly - `snmp_tcp_active_opens?: number` Number of times TCP transitions to SYN-SENT from CLOSED - `snmp_tcp_attempt_fails?: number` Number of times TCP transitions to CLOSED from SYN-SENT or SYN-RCVD, plus transitions to LISTEN from SYN-RCVD - `snmp_tcp_curr_estab?: number` Number of TCP connections in ESTABLISHED or CLOSE-WAIT - `snmp_tcp_estab_resets?: number` Number of times TCP transitions to CLOSED from ESTABLISHED or CLOSE-WAIT - `snmp_tcp_in_csum_errors?: number` Number of TCP segments received with checksum errors - `snmp_tcp_in_errs?: number` Number of TCP segments received in error - `snmp_tcp_in_segs?: number` Number of TCP segments received - `snmp_tcp_max_conn?: number` Limit on the total number of TCP connections - `snmp_tcp_out_rsts?: number` Number of TCP segments sent with RST flag - `snmp_tcp_out_segs?: number` Number of TCP segments sent - `snmp_tcp_passive_opens?: number` Number of times TCP transitions to SYN-RCVD from LISTEN - `snmp_tcp_retrans_segs?: number` Number of TCP segments retransmitted - `snmp_tcp_rto_max?: number` Maximum value permitted by a TCP implementation for the retransmission timeout (milliseconds) - `snmp_tcp_rto_min?: number` Minimum value permitted by a TCP implementation for the retransmission timeout (milliseconds) - `snmp_udp_in_datagrams?: number` Number of UDP datagrams delivered to UDP applications - `snmp_udp_in_errors?: number` Number of UDP datagrams failed to be delivered for reasons other than lack of application at the destination port - `snmp_udp_no_ports?: number` Number of UDP datagrams received for which there was not application at the destination port - `snmp_udp_out_datagrams?: number` Number of UDP datagrams sent - `system_boot_time_s?: number` Boottime of the system (seconds since the Unix epoch) - `thermals?: Array` - `label: string` Sensor identifier for the component - `critical_celcius?: number` Critical failure temperature of the component (degrees Celsius) - `current_celcius?: number` Current temperature of the component (degrees Celsius) - `max_celcius?: number` Maximum temperature of the component (degrees Celsius) - `tunnels?: Array` - `health_state: string` Name of tunnel health state (unknown, healthy, degraded, down) - `health_value: number` Numeric value associated with tunnel state (0 = unknown, 1 = healthy, 2 = degraded, 3 = down) - `interface_name: string` The tunnel interface name (i.e. xfrm1, xfrm3.99, etc.) - `tunnel_id: string` Tunnel identifier - `probed_mtu?: number` MTU as measured between the two ends of the tunnel - `recent_healthy_pings?: number` Number of recent healthy pings for this tunnel - `recent_unhealthy_pings?: number` Number of recent unhealthy pings for this tunnel - `uptime_idle_ms?: number` Sum of how much time each core has spent idle - `uptime_total_ms?: number` Uptime of the system, including time spent in suspend ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const snapshot = await client.magicTransit.connectors.snapshots.get('connector_id', 0, { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(snapshot.cpu_time_idle_ms); ``` #### Response ```json { "result": { "count_reclaim_failures": 0, "count_reclaimed_paths": 0, "count_record_failed": 0, "count_transmit_failures": 0, "t": 0, "v": "v", "bonds": [ { "name": "name", "status": "status" } ], "cpu_count": 0, "cpu_pressure_10s": 0, "cpu_pressure_300s": 0, "cpu_pressure_60s": 0, "cpu_pressure_total_us": 0, "cpu_time_guest_ms": 0, "cpu_time_guest_nice_ms": 0, "cpu_time_idle_ms": 0, "cpu_time_iowait_ms": 0, "cpu_time_irq_ms": 0, "cpu_time_nice_ms": 0, "cpu_time_softirq_ms": 0, "cpu_time_steal_ms": 0, "cpu_time_system_ms": 0, "cpu_time_user_ms": 0, "delta": 0, "dhcp_leases": [ { "client_id": "client_id", "expiry_time": 0, "hostname": "hostname", "interface_name": "interface_name", "ip_address": "ip_address", "mac_address": "mac_address" } ], "disks": [ { "in_progress": 0, "major": 0, "merged": 0, "minor": 0, "name": "name", "reads": 0, "sectors_read": 0, "sectors_written": 0, "time_in_progress_ms": 0, "time_reading_ms": 0, "time_writing_ms": 0, "weighted_time_in_progress_ms": 0, "writes": 0, "writes_merged": 0, "discards": 0, "discards_merged": 0, "flushes": 0, "sectors_discarded": 0, "time_discarding_ms": 0, "time_flushing_ms": 0 } ], "epsilon": 0, "ha_state": "ha_state", "ha_value": 0, "interfaces": [ { "name": "name", "operstate": "operstate", "ip_addresses": [ { "interface_name": "interface_name", "ip_address": "ip_address" } ], "speed": 0 } ], "io_pressure_full_10s": 0, "io_pressure_full_300s": 0, "io_pressure_full_60s": 0, "io_pressure_full_total_us": 0, "io_pressure_some_10s": 0, "io_pressure_some_300s": 0, "io_pressure_some_60s": 0, "io_pressure_some_total_us": 0, "kernel_btime": 0, "kernel_ctxt": 0, "kernel_processes": 0, "kernel_processes_blocked": 0, "kernel_processes_running": 0, "load_average_15m": 0, "load_average_1m": 0, "load_average_5m": 0, "load_average_cur": 0, "load_average_max": 0, "memory_active_bytes": 0, "memory_anon_hugepages_bytes": 0, "memory_anon_pages_bytes": 0, "memory_available_bytes": 0, "memory_bounce_bytes": 0, "memory_buffers_bytes": 0, "memory_cached_bytes": 0, "memory_cma_free_bytes": 0, "memory_cma_total_bytes": 0, "memory_commit_limit_bytes": 0, "memory_committed_as_bytes": 0, "memory_dirty_bytes": 0, "memory_free_bytes": 0, "memory_high_free_bytes": 0, "memory_high_total_bytes": 0, "memory_hugepages_free": 0, "memory_hugepages_rsvd": 0, "memory_hugepages_surp": 0, "memory_hugepages_total": 0, "memory_hugepagesize_bytes": 0, "memory_inactive_bytes": 0, "memory_k_reclaimable_bytes": 0, "memory_kernel_stack_bytes": 0, "memory_low_free_bytes": 0, "memory_low_total_bytes": 0, "memory_mapped_bytes": 0, "memory_page_tables_bytes": 0, "memory_per_cpu_bytes": 0, "memory_pressure_full_10s": 0, "memory_pressure_full_300s": 0, "memory_pressure_full_60s": 0, "memory_pressure_full_total_us": 0, "memory_pressure_some_10s": 0, "memory_pressure_some_300s": 0, "memory_pressure_some_60s": 0, "memory_pressure_some_total_us": 0, "memory_s_reclaimable_bytes": 0, "memory_s_unreclaim_bytes": 0, "memory_secondary_page_tables_bytes": 0, "memory_shmem_bytes": 0, "memory_shmem_hugepages_bytes": 0, "memory_shmem_pmd_mapped_bytes": 0, "memory_slab_bytes": 0, "memory_swap_cached_bytes": 0, "memory_swap_free_bytes": 0, "memory_swap_total_bytes": 0, "memory_total_bytes": 0, "memory_vmalloc_chunk_bytes": 0, "memory_vmalloc_total_bytes": 0, "memory_vmalloc_used_bytes": 0, "memory_writeback_bytes": 0, "memory_writeback_tmp_bytes": 0, "memory_z_swap_bytes": 0, "memory_z_swapped_bytes": 0, "mounts": [ { "file_system": "file_system", "kind": "kind", "mount_point": "mount_point", "name": "name", "available_bytes": 0, "is_read_only": true, "is_removable": true, "total_bytes": 0 } ], "netdevs": [ { "name": "name", "recv_bytes": 0, "recv_compressed": 0, "recv_drop": 0, "recv_errs": 0, "recv_fifo": 0, "recv_frame": 0, "recv_multicast": 0, "recv_packets": 0, "sent_bytes": 0, "sent_carrier": 0, "sent_colls": 0, "sent_compressed": 0, "sent_drop": 0, "sent_errs": 0, "sent_fifo": 0, "sent_packets": 0 } ], "snmp_icmp_in_addr_mask_reps": 0, "snmp_icmp_in_addr_masks": 0, "snmp_icmp_in_csum_errors": 0, "snmp_icmp_in_dest_unreachs": 0, "snmp_icmp_in_echo_reps": 0, "snmp_icmp_in_echos": 0, "snmp_icmp_in_errors": 0, "snmp_icmp_in_msgs": 0, "snmp_icmp_in_parm_probs": 0, "snmp_icmp_in_redirects": 0, "snmp_icmp_in_src_quenchs": 0, "snmp_icmp_in_time_excds": 0, "snmp_icmp_in_timestamp_reps": 0, "snmp_icmp_in_timestamps": 0, "snmp_icmp_out_addr_mask_reps": 0, "snmp_icmp_out_addr_masks": 0, "snmp_icmp_out_dest_unreachs": 0, "snmp_icmp_out_echo_reps": 0, "snmp_icmp_out_echos": 0, "snmp_icmp_out_errors": 0, "snmp_icmp_out_msgs": 0, "snmp_icmp_out_parm_probs": 0, "snmp_icmp_out_redirects": 0, "snmp_icmp_out_src_quenchs": 0, "snmp_icmp_out_time_excds": 0, "snmp_icmp_out_timestamp_reps": 0, "snmp_icmp_out_timestamps": 0, "snmp_ip_default_ttl": 0, "snmp_ip_forw_datagrams": 0, "snmp_ip_forwarding_enabled": true, "snmp_ip_frag_creates": 0, "snmp_ip_frag_fails": 0, "snmp_ip_frag_oks": 0, "snmp_ip_in_addr_errors": 0, "snmp_ip_in_delivers": 0, "snmp_ip_in_discards": 0, "snmp_ip_in_hdr_errors": 0, "snmp_ip_in_receives": 0, "snmp_ip_in_unknown_protos": 0, "snmp_ip_out_discards": 0, "snmp_ip_out_no_routes": 0, "snmp_ip_out_requests": 0, "snmp_ip_reasm_fails": 0, "snmp_ip_reasm_oks": 0, "snmp_ip_reasm_reqds": 0, "snmp_ip_reasm_timeout": 0, "snmp_tcp_active_opens": 0, "snmp_tcp_attempt_fails": 0, "snmp_tcp_curr_estab": 0, "snmp_tcp_estab_resets": 0, "snmp_tcp_in_csum_errors": 0, "snmp_tcp_in_errs": 0, "snmp_tcp_in_segs": 0, "snmp_tcp_max_conn": 0, "snmp_tcp_out_rsts": 0, "snmp_tcp_out_segs": 0, "snmp_tcp_passive_opens": 0, "snmp_tcp_retrans_segs": 0, "snmp_tcp_rto_max": 0, "snmp_tcp_rto_min": 0, "snmp_udp_in_datagrams": 0, "snmp_udp_in_errors": 0, "snmp_udp_no_ports": 0, "snmp_udp_out_datagrams": 0, "system_boot_time_s": 0, "thermals": [ { "label": "label", "critical_celcius": 0, "current_celcius": 0, "max_celcius": 0 } ], "tunnels": [ { "health_state": "health_state", "health_value": 0, "interface_name": "interface_name", "tunnel_id": "tunnel_id", "probed_mtu": 0, "recent_healthy_pings": 0, "recent_unhealthy_pings": 0 } ], "uptime_idle_ms": 0, "uptime_total_ms": 0 }, "success": true, "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ] } ``` ## Domain Types ### Snapshot List Response - `SnapshotListResponse` - `count: number` - `items: Array` - `a: number` Time the Snapshot was collected (seconds since the Unix epoch) - `t: number` Time the Snapshot was recorded (seconds since the Unix epoch) - `cursor?: string` ### Snapshot Get Response - `SnapshotGetResponse` Snapshot - `count_reclaim_failures: number` Count of failures to reclaim space - `count_reclaimed_paths: number` Count of reclaimed paths - `count_record_failed: number` Count of failed snapshot recordings - `count_transmit_failures: number` Count of failed snapshot transmissions - `t: number` Time the Snapshot was recorded (seconds since the Unix epoch) - `v: string` Version - `bonds?: Array` - `name: string` Name of the network interface - `status: string` Current status of the network interface - `cpu_count?: number` Count of processors/cores - `cpu_pressure_10s?: number` Percentage of time over a 10 second window that tasks were stalled - `cpu_pressure_300s?: number` Percentage of time over a 5 minute window that tasks were stalled - `cpu_pressure_60s?: number` Percentage of time over a 1 minute window that tasks were stalled - `cpu_pressure_total_us?: number` Total stall time (microseconds) - `cpu_time_guest_ms?: number` Time spent running a virtual CPU or guest OS (milliseconds) - `cpu_time_guest_nice_ms?: number` Time spent running a niced guest (milliseconds) - `cpu_time_idle_ms?: number` Time spent in idle state (milliseconds) - `cpu_time_iowait_ms?: number` Time spent wait for I/O to complete (milliseconds) - `cpu_time_irq_ms?: number` Time spent servicing interrupts (milliseconds) - `cpu_time_nice_ms?: number` Time spent in low-priority user mode (milliseconds) - `cpu_time_softirq_ms?: number` Time spent servicing softirqs (milliseconds) - `cpu_time_steal_ms?: number` Time stolen (milliseconds) - `cpu_time_system_ms?: number` Time spent in system mode (milliseconds) - `cpu_time_user_ms?: number` Time spent in user mode (milliseconds) - `delta?: number` Number of network operations applied during state transition - `dhcp_leases?: Array` - `client_id: string` Client ID of the device the IP Address was leased to - `expiry_time: number` Expiry time of the DHCP lease (seconds since the Unix epoch) - `hostname: string` Hostname of the device the IP Address was leased to - `interface_name: string` Name of the network interface - `ip_address: string` IP Address that was leased - `mac_address: string` MAC Address of the device the IP Address was leased to - `disks?: Array` - `in_progress: number` I/Os currently in progress - `major: number` Device major number - `merged: number` Reads merged - `minor: number` Device minor number - `name: string` Device name - `reads: number` Reads completed successfully - `sectors_read: number` Sectors read successfully - `sectors_written: number` Sectors written successfully - `time_in_progress_ms: number` Time spent doing I/Os (milliseconds) - `time_reading_ms: number` Time spent reading (milliseconds) - `time_writing_ms: number` Time spent writing (milliseconds) - `weighted_time_in_progress_ms: number` Weighted time spent doing I/Os (milliseconds) - `writes: number` Writes completed - `writes_merged: number` Writes merged - `discards?: number` Discards completed successfully - `discards_merged?: number` Discards merged - `flushes?: number` Flushes completed successfully - `sectors_discarded?: number` Sectors discarded - `time_discarding_ms?: number` Time spent discarding (milliseconds) - `time_flushing_ms?: number` Time spent flushing (milliseconds) - `epsilon?: number` Simulated number of network operations applied during state transition - `ha_state?: string` Name of high availability state - `ha_value?: number` Numeric value associated with high availability state (0 = disabled, 1 = active, 2 = standby, 3 = stopped, 4 = fault) - `interfaces?: Array` - `name: string` Name of the network interface - `operstate: string` UP/DOWN state of the network interface - `ip_addresses?: Array` - `interface_name: string` Name of the network interface - `ip_address: string` IP address of the network interface - `speed?: number` Speed of the network interface (bits per second) - `io_pressure_full_10s?: number` Percentage of time over a 10 second window that all tasks were stalled - `io_pressure_full_300s?: number` Percentage of time over a 5 minute window that all tasks were stalled - `io_pressure_full_60s?: number` Percentage of time over a 1 minute window that all tasks were stalled - `io_pressure_full_total_us?: number` Total stall time (microseconds) - `io_pressure_some_10s?: number` Percentage of time over a 10 second window that some tasks were stalled - `io_pressure_some_300s?: number` Percentage of time over a 3 minute window that some tasks were stalled - `io_pressure_some_60s?: number` Percentage of time over a 1 minute window that some tasks were stalled - `io_pressure_some_total_us?: number` Total stall time (microseconds) - `kernel_btime?: number` Boot time (seconds since Unix epoch) - `kernel_ctxt?: number` Number of context switches that the system underwent - `kernel_processes?: number` Number of forks since boot - `kernel_processes_blocked?: number` Number of processes blocked waiting for I/O - `kernel_processes_running?: number` Number of processes in runnable state - `load_average_15m?: number` The fifteen-minute load average - `load_average_1m?: number` The one-minute load average - `load_average_5m?: number` The five-minute load average - `load_average_cur?: number` Number of currently runnable kernel scheduling entities - `load_average_max?: number` Number of kernel scheduling entities that currently exist on the system - `memory_active_bytes?: number` Memory that has been used more recently - `memory_anon_hugepages_bytes?: number` Non-file backed huge pages mapped into user-space page tables - `memory_anon_pages_bytes?: number` Non-file backed pages mapped into user-space page tables - `memory_available_bytes?: number` Estimate of how much memory is available for starting new applications - `memory_bounce_bytes?: number` Memory used for block device bounce buffers - `memory_buffers_bytes?: number` Relatively temporary storage for raw disk blocks - `memory_cached_bytes?: number` In-memory cache for files read from the disk - `memory_cma_free_bytes?: number` Free CMA (Contiguous Memory Allocator) pages - `memory_cma_total_bytes?: number` Total CMA (Contiguous Memory Allocator) pages - `memory_commit_limit_bytes?: number` Total amount of memory currently available to be allocated on the system - `memory_committed_as_bytes?: number` Amount of memory presently allocated on the system - `memory_dirty_bytes?: number` Memory which is waiting to get written back to the disk - `memory_free_bytes?: number` The sum of LowFree and HighFree - `memory_high_free_bytes?: number` Amount of free highmem - `memory_high_total_bytes?: number` Total amount of highmem - `memory_hugepages_free?: number` The number of huge pages in the pool that are not yet allocated - `memory_hugepages_rsvd?: number` Number of huge pages for which a commitment has been made, but no allocation has yet been made - `memory_hugepages_surp?: number` Number of huge pages in the pool above the threshold - `memory_hugepages_total?: number` The size of the pool of huge pages - `memory_hugepagesize_bytes?: number` The size of huge pages - `memory_inactive_bytes?: number` Memory which has been less recently used - `memory_k_reclaimable_bytes?: number` Kernel allocations that the kernel will attempt to reclaim under memory pressure - `memory_kernel_stack_bytes?: number` Amount of memory allocated to kernel stacks - `memory_low_free_bytes?: number` Amount of free lowmem - `memory_low_total_bytes?: number` Total amount of lowmem - `memory_mapped_bytes?: number` Files which have been mapped into memory - `memory_page_tables_bytes?: number` Amount of memory dedicated to the lowest level of page tables - `memory_per_cpu_bytes?: number` Memory allocated to the per-cpu alloctor used to back per-cpu allocations - `memory_pressure_full_10s?: number` Percentage of time over a 10 second window that all tasks were stalled - `memory_pressure_full_300s?: number` Percentage of time over a 5 minute window that all tasks were stalled - `memory_pressure_full_60s?: number` Percentage of time over a 1 minute window that all tasks were stalled - `memory_pressure_full_total_us?: number` Total stall time (microseconds) - `memory_pressure_some_10s?: number` Percentage of time over a 10 second window that some tasks were stalled - `memory_pressure_some_300s?: number` Percentage of time over a 5 minute window that some tasks were stalled - `memory_pressure_some_60s?: number` Percentage of time over a 1 minute window that some tasks were stalled - `memory_pressure_some_total_us?: number` Total stall time (microseconds) - `memory_s_reclaimable_bytes?: number` Part of slab that can be reclaimed on memory pressure - `memory_s_unreclaim_bytes?: number` Part of slab that cannot be reclaimed on memory pressure - `memory_secondary_page_tables_bytes?: number` Amount of memory dedicated to the lowest level of page tables - `memory_shmem_bytes?: number` Amount of memory consumed by tmpfs - `memory_shmem_hugepages_bytes?: number` Memory used by shmem and tmpfs, allocated with huge pages - `memory_shmem_pmd_mapped_bytes?: number` Shared memory mapped into user space with huge pages - `memory_slab_bytes?: number` In-kernel data structures cache - `memory_swap_cached_bytes?: number` Memory swapped out and back in while still in swap file - `memory_swap_free_bytes?: number` Amount of swap space that is currently unused - `memory_swap_total_bytes?: number` Total amount of swap space available - `memory_total_bytes?: number` Total usable RAM - `memory_vmalloc_chunk_bytes?: number` Largest contiguous block of vmalloc area which is free - `memory_vmalloc_total_bytes?: number` Total size of vmalloc memory area - `memory_vmalloc_used_bytes?: number` Amount of vmalloc area which is used - `memory_writeback_bytes?: number` Memory which is actively being written back to the disk - `memory_writeback_tmp_bytes?: number` Memory used by FUSE for temporary writeback buffers - `memory_z_swap_bytes?: number` Memory consumed by the zswap backend, compressed - `memory_z_swapped_bytes?: number` Amount of anonymous memory stored in zswap, uncompressed - `mounts?: Array` - `file_system: string` File system on disk (EXT4, NTFS, etc.) - `kind: string` Kind of disk (HDD, SSD, etc.) - `mount_point: string` Path where disk is mounted - `name: string` Name of the disk mount - `available_bytes?: number` Available disk size (bytes) - `is_read_only?: boolean` Determines whether the disk is read-only - `is_removable?: boolean` Determines whether the disk is removable - `total_bytes?: number` Total disk size (bytes) - `netdevs?: Array` - `name: string` Name of the network device - `recv_bytes: number` Total bytes received - `recv_compressed: number` Compressed packets received - `recv_drop: number` Packets dropped - `recv_errs: number` Bad packets received - `recv_fifo: number` FIFO overruns - `recv_frame: number` Frame alignment errors - `recv_multicast: number` Multicast packets received - `recv_packets: number` Total packets received - `sent_bytes: number` Total bytes transmitted - `sent_carrier: number` Number of packets not sent due to carrier errors - `sent_colls: number` Number of collisions - `sent_compressed: number` Number of compressed packets transmitted - `sent_drop: number` Number of packets dropped during transmission - `sent_errs: number` Number of transmission errors - `sent_fifo: number` FIFO overruns - `sent_packets: number` Total packets transmitted - `snmp_icmp_in_addr_mask_reps?: number` Number of ICMP Address Mask Reply messages received - `snmp_icmp_in_addr_masks?: number` Number of ICMP Address Mask Request messages received - `snmp_icmp_in_csum_errors?: number` Number of ICMP messages received with bad checksums - `snmp_icmp_in_dest_unreachs?: number` Number of ICMP Destination Unreachable messages received - `snmp_icmp_in_echo_reps?: number` Number of ICMP Echo Reply messages received - `snmp_icmp_in_echos?: number` Number of ICMP Echo (request) messages received - `snmp_icmp_in_errors?: number` Number of ICMP messages received with ICMP-specific errors - `snmp_icmp_in_msgs?: number` Number of ICMP messages received - `snmp_icmp_in_parm_probs?: number` Number of ICMP Parameter Problem messages received - `snmp_icmp_in_redirects?: number` Number of ICMP Redirect messages received - `snmp_icmp_in_src_quenchs?: number` Number of ICMP Source Quench messages received - `snmp_icmp_in_time_excds?: number` Number of ICMP Time Exceeded messages received - `snmp_icmp_in_timestamp_reps?: number` Number of ICMP Address Mask Request messages received - `snmp_icmp_in_timestamps?: number` Number of ICMP Timestamp (request) messages received - `snmp_icmp_out_addr_mask_reps?: number` Number of ICMP Address Mask Reply messages sent - `snmp_icmp_out_addr_masks?: number` Number of ICMP Address Mask Request messages sent - `snmp_icmp_out_dest_unreachs?: number` Number of ICMP Destination Unreachable messages sent - `snmp_icmp_out_echo_reps?: number` Number of ICMP Echo Reply messages sent - `snmp_icmp_out_echos?: number` Number of ICMP Echo (request) messages sent - `snmp_icmp_out_errors?: number` Number of ICMP messages which this entity did not send due to ICMP-specific errors - `snmp_icmp_out_msgs?: number` Number of ICMP messages attempted to send - `snmp_icmp_out_parm_probs?: number` Number of ICMP Parameter Problem messages sent - `snmp_icmp_out_redirects?: number` Number of ICMP Redirect messages sent - `snmp_icmp_out_src_quenchs?: number` Number of ICMP Source Quench messages sent - `snmp_icmp_out_time_excds?: number` Number of ICMP Time Exceeded messages sent - `snmp_icmp_out_timestamp_reps?: number` Number of ICMP Timestamp Reply messages sent - `snmp_icmp_out_timestamps?: number` Number of ICMP Timestamp (request) messages sent - `snmp_ip_default_ttl?: number` Default value of the Time-To-Live field of the IP header - `snmp_ip_forw_datagrams?: number` Number of datagrams forwarded to their final destination - `snmp_ip_forwarding_enabled?: boolean` Set when acting as an IP gateway - `snmp_ip_frag_creates?: number` Number of datagrams generated by fragmentation - `snmp_ip_frag_fails?: number` Number of datagrams discarded because fragmentation failed - `snmp_ip_frag_oks?: number` Number of datagrams successfully fragmented - `snmp_ip_in_addr_errors?: number` Number of input datagrams discarded due to errors in the IP address - `snmp_ip_in_delivers?: number` Number of input datagrams successfully delivered to IP user-protocols - `snmp_ip_in_discards?: number` Number of input datagrams otherwise discarded - `snmp_ip_in_hdr_errors?: number` Number of input datagrams discarded due to errors in the IP header - `snmp_ip_in_receives?: number` Number of input datagrams received from interfaces - `snmp_ip_in_unknown_protos?: number` Number of input datagrams discarded due unknown or unsupported protocol - `snmp_ip_out_discards?: number` Number of output datagrams otherwise discarded - `snmp_ip_out_no_routes?: number` Number of output datagrams discarded because no route matched - `snmp_ip_out_requests?: number` Number of datagrams supplied for transmission - `snmp_ip_reasm_fails?: number` Number of failures detected by the reassembly algorithm - `snmp_ip_reasm_oks?: number` Number of datagrams successfully reassembled - `snmp_ip_reasm_reqds?: number` Number of fragments received which needed to be reassembled - `snmp_ip_reasm_timeout?: number` Number of seconds fragments are held while awaiting reassembly - `snmp_tcp_active_opens?: number` Number of times TCP transitions to SYN-SENT from CLOSED - `snmp_tcp_attempt_fails?: number` Number of times TCP transitions to CLOSED from SYN-SENT or SYN-RCVD, plus transitions to LISTEN from SYN-RCVD - `snmp_tcp_curr_estab?: number` Number of TCP connections in ESTABLISHED or CLOSE-WAIT - `snmp_tcp_estab_resets?: number` Number of times TCP transitions to CLOSED from ESTABLISHED or CLOSE-WAIT - `snmp_tcp_in_csum_errors?: number` Number of TCP segments received with checksum errors - `snmp_tcp_in_errs?: number` Number of TCP segments received in error - `snmp_tcp_in_segs?: number` Number of TCP segments received - `snmp_tcp_max_conn?: number` Limit on the total number of TCP connections - `snmp_tcp_out_rsts?: number` Number of TCP segments sent with RST flag - `snmp_tcp_out_segs?: number` Number of TCP segments sent - `snmp_tcp_passive_opens?: number` Number of times TCP transitions to SYN-RCVD from LISTEN - `snmp_tcp_retrans_segs?: number` Number of TCP segments retransmitted - `snmp_tcp_rto_max?: number` Maximum value permitted by a TCP implementation for the retransmission timeout (milliseconds) - `snmp_tcp_rto_min?: number` Minimum value permitted by a TCP implementation for the retransmission timeout (milliseconds) - `snmp_udp_in_datagrams?: number` Number of UDP datagrams delivered to UDP applications - `snmp_udp_in_errors?: number` Number of UDP datagrams failed to be delivered for reasons other than lack of application at the destination port - `snmp_udp_no_ports?: number` Number of UDP datagrams received for which there was not application at the destination port - `snmp_udp_out_datagrams?: number` Number of UDP datagrams sent - `system_boot_time_s?: number` Boottime of the system (seconds since the Unix epoch) - `thermals?: Array` - `label: string` Sensor identifier for the component - `critical_celcius?: number` Critical failure temperature of the component (degrees Celsius) - `current_celcius?: number` Current temperature of the component (degrees Celsius) - `max_celcius?: number` Maximum temperature of the component (degrees Celsius) - `tunnels?: Array` - `health_state: string` Name of tunnel health state (unknown, healthy, degraded, down) - `health_value: number` Numeric value associated with tunnel state (0 = unknown, 1 = healthy, 2 = degraded, 3 = down) - `interface_name: string` The tunnel interface name (i.e. xfrm1, xfrm3.99, etc.) - `tunnel_id: string` Tunnel identifier - `probed_mtu?: number` MTU as measured between the two ends of the tunnel - `recent_healthy_pings?: number` Number of recent healthy pings for this tunnel - `recent_unhealthy_pings?: number` Number of recent unhealthy pings for this tunnel - `uptime_idle_ms?: number` Sum of how much time each core has spent idle - `uptime_total_ms?: number` Uptime of the system, including time spent in suspend # Latest ## Get latest Snapshots `client.magicTransit.connectors.snapshots.latest.list(stringconnectorId, LatestListParamsparams, RequestOptionsoptions?): LatestListResponse` **get** `/accounts/{account_id}/magic/connectors/{connector_id}/telemetry/snapshots/latest` Get latest Snapshots ### Parameters - `connectorId: string` - `params: LatestListParams` - `account_id: string` Account identifier ### Returns - `LatestListResponse` - `count: number` - `items: Array` - `count_reclaim_failures: number` Count of failures to reclaim space - `count_reclaimed_paths: number` Count of reclaimed paths - `count_record_failed: number` Count of failed snapshot recordings - `count_transmit_failures: number` Count of failed snapshot transmissions - `t: number` Time the Snapshot was recorded (seconds since the Unix epoch) - `v: string` Version - `bonds?: Array` - `name: string` Name of the network interface - `status: string` Current status of the network interface - `cpu_count?: number` Count of processors/cores - `cpu_pressure_10s?: number` Percentage of time over a 10 second window that tasks were stalled - `cpu_pressure_300s?: number` Percentage of time over a 5 minute window that tasks were stalled - `cpu_pressure_60s?: number` Percentage of time over a 1 minute window that tasks were stalled - `cpu_pressure_total_us?: number` Total stall time (microseconds) - `cpu_time_guest_ms?: number` Time spent running a virtual CPU or guest OS (milliseconds) - `cpu_time_guest_nice_ms?: number` Time spent running a niced guest (milliseconds) - `cpu_time_idle_ms?: number` Time spent in idle state (milliseconds) - `cpu_time_iowait_ms?: number` Time spent wait for I/O to complete (milliseconds) - `cpu_time_irq_ms?: number` Time spent servicing interrupts (milliseconds) - `cpu_time_nice_ms?: number` Time spent in low-priority user mode (milliseconds) - `cpu_time_softirq_ms?: number` Time spent servicing softirqs (milliseconds) - `cpu_time_steal_ms?: number` Time stolen (milliseconds) - `cpu_time_system_ms?: number` Time spent in system mode (milliseconds) - `cpu_time_user_ms?: number` Time spent in user mode (milliseconds) - `delta?: number` Number of network operations applied during state transition - `dhcp_leases?: Array` - `client_id: string` Client ID of the device the IP Address was leased to - `expiry_time: number` Expiry time of the DHCP lease (seconds since the Unix epoch) - `hostname: string` Hostname of the device the IP Address was leased to - `interface_name: string` Name of the network interface - `ip_address: string` IP Address that was leased - `mac_address: string` MAC Address of the device the IP Address was leased to - `disks?: Array` - `in_progress: number` I/Os currently in progress - `major: number` Device major number - `merged: number` Reads merged - `minor: number` Device minor number - `name: string` Device name - `reads: number` Reads completed successfully - `sectors_read: number` Sectors read successfully - `sectors_written: number` Sectors written successfully - `time_in_progress_ms: number` Time spent doing I/Os (milliseconds) - `time_reading_ms: number` Time spent reading (milliseconds) - `time_writing_ms: number` Time spent writing (milliseconds) - `weighted_time_in_progress_ms: number` Weighted time spent doing I/Os (milliseconds) - `writes: number` Writes completed - `writes_merged: number` Writes merged - `discards?: number` Discards completed successfully - `discards_merged?: number` Discards merged - `flushes?: number` Flushes completed successfully - `sectors_discarded?: number` Sectors discarded - `time_discarding_ms?: number` Time spent discarding (milliseconds) - `time_flushing_ms?: number` Time spent flushing (milliseconds) - `epsilon?: number` Simulated number of network operations applied during state transition - `ha_state?: string` Name of high availability state - `ha_value?: number` Numeric value associated with high availability state (0 = disabled, 1 = active, 2 = standby, 3 = stopped, 4 = fault) - `interfaces?: Array` - `name: string` Name of the network interface - `operstate: string` UP/DOWN state of the network interface - `ip_addresses?: Array` - `interface_name: string` Name of the network interface - `ip_address: string` IP address of the network interface - `speed?: number` Speed of the network interface (bits per second) - `io_pressure_full_10s?: number` Percentage of time over a 10 second window that all tasks were stalled - `io_pressure_full_300s?: number` Percentage of time over a 5 minute window that all tasks were stalled - `io_pressure_full_60s?: number` Percentage of time over a 1 minute window that all tasks were stalled - `io_pressure_full_total_us?: number` Total stall time (microseconds) - `io_pressure_some_10s?: number` Percentage of time over a 10 second window that some tasks were stalled - `io_pressure_some_300s?: number` Percentage of time over a 3 minute window that some tasks were stalled - `io_pressure_some_60s?: number` Percentage of time over a 1 minute window that some tasks were stalled - `io_pressure_some_total_us?: number` Total stall time (microseconds) - `kernel_btime?: number` Boot time (seconds since Unix epoch) - `kernel_ctxt?: number` Number of context switches that the system underwent - `kernel_processes?: number` Number of forks since boot - `kernel_processes_blocked?: number` Number of processes blocked waiting for I/O - `kernel_processes_running?: number` Number of processes in runnable state - `load_average_15m?: number` The fifteen-minute load average - `load_average_1m?: number` The one-minute load average - `load_average_5m?: number` The five-minute load average - `load_average_cur?: number` Number of currently runnable kernel scheduling entities - `load_average_max?: number` Number of kernel scheduling entities that currently exist on the system - `memory_active_bytes?: number` Memory that has been used more recently - `memory_anon_hugepages_bytes?: number` Non-file backed huge pages mapped into user-space page tables - `memory_anon_pages_bytes?: number` Non-file backed pages mapped into user-space page tables - `memory_available_bytes?: number` Estimate of how much memory is available for starting new applications - `memory_bounce_bytes?: number` Memory used for block device bounce buffers - `memory_buffers_bytes?: number` Relatively temporary storage for raw disk blocks - `memory_cached_bytes?: number` In-memory cache for files read from the disk - `memory_cma_free_bytes?: number` Free CMA (Contiguous Memory Allocator) pages - `memory_cma_total_bytes?: number` Total CMA (Contiguous Memory Allocator) pages - `memory_commit_limit_bytes?: number` Total amount of memory currently available to be allocated on the system - `memory_committed_as_bytes?: number` Amount of memory presently allocated on the system - `memory_dirty_bytes?: number` Memory which is waiting to get written back to the disk - `memory_free_bytes?: number` The sum of LowFree and HighFree - `memory_high_free_bytes?: number` Amount of free highmem - `memory_high_total_bytes?: number` Total amount of highmem - `memory_hugepages_free?: number` The number of huge pages in the pool that are not yet allocated - `memory_hugepages_rsvd?: number` Number of huge pages for which a commitment has been made, but no allocation has yet been made - `memory_hugepages_surp?: number` Number of huge pages in the pool above the threshold - `memory_hugepages_total?: number` The size of the pool of huge pages - `memory_hugepagesize_bytes?: number` The size of huge pages - `memory_inactive_bytes?: number` Memory which has been less recently used - `memory_k_reclaimable_bytes?: number` Kernel allocations that the kernel will attempt to reclaim under memory pressure - `memory_kernel_stack_bytes?: number` Amount of memory allocated to kernel stacks - `memory_low_free_bytes?: number` Amount of free lowmem - `memory_low_total_bytes?: number` Total amount of lowmem - `memory_mapped_bytes?: number` Files which have been mapped into memory - `memory_page_tables_bytes?: number` Amount of memory dedicated to the lowest level of page tables - `memory_per_cpu_bytes?: number` Memory allocated to the per-cpu alloctor used to back per-cpu allocations - `memory_pressure_full_10s?: number` Percentage of time over a 10 second window that all tasks were stalled - `memory_pressure_full_300s?: number` Percentage of time over a 5 minute window that all tasks were stalled - `memory_pressure_full_60s?: number` Percentage of time over a 1 minute window that all tasks were stalled - `memory_pressure_full_total_us?: number` Total stall time (microseconds) - `memory_pressure_some_10s?: number` Percentage of time over a 10 second window that some tasks were stalled - `memory_pressure_some_300s?: number` Percentage of time over a 5 minute window that some tasks were stalled - `memory_pressure_some_60s?: number` Percentage of time over a 1 minute window that some tasks were stalled - `memory_pressure_some_total_us?: number` Total stall time (microseconds) - `memory_s_reclaimable_bytes?: number` Part of slab that can be reclaimed on memory pressure - `memory_s_unreclaim_bytes?: number` Part of slab that cannot be reclaimed on memory pressure - `memory_secondary_page_tables_bytes?: number` Amount of memory dedicated to the lowest level of page tables - `memory_shmem_bytes?: number` Amount of memory consumed by tmpfs - `memory_shmem_hugepages_bytes?: number` Memory used by shmem and tmpfs, allocated with huge pages - `memory_shmem_pmd_mapped_bytes?: number` Shared memory mapped into user space with huge pages - `memory_slab_bytes?: number` In-kernel data structures cache - `memory_swap_cached_bytes?: number` Memory swapped out and back in while still in swap file - `memory_swap_free_bytes?: number` Amount of swap space that is currently unused - `memory_swap_total_bytes?: number` Total amount of swap space available - `memory_total_bytes?: number` Total usable RAM - `memory_vmalloc_chunk_bytes?: number` Largest contiguous block of vmalloc area which is free - `memory_vmalloc_total_bytes?: number` Total size of vmalloc memory area - `memory_vmalloc_used_bytes?: number` Amount of vmalloc area which is used - `memory_writeback_bytes?: number` Memory which is actively being written back to the disk - `memory_writeback_tmp_bytes?: number` Memory used by FUSE for temporary writeback buffers - `memory_z_swap_bytes?: number` Memory consumed by the zswap backend, compressed - `memory_z_swapped_bytes?: number` Amount of anonymous memory stored in zswap, uncompressed - `mounts?: Array` - `file_system: string` File system on disk (EXT4, NTFS, etc.) - `kind: string` Kind of disk (HDD, SSD, etc.) - `mount_point: string` Path where disk is mounted - `name: string` Name of the disk mount - `available_bytes?: number` Available disk size (bytes) - `is_read_only?: boolean` Determines whether the disk is read-only - `is_removable?: boolean` Determines whether the disk is removable - `total_bytes?: number` Total disk size (bytes) - `netdevs?: Array` - `name: string` Name of the network device - `recv_bytes: number` Total bytes received - `recv_compressed: number` Compressed packets received - `recv_drop: number` Packets dropped - `recv_errs: number` Bad packets received - `recv_fifo: number` FIFO overruns - `recv_frame: number` Frame alignment errors - `recv_multicast: number` Multicast packets received - `recv_packets: number` Total packets received - `sent_bytes: number` Total bytes transmitted - `sent_carrier: number` Number of packets not sent due to carrier errors - `sent_colls: number` Number of collisions - `sent_compressed: number` Number of compressed packets transmitted - `sent_drop: number` Number of packets dropped during transmission - `sent_errs: number` Number of transmission errors - `sent_fifo: number` FIFO overruns - `sent_packets: number` Total packets transmitted - `snmp_icmp_in_addr_mask_reps?: number` Number of ICMP Address Mask Reply messages received - `snmp_icmp_in_addr_masks?: number` Number of ICMP Address Mask Request messages received - `snmp_icmp_in_csum_errors?: number` Number of ICMP messages received with bad checksums - `snmp_icmp_in_dest_unreachs?: number` Number of ICMP Destination Unreachable messages received - `snmp_icmp_in_echo_reps?: number` Number of ICMP Echo Reply messages received - `snmp_icmp_in_echos?: number` Number of ICMP Echo (request) messages received - `snmp_icmp_in_errors?: number` Number of ICMP messages received with ICMP-specific errors - `snmp_icmp_in_msgs?: number` Number of ICMP messages received - `snmp_icmp_in_parm_probs?: number` Number of ICMP Parameter Problem messages received - `snmp_icmp_in_redirects?: number` Number of ICMP Redirect messages received - `snmp_icmp_in_src_quenchs?: number` Number of ICMP Source Quench messages received - `snmp_icmp_in_time_excds?: number` Number of ICMP Time Exceeded messages received - `snmp_icmp_in_timestamp_reps?: number` Number of ICMP Address Mask Request messages received - `snmp_icmp_in_timestamps?: number` Number of ICMP Timestamp (request) messages received - `snmp_icmp_out_addr_mask_reps?: number` Number of ICMP Address Mask Reply messages sent - `snmp_icmp_out_addr_masks?: number` Number of ICMP Address Mask Request messages sent - `snmp_icmp_out_dest_unreachs?: number` Number of ICMP Destination Unreachable messages sent - `snmp_icmp_out_echo_reps?: number` Number of ICMP Echo Reply messages sent - `snmp_icmp_out_echos?: number` Number of ICMP Echo (request) messages sent - `snmp_icmp_out_errors?: number` Number of ICMP messages which this entity did not send due to ICMP-specific errors - `snmp_icmp_out_msgs?: number` Number of ICMP messages attempted to send - `snmp_icmp_out_parm_probs?: number` Number of ICMP Parameter Problem messages sent - `snmp_icmp_out_redirects?: number` Number of ICMP Redirect messages sent - `snmp_icmp_out_src_quenchs?: number` Number of ICMP Source Quench messages sent - `snmp_icmp_out_time_excds?: number` Number of ICMP Time Exceeded messages sent - `snmp_icmp_out_timestamp_reps?: number` Number of ICMP Timestamp Reply messages sent - `snmp_icmp_out_timestamps?: number` Number of ICMP Timestamp (request) messages sent - `snmp_ip_default_ttl?: number` Default value of the Time-To-Live field of the IP header - `snmp_ip_forw_datagrams?: number` Number of datagrams forwarded to their final destination - `snmp_ip_forwarding_enabled?: boolean` Set when acting as an IP gateway - `snmp_ip_frag_creates?: number` Number of datagrams generated by fragmentation - `snmp_ip_frag_fails?: number` Number of datagrams discarded because fragmentation failed - `snmp_ip_frag_oks?: number` Number of datagrams successfully fragmented - `snmp_ip_in_addr_errors?: number` Number of input datagrams discarded due to errors in the IP address - `snmp_ip_in_delivers?: number` Number of input datagrams successfully delivered to IP user-protocols - `snmp_ip_in_discards?: number` Number of input datagrams otherwise discarded - `snmp_ip_in_hdr_errors?: number` Number of input datagrams discarded due to errors in the IP header - `snmp_ip_in_receives?: number` Number of input datagrams received from interfaces - `snmp_ip_in_unknown_protos?: number` Number of input datagrams discarded due unknown or unsupported protocol - `snmp_ip_out_discards?: number` Number of output datagrams otherwise discarded - `snmp_ip_out_no_routes?: number` Number of output datagrams discarded because no route matched - `snmp_ip_out_requests?: number` Number of datagrams supplied for transmission - `snmp_ip_reasm_fails?: number` Number of failures detected by the reassembly algorithm - `snmp_ip_reasm_oks?: number` Number of datagrams successfully reassembled - `snmp_ip_reasm_reqds?: number` Number of fragments received which needed to be reassembled - `snmp_ip_reasm_timeout?: number` Number of seconds fragments are held while awaiting reassembly - `snmp_tcp_active_opens?: number` Number of times TCP transitions to SYN-SENT from CLOSED - `snmp_tcp_attempt_fails?: number` Number of times TCP transitions to CLOSED from SYN-SENT or SYN-RCVD, plus transitions to LISTEN from SYN-RCVD - `snmp_tcp_curr_estab?: number` Number of TCP connections in ESTABLISHED or CLOSE-WAIT - `snmp_tcp_estab_resets?: number` Number of times TCP transitions to CLOSED from ESTABLISHED or CLOSE-WAIT - `snmp_tcp_in_csum_errors?: number` Number of TCP segments received with checksum errors - `snmp_tcp_in_errs?: number` Number of TCP segments received in error - `snmp_tcp_in_segs?: number` Number of TCP segments received - `snmp_tcp_max_conn?: number` Limit on the total number of TCP connections - `snmp_tcp_out_rsts?: number` Number of TCP segments sent with RST flag - `snmp_tcp_out_segs?: number` Number of TCP segments sent - `snmp_tcp_passive_opens?: number` Number of times TCP transitions to SYN-RCVD from LISTEN - `snmp_tcp_retrans_segs?: number` Number of TCP segments retransmitted - `snmp_tcp_rto_max?: number` Maximum value permitted by a TCP implementation for the retransmission timeout (milliseconds) - `snmp_tcp_rto_min?: number` Minimum value permitted by a TCP implementation for the retransmission timeout (milliseconds) - `snmp_udp_in_datagrams?: number` Number of UDP datagrams delivered to UDP applications - `snmp_udp_in_errors?: number` Number of UDP datagrams failed to be delivered for reasons other than lack of application at the destination port - `snmp_udp_no_ports?: number` Number of UDP datagrams received for which there was not application at the destination port - `snmp_udp_out_datagrams?: number` Number of UDP datagrams sent - `system_boot_time_s?: number` Boottime of the system (seconds since the Unix epoch) - `thermals?: Array` - `label: string` Sensor identifier for the component - `critical_celcius?: number` Critical failure temperature of the component (degrees Celsius) - `current_celcius?: number` Current temperature of the component (degrees Celsius) - `max_celcius?: number` Maximum temperature of the component (degrees Celsius) - `tunnels?: Array` - `health_state: string` Name of tunnel health state (unknown, healthy, degraded, down) - `health_value: number` Numeric value associated with tunnel state (0 = unknown, 1 = healthy, 2 = degraded, 3 = down) - `interface_name: string` The tunnel interface name (i.e. xfrm1, xfrm3.99, etc.) - `tunnel_id: string` Tunnel identifier - `probed_mtu?: number` MTU as measured between the two ends of the tunnel - `recent_healthy_pings?: number` Number of recent healthy pings for this tunnel - `recent_unhealthy_pings?: number` Number of recent unhealthy pings for this tunnel - `uptime_idle_ms?: number` Sum of how much time each core has spent idle - `uptime_total_ms?: number` Uptime of the system, including time spent in suspend ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const latests = await client.magicTransit.connectors.snapshots.latest.list('connector_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(latests.count); ``` #### Response ```json { "result": { "count": 0, "items": [ { "count_reclaim_failures": 0, "count_reclaimed_paths": 0, "count_record_failed": 0, "count_transmit_failures": 0, "t": 0, "v": "v", "bonds": [ { "name": "name", "status": "status" } ], "cpu_count": 0, "cpu_pressure_10s": 0, "cpu_pressure_300s": 0, "cpu_pressure_60s": 0, "cpu_pressure_total_us": 0, "cpu_time_guest_ms": 0, "cpu_time_guest_nice_ms": 0, "cpu_time_idle_ms": 0, "cpu_time_iowait_ms": 0, "cpu_time_irq_ms": 0, "cpu_time_nice_ms": 0, "cpu_time_softirq_ms": 0, "cpu_time_steal_ms": 0, "cpu_time_system_ms": 0, "cpu_time_user_ms": 0, "delta": 0, "dhcp_leases": [ { "client_id": "client_id", "expiry_time": 0, "hostname": "hostname", "interface_name": "interface_name", "ip_address": "ip_address", "mac_address": "mac_address" } ], "disks": [ { "in_progress": 0, "major": 0, "merged": 0, "minor": 0, "name": "name", "reads": 0, "sectors_read": 0, "sectors_written": 0, "time_in_progress_ms": 0, "time_reading_ms": 0, "time_writing_ms": 0, "weighted_time_in_progress_ms": 0, "writes": 0, "writes_merged": 0, "discards": 0, "discards_merged": 0, "flushes": 0, "sectors_discarded": 0, "time_discarding_ms": 0, "time_flushing_ms": 0 } ], "epsilon": 0, "ha_state": "ha_state", "ha_value": 0, "interfaces": [ { "name": "name", "operstate": "operstate", "ip_addresses": [ { "interface_name": "interface_name", "ip_address": "ip_address" } ], "speed": 0 } ], "io_pressure_full_10s": 0, "io_pressure_full_300s": 0, "io_pressure_full_60s": 0, "io_pressure_full_total_us": 0, "io_pressure_some_10s": 0, "io_pressure_some_300s": 0, "io_pressure_some_60s": 0, "io_pressure_some_total_us": 0, "kernel_btime": 0, "kernel_ctxt": 0, "kernel_processes": 0, "kernel_processes_blocked": 0, "kernel_processes_running": 0, "load_average_15m": 0, "load_average_1m": 0, "load_average_5m": 0, "load_average_cur": 0, "load_average_max": 0, "memory_active_bytes": 0, "memory_anon_hugepages_bytes": 0, "memory_anon_pages_bytes": 0, "memory_available_bytes": 0, "memory_bounce_bytes": 0, "memory_buffers_bytes": 0, "memory_cached_bytes": 0, "memory_cma_free_bytes": 0, "memory_cma_total_bytes": 0, "memory_commit_limit_bytes": 0, "memory_committed_as_bytes": 0, "memory_dirty_bytes": 0, "memory_free_bytes": 0, "memory_high_free_bytes": 0, "memory_high_total_bytes": 0, "memory_hugepages_free": 0, "memory_hugepages_rsvd": 0, "memory_hugepages_surp": 0, "memory_hugepages_total": 0, "memory_hugepagesize_bytes": 0, "memory_inactive_bytes": 0, "memory_k_reclaimable_bytes": 0, "memory_kernel_stack_bytes": 0, "memory_low_free_bytes": 0, "memory_low_total_bytes": 0, "memory_mapped_bytes": 0, "memory_page_tables_bytes": 0, "memory_per_cpu_bytes": 0, "memory_pressure_full_10s": 0, "memory_pressure_full_300s": 0, "memory_pressure_full_60s": 0, "memory_pressure_full_total_us": 0, "memory_pressure_some_10s": 0, "memory_pressure_some_300s": 0, "memory_pressure_some_60s": 0, "memory_pressure_some_total_us": 0, "memory_s_reclaimable_bytes": 0, "memory_s_unreclaim_bytes": 0, "memory_secondary_page_tables_bytes": 0, "memory_shmem_bytes": 0, "memory_shmem_hugepages_bytes": 0, "memory_shmem_pmd_mapped_bytes": 0, "memory_slab_bytes": 0, "memory_swap_cached_bytes": 0, "memory_swap_free_bytes": 0, "memory_swap_total_bytes": 0, "memory_total_bytes": 0, "memory_vmalloc_chunk_bytes": 0, "memory_vmalloc_total_bytes": 0, "memory_vmalloc_used_bytes": 0, "memory_writeback_bytes": 0, "memory_writeback_tmp_bytes": 0, "memory_z_swap_bytes": 0, "memory_z_swapped_bytes": 0, "mounts": [ { "file_system": "file_system", "kind": "kind", "mount_point": "mount_point", "name": "name", "available_bytes": 0, "is_read_only": true, "is_removable": true, "total_bytes": 0 } ], "netdevs": [ { "name": "name", "recv_bytes": 0, "recv_compressed": 0, "recv_drop": 0, "recv_errs": 0, "recv_fifo": 0, "recv_frame": 0, "recv_multicast": 0, "recv_packets": 0, "sent_bytes": 0, "sent_carrier": 0, "sent_colls": 0, "sent_compressed": 0, "sent_drop": 0, "sent_errs": 0, "sent_fifo": 0, "sent_packets": 0 } ], "snmp_icmp_in_addr_mask_reps": 0, "snmp_icmp_in_addr_masks": 0, "snmp_icmp_in_csum_errors": 0, "snmp_icmp_in_dest_unreachs": 0, "snmp_icmp_in_echo_reps": 0, "snmp_icmp_in_echos": 0, "snmp_icmp_in_errors": 0, "snmp_icmp_in_msgs": 0, "snmp_icmp_in_parm_probs": 0, "snmp_icmp_in_redirects": 0, "snmp_icmp_in_src_quenchs": 0, "snmp_icmp_in_time_excds": 0, "snmp_icmp_in_timestamp_reps": 0, "snmp_icmp_in_timestamps": 0, "snmp_icmp_out_addr_mask_reps": 0, "snmp_icmp_out_addr_masks": 0, "snmp_icmp_out_dest_unreachs": 0, "snmp_icmp_out_echo_reps": 0, "snmp_icmp_out_echos": 0, "snmp_icmp_out_errors": 0, "snmp_icmp_out_msgs": 0, "snmp_icmp_out_parm_probs": 0, "snmp_icmp_out_redirects": 0, "snmp_icmp_out_src_quenchs": 0, "snmp_icmp_out_time_excds": 0, "snmp_icmp_out_timestamp_reps": 0, "snmp_icmp_out_timestamps": 0, "snmp_ip_default_ttl": 0, "snmp_ip_forw_datagrams": 0, "snmp_ip_forwarding_enabled": true, "snmp_ip_frag_creates": 0, "snmp_ip_frag_fails": 0, "snmp_ip_frag_oks": 0, "snmp_ip_in_addr_errors": 0, "snmp_ip_in_delivers": 0, "snmp_ip_in_discards": 0, "snmp_ip_in_hdr_errors": 0, "snmp_ip_in_receives": 0, "snmp_ip_in_unknown_protos": 0, "snmp_ip_out_discards": 0, "snmp_ip_out_no_routes": 0, "snmp_ip_out_requests": 0, "snmp_ip_reasm_fails": 0, "snmp_ip_reasm_oks": 0, "snmp_ip_reasm_reqds": 0, "snmp_ip_reasm_timeout": 0, "snmp_tcp_active_opens": 0, "snmp_tcp_attempt_fails": 0, "snmp_tcp_curr_estab": 0, "snmp_tcp_estab_resets": 0, "snmp_tcp_in_csum_errors": 0, "snmp_tcp_in_errs": 0, "snmp_tcp_in_segs": 0, "snmp_tcp_max_conn": 0, "snmp_tcp_out_rsts": 0, "snmp_tcp_out_segs": 0, "snmp_tcp_passive_opens": 0, "snmp_tcp_retrans_segs": 0, "snmp_tcp_rto_max": 0, "snmp_tcp_rto_min": 0, "snmp_udp_in_datagrams": 0, "snmp_udp_in_errors": 0, "snmp_udp_no_ports": 0, "snmp_udp_out_datagrams": 0, "system_boot_time_s": 0, "thermals": [ { "label": "label", "critical_celcius": 0, "current_celcius": 0, "max_celcius": 0 } ], "tunnels": [ { "health_state": "health_state", "health_value": 0, "interface_name": "interface_name", "tunnel_id": "tunnel_id", "probed_mtu": 0, "recent_healthy_pings": 0, "recent_unhealthy_pings": 0 } ], "uptime_idle_ms": 0, "uptime_total_ms": 0 } ] }, "success": true, "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ] } ``` ## Domain Types ### Latest List Response - `LatestListResponse` - `count: number` - `items: Array` - `count_reclaim_failures: number` Count of failures to reclaim space - `count_reclaimed_paths: number` Count of reclaimed paths - `count_record_failed: number` Count of failed snapshot recordings - `count_transmit_failures: number` Count of failed snapshot transmissions - `t: number` Time the Snapshot was recorded (seconds since the Unix epoch) - `v: string` Version - `bonds?: Array` - `name: string` Name of the network interface - `status: string` Current status of the network interface - `cpu_count?: number` Count of processors/cores - `cpu_pressure_10s?: number` Percentage of time over a 10 second window that tasks were stalled - `cpu_pressure_300s?: number` Percentage of time over a 5 minute window that tasks were stalled - `cpu_pressure_60s?: number` Percentage of time over a 1 minute window that tasks were stalled - `cpu_pressure_total_us?: number` Total stall time (microseconds) - `cpu_time_guest_ms?: number` Time spent running a virtual CPU or guest OS (milliseconds) - `cpu_time_guest_nice_ms?: number` Time spent running a niced guest (milliseconds) - `cpu_time_idle_ms?: number` Time spent in idle state (milliseconds) - `cpu_time_iowait_ms?: number` Time spent wait for I/O to complete (milliseconds) - `cpu_time_irq_ms?: number` Time spent servicing interrupts (milliseconds) - `cpu_time_nice_ms?: number` Time spent in low-priority user mode (milliseconds) - `cpu_time_softirq_ms?: number` Time spent servicing softirqs (milliseconds) - `cpu_time_steal_ms?: number` Time stolen (milliseconds) - `cpu_time_system_ms?: number` Time spent in system mode (milliseconds) - `cpu_time_user_ms?: number` Time spent in user mode (milliseconds) - `delta?: number` Number of network operations applied during state transition - `dhcp_leases?: Array` - `client_id: string` Client ID of the device the IP Address was leased to - `expiry_time: number` Expiry time of the DHCP lease (seconds since the Unix epoch) - `hostname: string` Hostname of the device the IP Address was leased to - `interface_name: string` Name of the network interface - `ip_address: string` IP Address that was leased - `mac_address: string` MAC Address of the device the IP Address was leased to - `disks?: Array` - `in_progress: number` I/Os currently in progress - `major: number` Device major number - `merged: number` Reads merged - `minor: number` Device minor number - `name: string` Device name - `reads: number` Reads completed successfully - `sectors_read: number` Sectors read successfully - `sectors_written: number` Sectors written successfully - `time_in_progress_ms: number` Time spent doing I/Os (milliseconds) - `time_reading_ms: number` Time spent reading (milliseconds) - `time_writing_ms: number` Time spent writing (milliseconds) - `weighted_time_in_progress_ms: number` Weighted time spent doing I/Os (milliseconds) - `writes: number` Writes completed - `writes_merged: number` Writes merged - `discards?: number` Discards completed successfully - `discards_merged?: number` Discards merged - `flushes?: number` Flushes completed successfully - `sectors_discarded?: number` Sectors discarded - `time_discarding_ms?: number` Time spent discarding (milliseconds) - `time_flushing_ms?: number` Time spent flushing (milliseconds) - `epsilon?: number` Simulated number of network operations applied during state transition - `ha_state?: string` Name of high availability state - `ha_value?: number` Numeric value associated with high availability state (0 = disabled, 1 = active, 2 = standby, 3 = stopped, 4 = fault) - `interfaces?: Array` - `name: string` Name of the network interface - `operstate: string` UP/DOWN state of the network interface - `ip_addresses?: Array` - `interface_name: string` Name of the network interface - `ip_address: string` IP address of the network interface - `speed?: number` Speed of the network interface (bits per second) - `io_pressure_full_10s?: number` Percentage of time over a 10 second window that all tasks were stalled - `io_pressure_full_300s?: number` Percentage of time over a 5 minute window that all tasks were stalled - `io_pressure_full_60s?: number` Percentage of time over a 1 minute window that all tasks were stalled - `io_pressure_full_total_us?: number` Total stall time (microseconds) - `io_pressure_some_10s?: number` Percentage of time over a 10 second window that some tasks were stalled - `io_pressure_some_300s?: number` Percentage of time over a 3 minute window that some tasks were stalled - `io_pressure_some_60s?: number` Percentage of time over a 1 minute window that some tasks were stalled - `io_pressure_some_total_us?: number` Total stall time (microseconds) - `kernel_btime?: number` Boot time (seconds since Unix epoch) - `kernel_ctxt?: number` Number of context switches that the system underwent - `kernel_processes?: number` Number of forks since boot - `kernel_processes_blocked?: number` Number of processes blocked waiting for I/O - `kernel_processes_running?: number` Number of processes in runnable state - `load_average_15m?: number` The fifteen-minute load average - `load_average_1m?: number` The one-minute load average - `load_average_5m?: number` The five-minute load average - `load_average_cur?: number` Number of currently runnable kernel scheduling entities - `load_average_max?: number` Number of kernel scheduling entities that currently exist on the system - `memory_active_bytes?: number` Memory that has been used more recently - `memory_anon_hugepages_bytes?: number` Non-file backed huge pages mapped into user-space page tables - `memory_anon_pages_bytes?: number` Non-file backed pages mapped into user-space page tables - `memory_available_bytes?: number` Estimate of how much memory is available for starting new applications - `memory_bounce_bytes?: number` Memory used for block device bounce buffers - `memory_buffers_bytes?: number` Relatively temporary storage for raw disk blocks - `memory_cached_bytes?: number` In-memory cache for files read from the disk - `memory_cma_free_bytes?: number` Free CMA (Contiguous Memory Allocator) pages - `memory_cma_total_bytes?: number` Total CMA (Contiguous Memory Allocator) pages - `memory_commit_limit_bytes?: number` Total amount of memory currently available to be allocated on the system - `memory_committed_as_bytes?: number` Amount of memory presently allocated on the system - `memory_dirty_bytes?: number` Memory which is waiting to get written back to the disk - `memory_free_bytes?: number` The sum of LowFree and HighFree - `memory_high_free_bytes?: number` Amount of free highmem - `memory_high_total_bytes?: number` Total amount of highmem - `memory_hugepages_free?: number` The number of huge pages in the pool that are not yet allocated - `memory_hugepages_rsvd?: number` Number of huge pages for which a commitment has been made, but no allocation has yet been made - `memory_hugepages_surp?: number` Number of huge pages in the pool above the threshold - `memory_hugepages_total?: number` The size of the pool of huge pages - `memory_hugepagesize_bytes?: number` The size of huge pages - `memory_inactive_bytes?: number` Memory which has been less recently used - `memory_k_reclaimable_bytes?: number` Kernel allocations that the kernel will attempt to reclaim under memory pressure - `memory_kernel_stack_bytes?: number` Amount of memory allocated to kernel stacks - `memory_low_free_bytes?: number` Amount of free lowmem - `memory_low_total_bytes?: number` Total amount of lowmem - `memory_mapped_bytes?: number` Files which have been mapped into memory - `memory_page_tables_bytes?: number` Amount of memory dedicated to the lowest level of page tables - `memory_per_cpu_bytes?: number` Memory allocated to the per-cpu alloctor used to back per-cpu allocations - `memory_pressure_full_10s?: number` Percentage of time over a 10 second window that all tasks were stalled - `memory_pressure_full_300s?: number` Percentage of time over a 5 minute window that all tasks were stalled - `memory_pressure_full_60s?: number` Percentage of time over a 1 minute window that all tasks were stalled - `memory_pressure_full_total_us?: number` Total stall time (microseconds) - `memory_pressure_some_10s?: number` Percentage of time over a 10 second window that some tasks were stalled - `memory_pressure_some_300s?: number` Percentage of time over a 5 minute window that some tasks were stalled - `memory_pressure_some_60s?: number` Percentage of time over a 1 minute window that some tasks were stalled - `memory_pressure_some_total_us?: number` Total stall time (microseconds) - `memory_s_reclaimable_bytes?: number` Part of slab that can be reclaimed on memory pressure - `memory_s_unreclaim_bytes?: number` Part of slab that cannot be reclaimed on memory pressure - `memory_secondary_page_tables_bytes?: number` Amount of memory dedicated to the lowest level of page tables - `memory_shmem_bytes?: number` Amount of memory consumed by tmpfs - `memory_shmem_hugepages_bytes?: number` Memory used by shmem and tmpfs, allocated with huge pages - `memory_shmem_pmd_mapped_bytes?: number` Shared memory mapped into user space with huge pages - `memory_slab_bytes?: number` In-kernel data structures cache - `memory_swap_cached_bytes?: number` Memory swapped out and back in while still in swap file - `memory_swap_free_bytes?: number` Amount of swap space that is currently unused - `memory_swap_total_bytes?: number` Total amount of swap space available - `memory_total_bytes?: number` Total usable RAM - `memory_vmalloc_chunk_bytes?: number` Largest contiguous block of vmalloc area which is free - `memory_vmalloc_total_bytes?: number` Total size of vmalloc memory area - `memory_vmalloc_used_bytes?: number` Amount of vmalloc area which is used - `memory_writeback_bytes?: number` Memory which is actively being written back to the disk - `memory_writeback_tmp_bytes?: number` Memory used by FUSE for temporary writeback buffers - `memory_z_swap_bytes?: number` Memory consumed by the zswap backend, compressed - `memory_z_swapped_bytes?: number` Amount of anonymous memory stored in zswap, uncompressed - `mounts?: Array` - `file_system: string` File system on disk (EXT4, NTFS, etc.) - `kind: string` Kind of disk (HDD, SSD, etc.) - `mount_point: string` Path where disk is mounted - `name: string` Name of the disk mount - `available_bytes?: number` Available disk size (bytes) - `is_read_only?: boolean` Determines whether the disk is read-only - `is_removable?: boolean` Determines whether the disk is removable - `total_bytes?: number` Total disk size (bytes) - `netdevs?: Array` - `name: string` Name of the network device - `recv_bytes: number` Total bytes received - `recv_compressed: number` Compressed packets received - `recv_drop: number` Packets dropped - `recv_errs: number` Bad packets received - `recv_fifo: number` FIFO overruns - `recv_frame: number` Frame alignment errors - `recv_multicast: number` Multicast packets received - `recv_packets: number` Total packets received - `sent_bytes: number` Total bytes transmitted - `sent_carrier: number` Number of packets not sent due to carrier errors - `sent_colls: number` Number of collisions - `sent_compressed: number` Number of compressed packets transmitted - `sent_drop: number` Number of packets dropped during transmission - `sent_errs: number` Number of transmission errors - `sent_fifo: number` FIFO overruns - `sent_packets: number` Total packets transmitted - `snmp_icmp_in_addr_mask_reps?: number` Number of ICMP Address Mask Reply messages received - `snmp_icmp_in_addr_masks?: number` Number of ICMP Address Mask Request messages received - `snmp_icmp_in_csum_errors?: number` Number of ICMP messages received with bad checksums - `snmp_icmp_in_dest_unreachs?: number` Number of ICMP Destination Unreachable messages received - `snmp_icmp_in_echo_reps?: number` Number of ICMP Echo Reply messages received - `snmp_icmp_in_echos?: number` Number of ICMP Echo (request) messages received - `snmp_icmp_in_errors?: number` Number of ICMP messages received with ICMP-specific errors - `snmp_icmp_in_msgs?: number` Number of ICMP messages received - `snmp_icmp_in_parm_probs?: number` Number of ICMP Parameter Problem messages received - `snmp_icmp_in_redirects?: number` Number of ICMP Redirect messages received - `snmp_icmp_in_src_quenchs?: number` Number of ICMP Source Quench messages received - `snmp_icmp_in_time_excds?: number` Number of ICMP Time Exceeded messages received - `snmp_icmp_in_timestamp_reps?: number` Number of ICMP Address Mask Request messages received - `snmp_icmp_in_timestamps?: number` Number of ICMP Timestamp (request) messages received - `snmp_icmp_out_addr_mask_reps?: number` Number of ICMP Address Mask Reply messages sent - `snmp_icmp_out_addr_masks?: number` Number of ICMP Address Mask Request messages sent - `snmp_icmp_out_dest_unreachs?: number` Number of ICMP Destination Unreachable messages sent - `snmp_icmp_out_echo_reps?: number` Number of ICMP Echo Reply messages sent - `snmp_icmp_out_echos?: number` Number of ICMP Echo (request) messages sent - `snmp_icmp_out_errors?: number` Number of ICMP messages which this entity did not send due to ICMP-specific errors - `snmp_icmp_out_msgs?: number` Number of ICMP messages attempted to send - `snmp_icmp_out_parm_probs?: number` Number of ICMP Parameter Problem messages sent - `snmp_icmp_out_redirects?: number` Number of ICMP Redirect messages sent - `snmp_icmp_out_src_quenchs?: number` Number of ICMP Source Quench messages sent - `snmp_icmp_out_time_excds?: number` Number of ICMP Time Exceeded messages sent - `snmp_icmp_out_timestamp_reps?: number` Number of ICMP Timestamp Reply messages sent - `snmp_icmp_out_timestamps?: number` Number of ICMP Timestamp (request) messages sent - `snmp_ip_default_ttl?: number` Default value of the Time-To-Live field of the IP header - `snmp_ip_forw_datagrams?: number` Number of datagrams forwarded to their final destination - `snmp_ip_forwarding_enabled?: boolean` Set when acting as an IP gateway - `snmp_ip_frag_creates?: number` Number of datagrams generated by fragmentation - `snmp_ip_frag_fails?: number` Number of datagrams discarded because fragmentation failed - `snmp_ip_frag_oks?: number` Number of datagrams successfully fragmented - `snmp_ip_in_addr_errors?: number` Number of input datagrams discarded due to errors in the IP address - `snmp_ip_in_delivers?: number` Number of input datagrams successfully delivered to IP user-protocols - `snmp_ip_in_discards?: number` Number of input datagrams otherwise discarded - `snmp_ip_in_hdr_errors?: number` Number of input datagrams discarded due to errors in the IP header - `snmp_ip_in_receives?: number` Number of input datagrams received from interfaces - `snmp_ip_in_unknown_protos?: number` Number of input datagrams discarded due unknown or unsupported protocol - `snmp_ip_out_discards?: number` Number of output datagrams otherwise discarded - `snmp_ip_out_no_routes?: number` Number of output datagrams discarded because no route matched - `snmp_ip_out_requests?: number` Number of datagrams supplied for transmission - `snmp_ip_reasm_fails?: number` Number of failures detected by the reassembly algorithm - `snmp_ip_reasm_oks?: number` Number of datagrams successfully reassembled - `snmp_ip_reasm_reqds?: number` Number of fragments received which needed to be reassembled - `snmp_ip_reasm_timeout?: number` Number of seconds fragments are held while awaiting reassembly - `snmp_tcp_active_opens?: number` Number of times TCP transitions to SYN-SENT from CLOSED - `snmp_tcp_attempt_fails?: number` Number of times TCP transitions to CLOSED from SYN-SENT or SYN-RCVD, plus transitions to LISTEN from SYN-RCVD - `snmp_tcp_curr_estab?: number` Number of TCP connections in ESTABLISHED or CLOSE-WAIT - `snmp_tcp_estab_resets?: number` Number of times TCP transitions to CLOSED from ESTABLISHED or CLOSE-WAIT - `snmp_tcp_in_csum_errors?: number` Number of TCP segments received with checksum errors - `snmp_tcp_in_errs?: number` Number of TCP segments received in error - `snmp_tcp_in_segs?: number` Number of TCP segments received - `snmp_tcp_max_conn?: number` Limit on the total number of TCP connections - `snmp_tcp_out_rsts?: number` Number of TCP segments sent with RST flag - `snmp_tcp_out_segs?: number` Number of TCP segments sent - `snmp_tcp_passive_opens?: number` Number of times TCP transitions to SYN-RCVD from LISTEN - `snmp_tcp_retrans_segs?: number` Number of TCP segments retransmitted - `snmp_tcp_rto_max?: number` Maximum value permitted by a TCP implementation for the retransmission timeout (milliseconds) - `snmp_tcp_rto_min?: number` Minimum value permitted by a TCP implementation for the retransmission timeout (milliseconds) - `snmp_udp_in_datagrams?: number` Number of UDP datagrams delivered to UDP applications - `snmp_udp_in_errors?: number` Number of UDP datagrams failed to be delivered for reasons other than lack of application at the destination port - `snmp_udp_no_ports?: number` Number of UDP datagrams received for which there was not application at the destination port - `snmp_udp_out_datagrams?: number` Number of UDP datagrams sent - `system_boot_time_s?: number` Boottime of the system (seconds since the Unix epoch) - `thermals?: Array` - `label: string` Sensor identifier for the component - `critical_celcius?: number` Critical failure temperature of the component (degrees Celsius) - `current_celcius?: number` Current temperature of the component (degrees Celsius) - `max_celcius?: number` Maximum temperature of the component (degrees Celsius) - `tunnels?: Array` - `health_state: string` Name of tunnel health state (unknown, healthy, degraded, down) - `health_value: number` Numeric value associated with tunnel state (0 = unknown, 1 = healthy, 2 = degraded, 3 = down) - `interface_name: string` The tunnel interface name (i.e. xfrm1, xfrm3.99, etc.) - `tunnel_id: string` Tunnel identifier - `probed_mtu?: number` MTU as measured between the two ends of the tunnel - `recent_healthy_pings?: number` Number of recent healthy pings for this tunnel - `recent_unhealthy_pings?: number` Number of recent unhealthy pings for this tunnel - `uptime_idle_ms?: number` Sum of how much time each core has spent idle - `uptime_total_ms?: number` Uptime of the system, including time spent in suspend # PCAPs ## List packet capture requests `client.magicTransit.pcaps.list(PCAPListParamsparams, RequestOptionsoptions?): SinglePage` **get** `/accounts/{account_id}/pcaps` Lists all packet capture requests for an account. ### Parameters - `params: PCAPListParams` - `account_id: string` Identifier. ### Returns - `PCAPListResponse = PCAP | MagicVisibilityPCAPsPCAPsResponseFull` - `PCAP` - `id?: string` The ID for the packet capture. - `filter_v1?: PCAPFilter` The packet capture filter. When this field is empty, all packets are captured. - `destination_address?: string` The destination IP address of the packet. - `destination_port?: number` The destination port of the packet. - `protocol?: number` The protocol number of the packet. - `source_address?: string` The source IP address of the packet. - `source_port?: number` The source port of the packet. - `offset_time?: string` The RFC 3339 offset timestamp from which to query backwards for packets. Must be within the last 24h. When this field is empty, defaults to time of request. - `status?: "unknown" | "success" | "pending" | 5 more` The status of the packet capture request. - `"unknown"` - `"success"` - `"pending"` - `"running"` - `"conversion_pending"` - `"conversion_running"` - `"complete"` - `"failed"` - `submitted?: string` The RFC 3339 timestamp when the packet capture was created. - `system?: "magic-transit"` The system used to collect packet captures. - `"magic-transit"` - `time_limit?: number` The packet capture duration in seconds. - `type?: "simple" | "full"` The type of packet capture. `Simple` captures sampled packets, and `full` captures entire payloads and non-sampled packets. - `"simple"` - `"full"` - `MagicVisibilityPCAPsPCAPsResponseFull` - `id?: string` The ID for the packet capture. - `byte_limit?: number` The maximum number of bytes to capture. This field only applies to `full` packet captures. - `colo_name?: string` The name of the data center used for the packet capture. This can be a specific colo (ord02) or a multi-colo name (ORD). This field only applies to `full` packet captures. - `destination_conf?: string` The full URI for the bucket. This field only applies to `full` packet captures. - `error_message?: string` An error message that describes why the packet capture failed. This field only applies to `full` packet captures. - `filter_v1?: PCAPFilter` The packet capture filter. When this field is empty, all packets are captured. - `packets_captured?: number` The number of packets captured. - `status?: "unknown" | "success" | "pending" | 5 more` The status of the packet capture request. - `"unknown"` - `"success"` - `"pending"` - `"running"` - `"conversion_pending"` - `"conversion_running"` - `"complete"` - `"failed"` - `stop_requested?: string` The RFC 3339 timestamp when stopping the packet capture was requested. This field only applies to `full` packet captures. - `submitted?: string` The RFC 3339 timestamp when the packet capture was created. - `system?: "magic-transit"` The system used to collect packet captures. - `"magic-transit"` - `time_limit?: number` The packet capture duration in seconds. - `type?: "simple" | "full"` The type of packet capture. `Simple` captures sampled packets, and `full` captures entire payloads and non-sampled packets. - `"simple"` - `"full"` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const pcapListResponse of client.magicTransit.pcaps.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(pcapListResponse); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "id": "66802ca5668e47a2b82c2e6746e45037", "filter_v1": { "destination_address": "1.2.3.4", "destination_port": 80, "protocol": 6, "source_address": "1.2.3.4", "source_port": 123 }, "offset_time": "2020-01-01T08:00:00Z", "status": "success", "submitted": "2020-01-01T08:00:00Z", "system": "magic-transit", "time_limit": 300, "type": "simple" } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Get PCAP request `client.magicTransit.pcaps.get(stringpcapId, PCAPGetParamsparams, RequestOptionsoptions?): PCAPGetResponse` **get** `/accounts/{account_id}/pcaps/{pcap_id}` Get information for a PCAP request by id. ### Parameters - `pcapId: string` Identifier. - `params: PCAPGetParams` - `account_id: string` Identifier. ### Returns - `PCAPGetResponse = PCAP | MagicVisibilityPCAPsPCAPsResponseFull` - `PCAP` - `id?: string` The ID for the packet capture. - `filter_v1?: PCAPFilter` The packet capture filter. When this field is empty, all packets are captured. - `destination_address?: string` The destination IP address of the packet. - `destination_port?: number` The destination port of the packet. - `protocol?: number` The protocol number of the packet. - `source_address?: string` The source IP address of the packet. - `source_port?: number` The source port of the packet. - `offset_time?: string` The RFC 3339 offset timestamp from which to query backwards for packets. Must be within the last 24h. When this field is empty, defaults to time of request. - `status?: "unknown" | "success" | "pending" | 5 more` The status of the packet capture request. - `"unknown"` - `"success"` - `"pending"` - `"running"` - `"conversion_pending"` - `"conversion_running"` - `"complete"` - `"failed"` - `submitted?: string` The RFC 3339 timestamp when the packet capture was created. - `system?: "magic-transit"` The system used to collect packet captures. - `"magic-transit"` - `time_limit?: number` The packet capture duration in seconds. - `type?: "simple" | "full"` The type of packet capture. `Simple` captures sampled packets, and `full` captures entire payloads and non-sampled packets. - `"simple"` - `"full"` - `MagicVisibilityPCAPsPCAPsResponseFull` - `id?: string` The ID for the packet capture. - `byte_limit?: number` The maximum number of bytes to capture. This field only applies to `full` packet captures. - `colo_name?: string` The name of the data center used for the packet capture. This can be a specific colo (ord02) or a multi-colo name (ORD). This field only applies to `full` packet captures. - `destination_conf?: string` The full URI for the bucket. This field only applies to `full` packet captures. - `error_message?: string` An error message that describes why the packet capture failed. This field only applies to `full` packet captures. - `filter_v1?: PCAPFilter` The packet capture filter. When this field is empty, all packets are captured. - `packets_captured?: number` The number of packets captured. - `status?: "unknown" | "success" | "pending" | 5 more` The status of the packet capture request. - `"unknown"` - `"success"` - `"pending"` - `"running"` - `"conversion_pending"` - `"conversion_running"` - `"complete"` - `"failed"` - `stop_requested?: string` The RFC 3339 timestamp when stopping the packet capture was requested. This field only applies to `full` packet captures. - `submitted?: string` The RFC 3339 timestamp when the packet capture was created. - `system?: "magic-transit"` The system used to collect packet captures. - `"magic-transit"` - `time_limit?: number` The packet capture duration in seconds. - `type?: "simple" | "full"` The type of packet capture. `Simple` captures sampled packets, and `full` captures entire payloads and non-sampled packets. - `"simple"` - `"full"` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const pcap = await client.magicTransit.pcaps.get('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(pcap); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "66802ca5668e47a2b82c2e6746e45037", "filter_v1": { "destination_address": "1.2.3.4", "destination_port": 80, "protocol": 6, "source_address": "1.2.3.4", "source_port": 123 }, "offset_time": "2020-01-01T08:00:00Z", "status": "success", "submitted": "2020-01-01T08:00:00Z", "system": "magic-transit", "time_limit": 300, "type": "simple" }, "success": true } ``` ## Create PCAP request `client.magicTransit.pcaps.create(PCAPCreateParamsparams, RequestOptionsoptions?): PCAPCreateResponse` **post** `/accounts/{account_id}/pcaps` Create new PCAP request for account. ### Parameters - `PCAPCreateParams = MagicVisibilityPCAPsPCAPsRequestSimple | MagicVisibilityPCAPsPCAPsRequestFull` - `PCAPCreateParamsBase` - `MagicVisibilityPCAPsPCAPsRequestSimple extends PCAPCreateParamsBase` - `MagicVisibilityPCAPsPCAPsRequestFull extends PCAPCreateParamsBase` ### Returns - `PCAPCreateResponse = PCAP | MagicVisibilityPCAPsPCAPsResponseFull` - `PCAP` - `id?: string` The ID for the packet capture. - `filter_v1?: PCAPFilter` The packet capture filter. When this field is empty, all packets are captured. - `destination_address?: string` The destination IP address of the packet. - `destination_port?: number` The destination port of the packet. - `protocol?: number` The protocol number of the packet. - `source_address?: string` The source IP address of the packet. - `source_port?: number` The source port of the packet. - `offset_time?: string` The RFC 3339 offset timestamp from which to query backwards for packets. Must be within the last 24h. When this field is empty, defaults to time of request. - `status?: "unknown" | "success" | "pending" | 5 more` The status of the packet capture request. - `"unknown"` - `"success"` - `"pending"` - `"running"` - `"conversion_pending"` - `"conversion_running"` - `"complete"` - `"failed"` - `submitted?: string` The RFC 3339 timestamp when the packet capture was created. - `system?: "magic-transit"` The system used to collect packet captures. - `"magic-transit"` - `time_limit?: number` The packet capture duration in seconds. - `type?: "simple" | "full"` The type of packet capture. `Simple` captures sampled packets, and `full` captures entire payloads and non-sampled packets. - `"simple"` - `"full"` - `MagicVisibilityPCAPsPCAPsResponseFull` - `id?: string` The ID for the packet capture. - `byte_limit?: number` The maximum number of bytes to capture. This field only applies to `full` packet captures. - `colo_name?: string` The name of the data center used for the packet capture. This can be a specific colo (ord02) or a multi-colo name (ORD). This field only applies to `full` packet captures. - `destination_conf?: string` The full URI for the bucket. This field only applies to `full` packet captures. - `error_message?: string` An error message that describes why the packet capture failed. This field only applies to `full` packet captures. - `filter_v1?: PCAPFilter` The packet capture filter. When this field is empty, all packets are captured. - `packets_captured?: number` The number of packets captured. - `status?: "unknown" | "success" | "pending" | 5 more` The status of the packet capture request. - `"unknown"` - `"success"` - `"pending"` - `"running"` - `"conversion_pending"` - `"conversion_running"` - `"complete"` - `"failed"` - `stop_requested?: string` The RFC 3339 timestamp when stopping the packet capture was requested. This field only applies to `full` packet captures. - `submitted?: string` The RFC 3339 timestamp when the packet capture was created. - `system?: "magic-transit"` The system used to collect packet captures. - `"magic-transit"` - `time_limit?: number` The packet capture duration in seconds. - `type?: "simple" | "full"` The type of packet capture. `Simple` captures sampled packets, and `full` captures entire payloads and non-sampled packets. - `"simple"` - `"full"` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const pcap = await client.magicTransit.pcaps.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', packet_limit: 10000, system: 'magic-transit', time_limit: 300, type: 'simple', }); console.log(pcap); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "66802ca5668e47a2b82c2e6746e45037", "filter_v1": { "destination_address": "1.2.3.4", "destination_port": 80, "protocol": 6, "source_address": "1.2.3.4", "source_port": 123 }, "offset_time": "2020-01-01T08:00:00Z", "status": "success", "submitted": "2020-01-01T08:00:00Z", "system": "magic-transit", "time_limit": 300, "type": "simple" }, "success": true } ``` ## Stop full PCAP `client.magicTransit.pcaps.stop(stringpcapId, PCAPStopParamsparams, RequestOptionsoptions?): void` **put** `/accounts/{account_id}/pcaps/{pcap_id}/stop` Stop full PCAP. ### Parameters - `pcapId: string` Identifier. - `params: PCAPStopParams` - `account_id: string` Identifier. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); await client.magicTransit.pcaps.stop('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); ``` ## Domain Types ### PCAP - `PCAP` - `id?: string` The ID for the packet capture. - `filter_v1?: PCAPFilter` The packet capture filter. When this field is empty, all packets are captured. - `destination_address?: string` The destination IP address of the packet. - `destination_port?: number` The destination port of the packet. - `protocol?: number` The protocol number of the packet. - `source_address?: string` The source IP address of the packet. - `source_port?: number` The source port of the packet. - `offset_time?: string` The RFC 3339 offset timestamp from which to query backwards for packets. Must be within the last 24h. When this field is empty, defaults to time of request. - `status?: "unknown" | "success" | "pending" | 5 more` The status of the packet capture request. - `"unknown"` - `"success"` - `"pending"` - `"running"` - `"conversion_pending"` - `"conversion_running"` - `"complete"` - `"failed"` - `submitted?: string` The RFC 3339 timestamp when the packet capture was created. - `system?: "magic-transit"` The system used to collect packet captures. - `"magic-transit"` - `time_limit?: number` The packet capture duration in seconds. - `type?: "simple" | "full"` The type of packet capture. `Simple` captures sampled packets, and `full` captures entire payloads and non-sampled packets. - `"simple"` - `"full"` ### PCAP Filter - `PCAPFilter` The packet capture filter. When this field is empty, all packets are captured. - `destination_address?: string` The destination IP address of the packet. - `destination_port?: number` The destination port of the packet. - `protocol?: number` The protocol number of the packet. - `source_address?: string` The source IP address of the packet. - `source_port?: number` The source port of the packet. ### PCAP List Response - `PCAPListResponse = PCAP | MagicVisibilityPCAPsPCAPsResponseFull` - `PCAP` - `id?: string` The ID for the packet capture. - `filter_v1?: PCAPFilter` The packet capture filter. When this field is empty, all packets are captured. - `destination_address?: string` The destination IP address of the packet. - `destination_port?: number` The destination port of the packet. - `protocol?: number` The protocol number of the packet. - `source_address?: string` The source IP address of the packet. - `source_port?: number` The source port of the packet. - `offset_time?: string` The RFC 3339 offset timestamp from which to query backwards for packets. Must be within the last 24h. When this field is empty, defaults to time of request. - `status?: "unknown" | "success" | "pending" | 5 more` The status of the packet capture request. - `"unknown"` - `"success"` - `"pending"` - `"running"` - `"conversion_pending"` - `"conversion_running"` - `"complete"` - `"failed"` - `submitted?: string` The RFC 3339 timestamp when the packet capture was created. - `system?: "magic-transit"` The system used to collect packet captures. - `"magic-transit"` - `time_limit?: number` The packet capture duration in seconds. - `type?: "simple" | "full"` The type of packet capture. `Simple` captures sampled packets, and `full` captures entire payloads and non-sampled packets. - `"simple"` - `"full"` - `MagicVisibilityPCAPsPCAPsResponseFull` - `id?: string` The ID for the packet capture. - `byte_limit?: number` The maximum number of bytes to capture. This field only applies to `full` packet captures. - `colo_name?: string` The name of the data center used for the packet capture. This can be a specific colo (ord02) or a multi-colo name (ORD). This field only applies to `full` packet captures. - `destination_conf?: string` The full URI for the bucket. This field only applies to `full` packet captures. - `error_message?: string` An error message that describes why the packet capture failed. This field only applies to `full` packet captures. - `filter_v1?: PCAPFilter` The packet capture filter. When this field is empty, all packets are captured. - `packets_captured?: number` The number of packets captured. - `status?: "unknown" | "success" | "pending" | 5 more` The status of the packet capture request. - `"unknown"` - `"success"` - `"pending"` - `"running"` - `"conversion_pending"` - `"conversion_running"` - `"complete"` - `"failed"` - `stop_requested?: string` The RFC 3339 timestamp when stopping the packet capture was requested. This field only applies to `full` packet captures. - `submitted?: string` The RFC 3339 timestamp when the packet capture was created. - `system?: "magic-transit"` The system used to collect packet captures. - `"magic-transit"` - `time_limit?: number` The packet capture duration in seconds. - `type?: "simple" | "full"` The type of packet capture. `Simple` captures sampled packets, and `full` captures entire payloads and non-sampled packets. - `"simple"` - `"full"` ### PCAP Get Response - `PCAPGetResponse = PCAP | MagicVisibilityPCAPsPCAPsResponseFull` - `PCAP` - `id?: string` The ID for the packet capture. - `filter_v1?: PCAPFilter` The packet capture filter. When this field is empty, all packets are captured. - `destination_address?: string` The destination IP address of the packet. - `destination_port?: number` The destination port of the packet. - `protocol?: number` The protocol number of the packet. - `source_address?: string` The source IP address of the packet. - `source_port?: number` The source port of the packet. - `offset_time?: string` The RFC 3339 offset timestamp from which to query backwards for packets. Must be within the last 24h. When this field is empty, defaults to time of request. - `status?: "unknown" | "success" | "pending" | 5 more` The status of the packet capture request. - `"unknown"` - `"success"` - `"pending"` - `"running"` - `"conversion_pending"` - `"conversion_running"` - `"complete"` - `"failed"` - `submitted?: string` The RFC 3339 timestamp when the packet capture was created. - `system?: "magic-transit"` The system used to collect packet captures. - `"magic-transit"` - `time_limit?: number` The packet capture duration in seconds. - `type?: "simple" | "full"` The type of packet capture. `Simple` captures sampled packets, and `full` captures entire payloads and non-sampled packets. - `"simple"` - `"full"` - `MagicVisibilityPCAPsPCAPsResponseFull` - `id?: string` The ID for the packet capture. - `byte_limit?: number` The maximum number of bytes to capture. This field only applies to `full` packet captures. - `colo_name?: string` The name of the data center used for the packet capture. This can be a specific colo (ord02) or a multi-colo name (ORD). This field only applies to `full` packet captures. - `destination_conf?: string` The full URI for the bucket. This field only applies to `full` packet captures. - `error_message?: string` An error message that describes why the packet capture failed. This field only applies to `full` packet captures. - `filter_v1?: PCAPFilter` The packet capture filter. When this field is empty, all packets are captured. - `packets_captured?: number` The number of packets captured. - `status?: "unknown" | "success" | "pending" | 5 more` The status of the packet capture request. - `"unknown"` - `"success"` - `"pending"` - `"running"` - `"conversion_pending"` - `"conversion_running"` - `"complete"` - `"failed"` - `stop_requested?: string` The RFC 3339 timestamp when stopping the packet capture was requested. This field only applies to `full` packet captures. - `submitted?: string` The RFC 3339 timestamp when the packet capture was created. - `system?: "magic-transit"` The system used to collect packet captures. - `"magic-transit"` - `time_limit?: number` The packet capture duration in seconds. - `type?: "simple" | "full"` The type of packet capture. `Simple` captures sampled packets, and `full` captures entire payloads and non-sampled packets. - `"simple"` - `"full"` ### PCAP Create Response - `PCAPCreateResponse = PCAP | MagicVisibilityPCAPsPCAPsResponseFull` - `PCAP` - `id?: string` The ID for the packet capture. - `filter_v1?: PCAPFilter` The packet capture filter. When this field is empty, all packets are captured. - `destination_address?: string` The destination IP address of the packet. - `destination_port?: number` The destination port of the packet. - `protocol?: number` The protocol number of the packet. - `source_address?: string` The source IP address of the packet. - `source_port?: number` The source port of the packet. - `offset_time?: string` The RFC 3339 offset timestamp from which to query backwards for packets. Must be within the last 24h. When this field is empty, defaults to time of request. - `status?: "unknown" | "success" | "pending" | 5 more` The status of the packet capture request. - `"unknown"` - `"success"` - `"pending"` - `"running"` - `"conversion_pending"` - `"conversion_running"` - `"complete"` - `"failed"` - `submitted?: string` The RFC 3339 timestamp when the packet capture was created. - `system?: "magic-transit"` The system used to collect packet captures. - `"magic-transit"` - `time_limit?: number` The packet capture duration in seconds. - `type?: "simple" | "full"` The type of packet capture. `Simple` captures sampled packets, and `full` captures entire payloads and non-sampled packets. - `"simple"` - `"full"` - `MagicVisibilityPCAPsPCAPsResponseFull` - `id?: string` The ID for the packet capture. - `byte_limit?: number` The maximum number of bytes to capture. This field only applies to `full` packet captures. - `colo_name?: string` The name of the data center used for the packet capture. This can be a specific colo (ord02) or a multi-colo name (ORD). This field only applies to `full` packet captures. - `destination_conf?: string` The full URI for the bucket. This field only applies to `full` packet captures. - `error_message?: string` An error message that describes why the packet capture failed. This field only applies to `full` packet captures. - `filter_v1?: PCAPFilter` The packet capture filter. When this field is empty, all packets are captured. - `packets_captured?: number` The number of packets captured. - `status?: "unknown" | "success" | "pending" | 5 more` The status of the packet capture request. - `"unknown"` - `"success"` - `"pending"` - `"running"` - `"conversion_pending"` - `"conversion_running"` - `"complete"` - `"failed"` - `stop_requested?: string` The RFC 3339 timestamp when stopping the packet capture was requested. This field only applies to `full` packet captures. - `submitted?: string` The RFC 3339 timestamp when the packet capture was created. - `system?: "magic-transit"` The system used to collect packet captures. - `"magic-transit"` - `time_limit?: number` The packet capture duration in seconds. - `type?: "simple" | "full"` The type of packet capture. `Simple` captures sampled packets, and `full` captures entire payloads and non-sampled packets. - `"simple"` - `"full"` # Ownership ## List PCAPs Bucket Ownership `client.magicTransit.pcaps.ownership.get(OwnershipGetParamsparams, RequestOptionsoptions?): SinglePage` **get** `/accounts/{account_id}/pcaps/ownership` List all buckets configured for use with PCAPs API. ### Parameters - `params: OwnershipGetParams` - `account_id: string` Identifier. ### Returns - `Ownership` - `id: string` The bucket ID associated with the packet captures API. - `destination_conf: string` The full URI for the bucket. This field only applies to `full` packet captures. - `filename: string` The ownership challenge filename stored in the bucket. - `status: "pending" | "success" | "failed"` The status of the ownership challenge. Can be pending, success or failed. - `"pending"` - `"success"` - `"failed"` - `submitted: string` The RFC 3339 timestamp when the bucket was added to packet captures API. - `validated?: string` The RFC 3339 timestamp when the bucket was validated. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const ownership of client.magicTransit.pcaps.ownership.get({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(ownership.id); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "id": "9883874ecac311ec8475433579a6bf5f", "destination_conf": "s3://pcaps-bucket?region=us-east-1", "filename": "ownership-challenge-9883874ecac311ec8475433579a6bf5f.txt", "status": "success", "submitted": "2020-01-01T08:00:00Z", "validated": "2020-01-01T08:00:00Z" } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Add buckets for full packet captures `client.magicTransit.pcaps.ownership.create(OwnershipCreateParamsparams, RequestOptionsoptions?): Ownership` **post** `/accounts/{account_id}/pcaps/ownership` Adds an AWS or GCP bucket to use with full packet captures. ### Parameters - `params: OwnershipCreateParams` - `account_id: string` Path param: Identifier. - `destination_conf: string` Body param: The full URI for the bucket. This field only applies to `full` packet captures. ### Returns - `Ownership` - `id: string` The bucket ID associated with the packet captures API. - `destination_conf: string` The full URI for the bucket. This field only applies to `full` packet captures. - `filename: string` The ownership challenge filename stored in the bucket. - `status: "pending" | "success" | "failed"` The status of the ownership challenge. Can be pending, success or failed. - `"pending"` - `"success"` - `"failed"` - `submitted: string` The RFC 3339 timestamp when the bucket was added to packet captures API. - `validated?: string` The RFC 3339 timestamp when the bucket was validated. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const ownership = await client.magicTransit.pcaps.ownership.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', destination_conf: 's3://pcaps-bucket?region=us-east-1', }); console.log(ownership.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "9883874ecac311ec8475433579a6bf5f", "destination_conf": "s3://pcaps-bucket?region=us-east-1", "filename": "ownership-challenge-9883874ecac311ec8475433579a6bf5f.txt", "status": "success", "submitted": "2020-01-01T08:00:00Z", "validated": "2020-01-01T08:00:00Z" }, "success": true } ``` ## Delete buckets for full packet captures `client.magicTransit.pcaps.ownership.delete(stringownershipId, OwnershipDeleteParamsparams, RequestOptionsoptions?): void` **delete** `/accounts/{account_id}/pcaps/ownership/{ownership_id}` Deletes buckets added to the packet captures API. ### Parameters - `ownershipId: string` Identifier. - `params: OwnershipDeleteParams` - `account_id: string` Identifier. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); await client.magicTransit.pcaps.ownership.delete('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); ``` ## Validate buckets for full packet captures `client.magicTransit.pcaps.ownership.validate(OwnershipValidateParamsparams, RequestOptionsoptions?): Ownership` **post** `/accounts/{account_id}/pcaps/ownership/validate` Validates buckets added to the packet captures API. ### Parameters - `params: OwnershipValidateParams` - `account_id: string` Path param: Identifier. - `destination_conf: string` Body param: The full URI for the bucket. This field only applies to `full` packet captures. - `ownership_challenge: string` Body param: The ownership challenge filename stored in the bucket. ### Returns - `Ownership` - `id: string` The bucket ID associated with the packet captures API. - `destination_conf: string` The full URI for the bucket. This field only applies to `full` packet captures. - `filename: string` The ownership challenge filename stored in the bucket. - `status: "pending" | "success" | "failed"` The status of the ownership challenge. Can be pending, success or failed. - `"pending"` - `"success"` - `"failed"` - `submitted: string` The RFC 3339 timestamp when the bucket was added to packet captures API. - `validated?: string` The RFC 3339 timestamp when the bucket was validated. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const ownership = await client.magicTransit.pcaps.ownership.validate({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', destination_conf: 's3://pcaps-bucket?region=us-east-1', ownership_challenge: 'ownership-challenge-9883874ecac311ec8475433579a6bf5f.txt', }); console.log(ownership.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "9883874ecac311ec8475433579a6bf5f", "destination_conf": "s3://pcaps-bucket?region=us-east-1", "filename": "ownership-challenge-9883874ecac311ec8475433579a6bf5f.txt", "status": "success", "submitted": "2020-01-01T08:00:00Z", "validated": "2020-01-01T08:00:00Z" }, "success": true } ``` ## Domain Types ### Ownership - `Ownership` - `id: string` The bucket ID associated with the packet captures API. - `destination_conf: string` The full URI for the bucket. This field only applies to `full` packet captures. - `filename: string` The ownership challenge filename stored in the bucket. - `status: "pending" | "success" | "failed"` The status of the ownership challenge. Can be pending, success or failed. - `"pending"` - `"success"` - `"failed"` - `submitted: string` The RFC 3339 timestamp when the bucket was added to packet captures API. - `validated?: string` The RFC 3339 timestamp when the bucket was validated. # Download ## Download Simple PCAP `client.magicTransit.pcaps.download.get(stringpcapId, DownloadGetParamsparams, RequestOptionsoptions?): Response` **get** `/accounts/{account_id}/pcaps/{pcap_id}/download` Download PCAP information into a file. Response is a binary PCAP file. ### Parameters - `pcapId: string` Identifier. - `params: DownloadGetParams` - `account_id: string` Identifier. ### Returns - `unnamed_schema_4 = Response` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const download = await client.magicTransit.pcaps.download.get('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(download); const content = await download.blob(); console.log(content); ```