Skip to content
Start here

Sites

List Sites
client.MagicTransit.Sites.List(ctx, params) (*SinglePage[Site], error)
GET/accounts/{account_id}/magic/sites
Site Details
client.MagicTransit.Sites.Get(ctx, siteID, params) (*Site, error)
GET/accounts/{account_id}/magic/sites/{site_id}
Create a new Site
client.MagicTransit.Sites.New(ctx, params) (*Site, error)
POST/accounts/{account_id}/magic/sites
Update Site
client.MagicTransit.Sites.Update(ctx, siteID, params) (*Site, error)
PUT/accounts/{account_id}/magic/sites/{site_id}
Patch Site
client.MagicTransit.Sites.Edit(ctx, siteID, params) (*Site, error)
PATCH/accounts/{account_id}/magic/sites/{site_id}
Delete Site
client.MagicTransit.Sites.Delete(ctx, siteID, body) (*Site, error)
DELETE/accounts/{account_id}/magic/sites/{site_id}
ModelsExpand Collapse
type Site struct{…}
ID stringoptional

Identifier

maxLength32
ConnectorID stringoptional

Magic Connector identifier tag.

Description stringoptional
HaMode booloptional

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

Location SiteLocationoptional

Location of site in latitude and longitude.

Name stringoptional

The name of the site.

SecondaryConnectorID stringoptional

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

type SiteLocation struct{…}

Location of site in latitude and longitude.

Lat stringoptional

Latitude

Lon stringoptional

Longitude

SitesApp Configuration

SitesACLs

List Site ACLs
client.MagicTransit.Sites.ACLs.List(ctx, siteID, query) (*SinglePage[ACL], error)
GET/accounts/{account_id}/magic/sites/{site_id}/acls
Site ACL Details
client.MagicTransit.Sites.ACLs.Get(ctx, siteID, aclID, query) (*ACL, error)
GET/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_id}
Create a new Site ACL
client.MagicTransit.Sites.ACLs.New(ctx, siteID, params) (*ACL, error)
POST/accounts/{account_id}/magic/sites/{site_id}/acls
Update Site ACL
client.MagicTransit.Sites.ACLs.Update(ctx, siteID, aclID, params) (*ACL, error)
PUT/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_id}
Patch Site ACL
client.MagicTransit.Sites.ACLs.Edit(ctx, siteID, aclID, params) (*ACL, error)
PATCH/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_id}
Delete Site ACL
client.MagicTransit.Sites.ACLs.Delete(ctx, siteID, aclID, body) (*ACL, error)
DELETE/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_id}
ModelsExpand Collapse
type ACL struct{…}

Bidirectional ACL policy for network traffic within a site.

ID stringoptional

Identifier

maxLength32
Description stringoptional

Description for the ACL.

ForwardLocally booloptional

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.

LAN1 ACLConfigurationoptional
LAN2 ACLConfigurationoptional
Name stringoptional

The name of the ACL.

Protocols []AllowedProtocoloptional
One of the following:
const AllowedProtocolTCP AllowedProtocol = "tcp"
const AllowedProtocolUdp AllowedProtocol = "udp"
const AllowedProtocolIcmp AllowedProtocol = "icmp"
Unidirectional booloptional

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.

type ACLConfiguration struct{…}
LANID string

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

LANName stringoptional

The name of the LAN based on the provided lan_id.

PortRanges []stringoptional

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 []int64optional

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 []Subnetoptional

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.

type AllowedProtocol string

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

One of the following:
const AllowedProtocolTCP AllowedProtocol = "tcp"
const AllowedProtocolUdp AllowedProtocol = "udp"
const AllowedProtocolIcmp AllowedProtocol = "icmp"
type Subnet string

A valid IPv4 address.

SitesLANs

List Site LANs
client.MagicTransit.Sites.LANs.List(ctx, siteID, query) (*SinglePage[LAN], error)
GET/accounts/{account_id}/magic/sites/{site_id}/lans
Site LAN Details
client.MagicTransit.Sites.LANs.Get(ctx, siteID, lanID, query) (*LAN, error)
GET/accounts/{account_id}/magic/sites/{site_id}/lans/{lan_id}
Create a new Site LAN
client.MagicTransit.Sites.LANs.New(ctx, siteID, params) (*SinglePage[LAN], error)
POST/accounts/{account_id}/magic/sites/{site_id}/lans
Update Site LAN
client.MagicTransit.Sites.LANs.Update(ctx, siteID, lanID, params) (*LAN, error)
PUT/accounts/{account_id}/magic/sites/{site_id}/lans/{lan_id}
Patch Site LAN
client.MagicTransit.Sites.LANs.Edit(ctx, siteID, lanID, params) (*LAN, error)
PATCH/accounts/{account_id}/magic/sites/{site_id}/lans/{lan_id}
Delete Site LAN
client.MagicTransit.Sites.LANs.Delete(ctx, siteID, lanID, body) (*LAN, error)
DELETE/accounts/{account_id}/magic/sites/{site_id}/lans/{lan_id}
ModelsExpand Collapse
type DHCPRelay struct{…}
ServerAddresses []stringoptional

List of DHCP server IPs.

type DHCPServer struct{…}
DHCPPoolEnd stringoptional

A valid IPv4 address.

DHCPPoolStart stringoptional

A valid IPv4 address.

DNSServer stringoptional

A valid IPv4 address.

DNSServers []stringoptional
Reservations map[string, string]optional

Mapping of MAC addresses to IP addresses

type LAN struct{…}
ID stringoptional

Identifier

maxLength32
BondID int64optional
IsBreakout booloptional

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

IsPrioritized booloptional

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

Name stringoptional
Nat Natoptional
Physport int64optional
RoutedSubnets []RoutedSubnetoptional
NextHop string

A valid IPv4 address.

Prefix string

A valid CIDR notation representing an IP range.

Nat Natoptional
SiteID stringoptional

Identifier

maxLength32
StaticAddressing LANStaticAddressingoptional

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.

VlanTag int64optional

VLAN ID. Use zero for untagged.

type LANStaticAddressing struct{…}

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.

DHCPRelay DHCPRelayoptional
DHCPServer DHCPServeroptional
SecondaryAddress stringoptional

A valid CIDR notation representing an IP range.

VirtualAddress stringoptional

A valid CIDR notation representing an IP range.

type Nat struct{…}
StaticPrefix stringoptional

A valid CIDR notation representing an IP range.

type RoutedSubnet struct{…}
NextHop string

A valid IPv4 address.

Prefix string

A valid CIDR notation representing an IP range.

Nat Natoptional

SitesWANs

List Site WANs
client.MagicTransit.Sites.WANs.List(ctx, siteID, query) (*SinglePage[WAN], error)
GET/accounts/{account_id}/magic/sites/{site_id}/wans
Site WAN Details
client.MagicTransit.Sites.WANs.Get(ctx, siteID, wanID, query) (*WAN, error)
GET/accounts/{account_id}/magic/sites/{site_id}/wans/{wan_id}
Create a new Site WAN
client.MagicTransit.Sites.WANs.New(ctx, siteID, params) (*SinglePage[WAN], error)
POST/accounts/{account_id}/magic/sites/{site_id}/wans
Update Site WAN
client.MagicTransit.Sites.WANs.Update(ctx, siteID, wanID, params) (*WAN, error)
PUT/accounts/{account_id}/magic/sites/{site_id}/wans/{wan_id}
Patch Site WAN
client.MagicTransit.Sites.WANs.Edit(ctx, siteID, wanID, params) (*WAN, error)
PATCH/accounts/{account_id}/magic/sites/{site_id}/wans/{wan_id}
Delete Site WAN
client.MagicTransit.Sites.WANs.Delete(ctx, siteID, wanID, body) (*WAN, error)
DELETE/accounts/{account_id}/magic/sites/{site_id}/wans/{wan_id}
ModelsExpand Collapse
type WAN struct{…}
ID stringoptional

Identifier

maxLength32
HealthCheckRate WANHealthCheckRateoptional

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

One of the following:
const WANHealthCheckRateLow WANHealthCheckRate = "low"
const WANHealthCheckRateMid WANHealthCheckRate = "mid"
const WANHealthCheckRateHigh WANHealthCheckRate = "high"
Name stringoptional
Physport int64optional
Priority int64optional

Priority of WAN for traffic loadbalancing.

SiteID stringoptional

Identifier

maxLength32
StaticAddressing WANStaticAddressingoptional

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

VlanTag int64optional

VLAN ID. Use zero for untagged.

type WANStaticAddressing struct{…}

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

GatewayAddress string

A valid IPv4 address.

SecondaryAddress stringoptional

A valid CIDR notation representing an IP range.