apps
Creates, updates, deletes, gets or lists an apps resource.
Overview
| Name | apps |
| Type | Resource |
| Id | cloudflare.spectrum.apps |
Fields
The following fields are returned by SELECT queries:
- get
- list
Get Spectrum application configuration response.
| Name | Datatype | Description |
|---|---|---|
id | string | App identifier. (example: 023e105f4ecef8ad9ca31a8372d0c353) |
argo_smart_routing | boolean | Enables Argo Smart Routing for this application. Notes: Only available for TCP applications with traffic_type set to "direct". |
created_on | string (date-time) | When the Application was created. (example: 2014-01-01T05:20:00.12345Z) |
dns | object | The name and type of DNS record for the Spectrum application. |
edge_ips | object | The anycast edge IP configuration for the hostname of this application. |
ip_firewall | boolean | Enables IP Access Rules for this application. Notes: Only available for TCP applications. |
modified_on | string (date-time) | When the Application was last modified. (example: 2014-01-01T05:20:00.12345Z) |
origin_direct | array | List of origin IP addresses. Array may contain multiple IP addresses for load balancing. |
origin_dns | object | The name and type of DNS record for the Spectrum application. |
origin_port | integer | The 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. |
protocol | string | The 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_protocol | string | Enables 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) |
tls | string | The type of TLS termination associated with the application. (off, flexible, full, strict) (default: off, example: off) |
traffic_type | string | Determines 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) |
List Spectrum applications response.
| Name | Datatype | Description |
|---|---|---|
id | string | App identifier. (example: 023e105f4ecef8ad9ca31a8372d0c353) |
argo_smart_routing | boolean | Enables Argo Smart Routing for this application. Notes: Only available for TCP applications with traffic_type set to "direct". |
created_on | string (date-time) | When the Application was created. (example: 2014-01-01T05:20:00.12345Z) |
dns | object | The name and type of DNS record for the Spectrum application. |
edge_ips | object | The anycast edge IP configuration for the hostname of this application. |
ip_firewall | boolean | Enables IP Access Rules for this application. Notes: Only available for TCP applications. |
modified_on | string (date-time) | When the Application was last modified. (example: 2014-01-01T05:20:00.12345Z) |
origin_direct | array | List of origin IP addresses. Array may contain multiple IP addresses for load balancing. |
origin_dns | object | The name and type of DNS record for the Spectrum application. |
origin_port | integer | The 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. |
protocol | string | The 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_protocol | string | Enables 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) |
tls | string | The type of TLS termination associated with the application. (off, flexible, full, strict) (default: off, example: off) |
traffic_type | string | Determines 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | app_id, zone_id | Gets the application configuration of a specific application inside a zone. | |
list | select | zone_id | page, per_page, direction, order | Retrieves a list of currently existing Spectrum applications inside a zone. |
create | insert | zone_id, dns, protocol | Creates a new Spectrum application from a configuration using a name for the origin. | |
update | replace | app_id, zone_id, dns, protocol | Updates a previously existing application's configuration that uses a name for the origin. | |
delete | delete | app_id, zone_id | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
app_id | string | The Access application ID. |
zone_id | string | The Cloudflare zone ID. |
direction | string | |
order | string | |
page | number | |
per_page | number |
SELECT examples
- get
- list
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
;
Retrieves a list of currently existing Spectrum applications 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 zone_id = '{{ zone_id }}' -- required
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
AND direction = '{{ direction }}'
AND order = '{{ order }}'
;
INSERT examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: apps
props:
- name: zone_id
value: "{{ zone_id }}"
description: Required parameter for the apps resource.
- name: argo_smart_routing
value: {{ argo_smart_routing }}
description: |
Enables Argo Smart Routing for this application. Notes: Only available for TCP applications with traffic_type set to "direct".
default: false
- name: dns
description: |
The name and type of DNS record for the Spectrum application.
value:
name: "{{ name }}"
type: "{{ type }}"
- name: edge_ips
description: |
The anycast edge IP configuration for the hostname of this application.
value:
connectivity: "{{ connectivity }}"
type: "{{ type }}"
ips:
- "{{ ips }}"
default: [object Object]
- name: ip_firewall
value: {{ ip_firewall }}
description: |
Enables IP Access Rules for this application. Notes: Only available for TCP applications.
default: false
- name: origin_direct
value:
- "{{ origin_direct }}"
description: |
List of origin IP addresses. Array may contain multiple IP addresses for load balancing.
- name: origin_dns
description: |
The name and type of DNS record for the Spectrum application.
value:
name: "{{ name }}"
ttl: {{ ttl }}
type: "{{ type }}"
- name: origin_port
value: {{ origin_port }}
description: |
The 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.
- name: protocol
value: "{{ protocol }}"
description: |
The 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"`.
- name: proxy_protocol
value: "{{ proxy_protocol }}"
description: |
Enables Proxy Protocol to the origin. Refer to [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple Proxy Protocol.
valid_values: ['off', 'v1', 'v2', 'simple']
default: off
- name: tls
value: "{{ tls }}"
description: |
The type of TLS termination associated with the application.
valid_values: ['off', 'flexible', 'full', 'strict']
default: off
- name: traffic_type
value: "{{ traffic_type }}"
description: |
Determines 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.
valid_values: ['direct', 'http', 'https']
default: direct
REPLACE examples
- update
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
- delete
Deletes a previously existing application.
DELETE FROM cloudflare.spectrum.apps
WHERE app_id = '{{ app_id }}' --required
AND zone_id = '{{ zone_id }}' --required
;