apps
Creates, updates, deletes, gets or lists an apps resource.
Overview
| Name | apps |
| Type | Resource |
| Id | cloudflare.magic_transit.apps |
Fields
The following fields are returned by SELECT queries:
- list
List Apps response
| Name | Datatype | Description |
|---|---|---|
name | string | Display name for the app. (example: Cloudflare Dashboard) |
account_app_id | string | Magic account app ID. (example: ac60d3d0435248289d446cedd870bcf4) |
managed_app_id | string | Managed app ID. (example: cloudflare) |
hostnames | array | FQDNs to associate with traffic decisions. |
ip_subnets | array | IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) |
source_subnets | array | IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) |
type | string | Category of the app. (example: Development) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | account_id | Lists Apps associated with an account. | |
create | insert | account_id | Creates a new App for an account | |
edit | update | account_id, account_app_id | Updates an Account App | |
update | replace | account_id, account_app_id | Updates an Account App | |
delete | delete | account_id, account_app_id | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
account_app_id | string | |
account_id | string | The Cloudflare account ID. |
SELECT examples
- list
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
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: apps
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the apps resource.
- name: hostnames
value:
- "{{ hostnames }}"
description: |
FQDNs to associate with traffic decisions.
- name: ip_subnets
value:
- "{{ ip_subnets }}"
description: |
IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported)
- name: name
value: "{{ name }}"
description: |
Display name for the app.
- name: source_subnets
value:
- "{{ source_subnets }}"
description: |
IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported)
- name: type
value: "{{ type }}"
description: |
Category of the app.
UPDATE examples
- edit
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
- update
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
- delete
Deletes specific Account App.
DELETE FROM cloudflare.magic_transit.apps
WHERE account_id = '{{ account_id }}' --required
AND account_app_id = '{{ account_app_id }}' --required
;