Skip to main content

apps

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

Overview

Nameapps
TypeResource
Idcloudflare.magic_transit.apps

Fields

The following fields are returned by SELECT queries:

List Apps response

NameDatatypeDescription
namestringDisplay name for the app. (example: Cloudflare Dashboard)
account_app_idstringMagic account app ID. (example: ac60d3d0435248289d446cedd870bcf4)
managed_app_idstringManaged app ID. (example: cloudflare)
hostnamesarrayFQDNs to associate with traffic decisions.
ip_subnetsarrayIPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported)
source_subnetsarrayIPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported)
typestringCategory of the app. (example: Development)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectaccount_idLists Apps associated with an account.
createinsertaccount_idCreates a new App for an account
editupdateaccount_id, account_app_idUpdates an Account App
updatereplaceaccount_id, account_app_idUpdates an Account App
deletedeleteaccount_id, account_app_idDeletes specific Account App.

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_app_idstring
account_idstringThe Cloudflare account ID.

SELECT examples

Lists Apps associated with an account.

SELECT
name,
account_app_id,
managed_app_id,
hostnames,
ip_subnets,
source_subnets,
type
FROM cloudflare.magic_transit.apps
WHERE account_id = '{{ account_id }}' -- required
;

INSERT examples

Creates a new App for an account

INSERT INTO cloudflare.magic_transit.apps (
hostnames,
ip_subnets,
name,
source_subnets,
type,
account_id
)
SELECT
'{{ hostnames }}',
'{{ ip_subnets }}',
'{{ name }}',
'{{ source_subnets }}',
'{{ type }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;

UPDATE examples

Updates an Account App

UPDATE cloudflare.magic_transit.apps
SET
hostnames = '{{ hostnames }}',
ip_subnets = '{{ ip_subnets }}',
name = '{{ name }}',
source_subnets = '{{ source_subnets }}',
type = '{{ type }}'
WHERE
account_id = '{{ account_id }}' --required
AND account_app_id = '{{ account_app_id }}' --required
RETURNING
errors,
messages,
result,
success;

REPLACE examples

Updates an Account App

REPLACE cloudflare.magic_transit.apps
SET
hostnames = '{{ hostnames }}',
ip_subnets = '{{ ip_subnets }}',
name = '{{ name }}',
source_subnets = '{{ source_subnets }}',
type = '{{ type }}'
WHERE
account_id = '{{ account_id }}' --required
AND account_app_id = '{{ account_app_id }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

Deletes specific Account App.

DELETE FROM cloudflare.magic_transit.apps
WHERE account_id = '{{ account_id }}' --required
AND account_app_id = '{{ account_app_id }}' --required
;