# 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.