Skip to main content

acls

Creates, updates, deletes, gets or lists an acls resource.

Overview

Nameacls
TypeResource
Idcloudflare.magic_transit.acls

Fields

The following fields are returned by SELECT queries:

Site ACL Details response

NameDatatypeDescription
idstringIdentifier (example: 023e105f4ecef8ad9ca31a8372d0c353)
namestringThe name of the ACL. (example: PIN Pad - Cash Register)
descriptionstringDescription for the ACL. (example: Allows local traffic between PIN pads and cash register.)
forward_locallybooleanThe 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_1object
lan_2object
protocolsarray
unidirectionalbooleanThe 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.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectsite_id, account_id, acl_idGet a specific Site ACL.
listselectaccount_id, site_idLists Site ACLs associated with an account.
createinsertaccount_id, site_id, name, lan_1, lan_2Creates a new Site ACL.
editupdatesite_id, account_id, acl_idPatch a specific Site ACL.
updatereplacesite_id, account_id, acl_idUpdate a specific Site ACL.
deletedeletesite_id, account_id, acl_idRemove a specific Site ACL.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
acl_idstring
site_idstringThe site ID.

SELECT examples

Get a specific Site ACL.

SELECT
id,
name,
description,
forward_locally,
lan_1,
lan_2,
protocols,
unidirectional
FROM cloudflare.magic_transit.acls
WHERE site_id = '{{ site_id }}' -- required
AND account_id = '{{ account_id }}' -- required
AND acl_id = '{{ acl_id }}' -- required
;

INSERT examples

Creates a new Site ACL.

INSERT INTO cloudflare.magic_transit.acls (
description,
forward_locally,
lan_1,
lan_2,
name,
protocols,
unidirectional,
account_id,
site_id
)
SELECT
'{{ description }}',
{{ forward_locally }},
'{{ lan_1 }}' /* required */,
'{{ lan_2 }}' /* required */,
'{{ name }}' /* required */,
'{{ protocols }}',
{{ unidirectional }},
'{{ account_id }}',
'{{ site_id }}'
RETURNING
errors,
messages,
result,
success
;

UPDATE examples

Patch a specific Site ACL.

UPDATE cloudflare.magic_transit.acls
SET
description = '{{ description }}',
forward_locally = {{ forward_locally }},
lan_1 = '{{ lan_1 }}',
lan_2 = '{{ lan_2 }}',
name = '{{ name }}',
protocols = '{{ protocols }}',
unidirectional = {{ unidirectional }}
WHERE
site_id = '{{ site_id }}' --required
AND account_id = '{{ account_id }}' --required
AND acl_id = '{{ acl_id }}' --required
RETURNING
errors,
messages,
result,
success;

REPLACE examples

Update a specific Site ACL.

REPLACE cloudflare.magic_transit.acls
SET
description = '{{ description }}',
forward_locally = {{ forward_locally }},
lan_1 = '{{ lan_1 }}',
lan_2 = '{{ lan_2 }}',
name = '{{ name }}',
protocols = '{{ protocols }}',
unidirectional = {{ unidirectional }}
WHERE
site_id = '{{ site_id }}' --required
AND account_id = '{{ account_id }}' --required
AND acl_id = '{{ acl_id }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

Remove a specific Site ACL.

DELETE FROM cloudflare.magic_transit.acls
WHERE site_id = '{{ site_id }}' --required
AND account_id = '{{ account_id }}' --required
AND acl_id = '{{ acl_id }}' --required
;