Skip to content
Start here

Sites

List Sites
magic_transit.sites.list(SiteListParams**kwargs) -> SyncSinglePage[Site]
GET/accounts/{account_id}/magic/sites
Site Details
magic_transit.sites.get(strsite_id, SiteGetParams**kwargs) -> Site
GET/accounts/{account_id}/magic/sites/{site_id}
Create a new Site
magic_transit.sites.create(SiteCreateParams**kwargs) -> Site
POST/accounts/{account_id}/magic/sites
Update Site
magic_transit.sites.update(strsite_id, SiteUpdateParams**kwargs) -> Site
PUT/accounts/{account_id}/magic/sites/{site_id}
Patch Site
magic_transit.sites.edit(strsite_id, SiteEditParams**kwargs) -> Site
PATCH/accounts/{account_id}/magic/sites/{site_id}
Delete Site
magic_transit.sites.delete(strsite_id, SiteDeleteParams**kwargs) -> Site
DELETE/accounts/{account_id}/magic/sites/{site_id}
ModelsExpand Collapse
class Site:
id: Optional[str]

Identifier

maxLength32
connector_id: Optional[str]

Magic Connector identifier tag.

description: Optional[str]
ha_mode: Optional[bool]

Site high availability mode. If set to true, the site can have two connectors and runs in high availability mode.

location: Optional[SiteLocation]

Location of site in latitude and longitude.

name: Optional[str]

The name of the site.

secondary_connector_id: Optional[str]

Magic Connector identifier tag. Used when high availability mode is on.

class SiteLocation:

Location of site in latitude and longitude.

lat: Optional[str]

Latitude

lon: Optional[str]

Longitude

SitesApp Configuration

SitesACLs

List Site ACLs
magic_transit.sites.acls.list(strsite_id, ACLListParams**kwargs) -> SyncSinglePage[ACL]
GET/accounts/{account_id}/magic/sites/{site_id}/acls
Site ACL Details
magic_transit.sites.acls.get(stracl_id, ACLGetParams**kwargs) -> ACL
GET/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_id}
Create a new Site ACL
magic_transit.sites.acls.create(strsite_id, ACLCreateParams**kwargs) -> ACL
POST/accounts/{account_id}/magic/sites/{site_id}/acls
Update Site ACL
magic_transit.sites.acls.update(stracl_id, ACLUpdateParams**kwargs) -> ACL
PUT/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_id}
Patch Site ACL
magic_transit.sites.acls.edit(stracl_id, ACLEditParams**kwargs) -> ACL
PATCH/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_id}
Delete Site ACL
magic_transit.sites.acls.delete(stracl_id, ACLDeleteParams**kwargs) -> ACL
DELETE/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_id}
ModelsExpand Collapse
class ACL:

Bidirectional ACL policy for network traffic within a site.

id: Optional[str]

Identifier

maxLength32
description: Optional[str]

Description for the ACL.

forward_locally: Optional[bool]

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: Optional[ACLConfiguration]
lan_2: Optional[ACLConfiguration]
name: Optional[str]

The name of the ACL.

protocols: Optional[List[AllowedProtocol]]
One of the following:
"tcp"
"udp"
"icmp"
unidirectional: Optional[bool]

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.

class ACLConfiguration:
lan_id: str

The identifier for the LAN you want to create an ACL policy with.

lan_name: Optional[str]

The name of the LAN based on the provided lan_id.

port_ranges: Optional[List[str]]

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: Optional[List[int]]

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: Optional[List[Subnet]]

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.

Literal["tcp", "udp", "icmp"]

Array of allowed communication protocols between configured LANs. If no protocols are provided, all protocols are allowed.

One of the following:
"tcp"
"udp"
"icmp"
str

A valid IPv4 address.

SitesLANs

List Site LANs
magic_transit.sites.lans.list(strsite_id, LANListParams**kwargs) -> SyncSinglePage[LAN]
GET/accounts/{account_id}/magic/sites/{site_id}/lans
Site LAN Details
magic_transit.sites.lans.get(strlan_id, LANGetParams**kwargs) -> LAN
GET/accounts/{account_id}/magic/sites/{site_id}/lans/{lan_id}
Create a new Site LAN
magic_transit.sites.lans.create(strsite_id, LANCreateParams**kwargs) -> SyncSinglePage[LAN]
POST/accounts/{account_id}/magic/sites/{site_id}/lans
Update Site LAN
magic_transit.sites.lans.update(strlan_id, LANUpdateParams**kwargs) -> LAN
PUT/accounts/{account_id}/magic/sites/{site_id}/lans/{lan_id}
Patch Site LAN
magic_transit.sites.lans.edit(strlan_id, LANEditParams**kwargs) -> LAN
PATCH/accounts/{account_id}/magic/sites/{site_id}/lans/{lan_id}
Delete Site LAN
magic_transit.sites.lans.delete(strlan_id, LANDeleteParams**kwargs) -> LAN
DELETE/accounts/{account_id}/magic/sites/{site_id}/lans/{lan_id}
ModelsExpand Collapse
class DHCPRelay:
server_addresses: Optional[List[str]]

List of DHCP server IPs.

class DHCPServer:
dhcp_pool_end: Optional[str]

A valid IPv4 address.

dhcp_pool_start: Optional[str]

A valid IPv4 address.

dns_server: Optional[str]

A valid IPv4 address.

dns_servers: Optional[List[str]]
reservations: Optional[Dict[str, str]]

Mapping of MAC addresses to IP addresses

class LAN:
id: Optional[str]

Identifier

maxLength32
bond_id: Optional[int]
is_breakout: Optional[bool]

mark true to use this LAN for source-based breakout traffic

is_prioritized: Optional[bool]

mark true to use this LAN for source-based prioritized traffic

name: Optional[str]
nat: Optional[Nat]
physport: Optional[int]
routed_subnets: Optional[List[RoutedSubnet]]
next_hop: str

A valid IPv4 address.

prefix: str

A valid CIDR notation representing an IP range.

nat: Optional[Nat]
site_id: Optional[str]

Identifier

maxLength32
static_addressing: Optional[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.

vlan_tag: Optional[int]

VLAN ID. Use zero for untagged.

class 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: str

A valid CIDR notation representing an IP range.

dhcp_relay: Optional[DHCPRelay]
dhcp_server: Optional[DHCPServer]
secondary_address: Optional[str]

A valid CIDR notation representing an IP range.

virtual_address: Optional[str]

A valid CIDR notation representing an IP range.

class Nat:
static_prefix: Optional[str]

A valid CIDR notation representing an IP range.

class RoutedSubnet:
next_hop: str

A valid IPv4 address.

prefix: str

A valid CIDR notation representing an IP range.

nat: Optional[Nat]

SitesWANs

List Site WANs
magic_transit.sites.wans.list(strsite_id, WANListParams**kwargs) -> SyncSinglePage[WAN]
GET/accounts/{account_id}/magic/sites/{site_id}/wans
Site WAN Details
magic_transit.sites.wans.get(strwan_id, WANGetParams**kwargs) -> WAN
GET/accounts/{account_id}/magic/sites/{site_id}/wans/{wan_id}
Create a new Site WAN
magic_transit.sites.wans.create(strsite_id, WANCreateParams**kwargs) -> SyncSinglePage[WAN]
POST/accounts/{account_id}/magic/sites/{site_id}/wans
Update Site WAN
magic_transit.sites.wans.update(strwan_id, WANUpdateParams**kwargs) -> WAN
PUT/accounts/{account_id}/magic/sites/{site_id}/wans/{wan_id}
Patch Site WAN
magic_transit.sites.wans.edit(strwan_id, WANEditParams**kwargs) -> WAN
PATCH/accounts/{account_id}/magic/sites/{site_id}/wans/{wan_id}
Delete Site WAN
magic_transit.sites.wans.delete(strwan_id, WANDeleteParams**kwargs) -> WAN
DELETE/accounts/{account_id}/magic/sites/{site_id}/wans/{wan_id}
ModelsExpand Collapse
class WAN:
id: Optional[str]

Identifier

maxLength32
health_check_rate: Optional[Literal["low", "mid", "high"]]

Magic WAN health check rate for tunnels created on this link. The default value is mid.

One of the following:
"low"
"mid"
"high"
name: Optional[str]
physport: Optional[int]
priority: Optional[int]

Priority of WAN for traffic loadbalancing.

site_id: Optional[str]

Identifier

maxLength32
static_addressing: Optional[WANStaticAddressing]

(optional) if omitted, use DHCP. Submit secondary_address when site is in high availability mode.

vlan_tag: Optional[int]

VLAN ID. Use zero for untagged.

class WANStaticAddressing:

(optional) if omitted, use DHCP. Submit secondary_address when site is in high availability mode.

address: str

A valid CIDR notation representing an IP range.

gateway_address: str

A valid IPv4 address.

secondary_address: Optional[str]

A valid CIDR notation representing an IP range.