Skip to main content

apps

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

Overview

Nameapps
TypeResource
Idcloudflare.spectrum.apps

Fields

The following fields are returned by SELECT queries:

Get Spectrum application configuration response.

NameDatatypeDescription
idstringApp identifier. (example: 023e105f4ecef8ad9ca31a8372d0c353)
argo_smart_routingbooleanEnables Argo Smart Routing for this application. Notes: Only available for TCP applications with traffic_type set to "direct".
created_onstring (date-time)When the Application was created. (example: 2014-01-01T05:20:00.12345Z)
dnsobjectThe name and type of DNS record for the Spectrum application.
edge_ipsobjectThe anycast edge IP configuration for the hostname of this application.
ip_firewallbooleanEnables IP Access Rules for this application. Notes: Only available for TCP applications.
modified_onstring (date-time)When the Application was last modified. (example: 2014-01-01T05:20:00.12345Z)
origin_directarrayList of origin IP addresses. Array may contain multiple IP addresses for load balancing.
origin_dnsobjectThe name and type of DNS record for the Spectrum application.
origin_portintegerThe destination port at the origin. Only specified in conjunction with origin_dns. May use an integer to specify a single origin port, for example 1000, or a string to specify a range of origin ports, for example "1000-2000". Notes: If specifying a port range, the number of ports in the range must match the number of ports specified in the "protocol" field.
protocolstringThe port configuration at Cloudflare's edge. May specify a single port, for example "tcp/1000", or a range of ports, for example "tcp/1000-2000". (example: tcp/22)
proxy_protocolstringEnables Proxy Protocol to the origin. Refer to Enable Proxy protocol for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple Proxy Protocol. (off, v1, v2, simple) (default: off, example: off)
tlsstringThe type of TLS termination associated with the application. (off, flexible, full, strict) (default: off, example: off)
traffic_typestringDetermines how data travels from the edge to your origin. When set to "direct", Spectrum will send traffic directly to your origin, and the application's type is derived from the protocol. When set to "http" or "https", Spectrum will apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and the application type matches this property exactly. (direct, http, https) (default: direct, example: direct)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectapp_id, zone_idGets the application configuration of a specific application inside a zone.
listselectzone_idpage, per_page, direction, orderRetrieves a list of currently existing Spectrum applications inside a zone.
createinsertzone_id, dns, protocolCreates a new Spectrum application from a configuration using a name for the origin.
updatereplaceapp_id, zone_id, dns, protocolUpdates a previously existing application's configuration that uses a name for the origin.
deletedeleteapp_id, zone_idDeletes a previously existing application.

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
app_idstringThe Access application ID.
zone_idstringThe Cloudflare zone ID.
directionstring
orderstring
pagenumber
per_pagenumber

SELECT examples

Gets the application configuration of a specific application inside a zone.

SELECT
id,
argo_smart_routing,
created_on,
dns,
edge_ips,
ip_firewall,
modified_on,
origin_direct,
origin_dns,
origin_port,
protocol,
proxy_protocol,
tls,
traffic_type
FROM cloudflare.spectrum.apps
WHERE app_id = '{{ app_id }}' -- required
AND zone_id = '{{ zone_id }}' -- required
;

INSERT examples

Creates a new Spectrum application from a configuration using a name for the origin.

INSERT INTO cloudflare.spectrum.apps (
argo_smart_routing,
dns,
edge_ips,
ip_firewall,
origin_direct,
origin_dns,
origin_port,
protocol,
proxy_protocol,
tls,
traffic_type,
zone_id
)
SELECT
{{ argo_smart_routing }},
'{{ dns }}' /* required */,
'{{ edge_ips }}',
{{ ip_firewall }},
'{{ origin_direct }}',
'{{ origin_dns }}',
{{ origin_port }},
'{{ protocol }}' /* required */,
'{{ proxy_protocol }}',
'{{ tls }}',
'{{ traffic_type }}',
'{{ zone_id }}'
RETURNING
errors,
messages,
result,
success
;

REPLACE examples

Updates a previously existing application's configuration that uses a name for the origin.

REPLACE cloudflare.spectrum.apps
SET
argo_smart_routing = {{ argo_smart_routing }},
dns = '{{ dns }}',
edge_ips = '{{ edge_ips }}',
ip_firewall = {{ ip_firewall }},
origin_direct = '{{ origin_direct }}',
origin_dns = '{{ origin_dns }}',
origin_port = {{ origin_port }},
protocol = '{{ protocol }}',
proxy_protocol = '{{ proxy_protocol }}',
tls = '{{ tls }}',
traffic_type = '{{ traffic_type }}'
WHERE
app_id = '{{ app_id }}' --required
AND zone_id = '{{ zone_id }}' --required
AND dns = '{{ dns }}' --required
AND protocol = '{{ protocol }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

Deletes a previously existing application.

DELETE FROM cloudflare.spectrum.apps
WHERE app_id = '{{ app_id }}' --required
AND zone_id = '{{ zone_id }}' --required
;