Skip to content
Start here

List Spectrum applications

client.Spectrum.Apps.List(ctx, params) (*V4PagePaginationArray[AppListResponse], error)
GET/zones/{zone_id}/spectrum/apps

Retrieves a list of currently existing Spectrum applications inside a zone.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Zone Settings WriteZone Settings Read
ParametersExpand Collapse
params AppListParams
ZoneID param.Field[string]

Path param: Zone identifier.

maxLength32
Direction param.Field[AppListParamsDirection]optional

Query param: Sets the direction by which results are ordered.

const AppListParamsDirectionAsc AppListParamsDirection = "asc"
const AppListParamsDirectionDesc AppListParamsDirection = "desc"
Order param.Field[AppListParamsOrder]optional

Query param: Application field by which results are ordered.

const AppListParamsOrderProtocol AppListParamsOrder = "protocol"
const AppListParamsOrderAppID AppListParamsOrder = "app_id"
const AppListParamsOrderCreatedOn AppListParamsOrder = "created_on"
const AppListParamsOrderModifiedOn AppListParamsOrder = "modified_on"
const AppListParamsOrderDNS AppListParamsOrder = "dns"
Page param.Field[float64]optional

Query param: Page number of paginated results. This parameter is required in order to use other pagination parameters. If included in the query, result_info will be present in the response.

minimum1
PerPage param.Field[float64]optional

Query param: Sets the maximum number of results per page.

maximum100
minimum1
ReturnsExpand Collapse
type AppListResponse interface{…}
One of the following:
type AppListResponseSpectrumConfigAppConfig struct{…}
ID string

App identifier.

maxLength32
CreatedOn Time

When the Application was created.

formatdate-time
DNS DNS

The name and type of DNS record for the Spectrum application.

Name stringoptional

The name of the DNS record associated with the application.

formathostname
Type DNSTypeoptional

The type of DNS record associated with the application.

One of the following:
const DNSTypeCNAME DNSType = "CNAME"
const DNSTypeAddress DNSType = "ADDRESS"
ModifiedOn Time

When the Application was last modified.

formatdate-time
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".

TrafficType AppListResponseSpectrumConfigAppConfigTrafficType

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.

One of the following:
const AppListResponseSpectrumConfigAppConfigTrafficTypeDirect AppListResponseSpectrumConfigAppConfigTrafficType = "direct"
const AppListResponseSpectrumConfigAppConfigTrafficTypeHTTP AppListResponseSpectrumConfigAppConfigTrafficType = "http"
const AppListResponseSpectrumConfigAppConfigTrafficTypeHTTPS AppListResponseSpectrumConfigAppConfigTrafficType = "https"
ArgoSmartRouting booloptional

Enables Argo Smart Routing for this application. Notes: Only available for TCP applications with traffic_type set to "direct".

EdgeIPs EdgeIPsoptional

The anycast edge IP configuration for the hostname of this application.

One of the following:
type EdgeIPsDynamic struct{…}
Connectivity EdgeIPsDynamicConnectivityoptional

The IP versions supported for inbound connections on Spectrum anycast IPs.

One of the following:
const EdgeIPsDynamicConnectivityAll EdgeIPsDynamicConnectivity = "all"
const EdgeIPsDynamicConnectivityIPV4 EdgeIPsDynamicConnectivity = "ipv4"
const EdgeIPsDynamicConnectivityIPV6 EdgeIPsDynamicConnectivity = "ipv6"
Type EdgeIPsDynamicTypeoptional

The type of edge IP configuration specified. Dynamically allocated edge IPs use Spectrum anycast IPs in accordance with the connectivity you specify. Only valid with CNAME DNS names.

type EdgeIPsStatic struct{…}
IPs []stringoptional

The array of customer owned IPs we broadcast via anycast for this hostname and application.

Type EdgeIPsStaticTypeoptional

The type of edge IP configuration specified. Statically allocated edge IPs use customer IPs in accordance with the ips array you specify. Only valid with ADDRESS DNS names.

IPFirewall booloptional

Enables IP Access Rules for this application. Notes: Only available for TCP applications.

OriginDirect []stringoptional

List of origin IP addresses. Array may contain multiple IP addresses for load balancing.

OriginDNS OriginDNSoptional

The name and type of DNS record for the Spectrum application.

Name stringoptional

The name of the DNS record associated with the origin.

formathostname
TTL int64optional

The TTL of our resolution of your DNS record in seconds.

minimum600
Type OriginDNSTypeoptional

The type of DNS record associated with the origin. "" is used to specify a combination of A/AAAA records.

One of the following:
const OriginDNSTypeEmpty OriginDNSType = ""
const OriginDNSTypeA OriginDNSType = "A"
const OriginDNSTypeAAAA OriginDNSType = "AAAA"
const OriginDNSTypeSRV OriginDNSType = "SRV"
OriginPort OriginPortUnionoptional

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.

maximum65535
minimum1
One of the following:
UnionInt
UnionString
ProxyProtocol AppListResponseSpectrumConfigAppConfigProxyProtocoloptional

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.

One of the following:
const AppListResponseSpectrumConfigAppConfigProxyProtocolOff AppListResponseSpectrumConfigAppConfigProxyProtocol = "off"
const AppListResponseSpectrumConfigAppConfigProxyProtocolV1 AppListResponseSpectrumConfigAppConfigProxyProtocol = "v1"
const AppListResponseSpectrumConfigAppConfigProxyProtocolV2 AppListResponseSpectrumConfigAppConfigProxyProtocol = "v2"
const AppListResponseSpectrumConfigAppConfigProxyProtocolSimple AppListResponseSpectrumConfigAppConfigProxyProtocol = "simple"
TLS AppListResponseSpectrumConfigAppConfigTLSoptional

The type of TLS termination associated with the application.

One of the following:
const AppListResponseSpectrumConfigAppConfigTLSOff AppListResponseSpectrumConfigAppConfigTLS = "off"
const AppListResponseSpectrumConfigAppConfigTLSFlexible AppListResponseSpectrumConfigAppConfigTLS = "flexible"
const AppListResponseSpectrumConfigAppConfigTLSFull AppListResponseSpectrumConfigAppConfigTLS = "full"
const AppListResponseSpectrumConfigAppConfigTLSStrict AppListResponseSpectrumConfigAppConfigTLS = "strict"
type AppListResponseSpectrumConfigPaygoAppConfig struct{…}
ID string

App identifier.

maxLength32
CreatedOn Time

When the Application was created.

formatdate-time
DNS DNS

The name and type of DNS record for the Spectrum application.

Name stringoptional

The name of the DNS record associated with the application.

formathostname
Type DNSTypeoptional

The type of DNS record associated with the application.

One of the following:
const DNSTypeCNAME DNSType = "CNAME"
const DNSTypeAddress DNSType = "ADDRESS"
ModifiedOn Time

When the Application was last modified.

formatdate-time
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".

OriginDirect []stringoptional

List of origin IP addresses. Array may contain multiple IP addresses for load balancing.

List Spectrum applications

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/option"
  "github.com/cloudflare/cloudflare-go/spectrum"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  page, err := client.Spectrum.Apps.List(context.TODO(), spectrum.AppListParams{
    ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": [
    {
      "id": "023e105f4ecef8ad9ca31a8372d0c353",
      "created_on": "2014-01-01T05:20:00.12345Z",
      "dns": {
        "name": "ssh.example.com",
        "type": "CNAME"
      },
      "modified_on": "2014-01-01T05:20:00.12345Z",
      "protocol": "tcp/22",
      "traffic_type": "direct",
      "argo_smart_routing": true,
      "edge_ips": {
        "connectivity": "all",
        "type": "dynamic"
      },
      "ip_firewall": false,
      "origin_direct": [
        "tcp://127.0.0.1:8080"
      ],
      "origin_dns": {
        "name": "origin.example.com",
        "ttl": 600,
        "type": ""
      },
      "origin_port": 22,
      "proxy_protocol": "off",
      "tls": "off"
    }
  ],
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": [
    {
      "id": "023e105f4ecef8ad9ca31a8372d0c353",
      "created_on": "2014-01-01T05:20:00.12345Z",
      "dns": {
        "name": "ssh.example.com",
        "type": "CNAME"
      },
      "modified_on": "2014-01-01T05:20:00.12345Z",
      "protocol": "tcp/22",
      "traffic_type": "direct",
      "argo_smart_routing": true,
      "edge_ips": {
        "connectivity": "all",
        "type": "dynamic"
      },
      "ip_firewall": false,
      "origin_direct": [
        "tcp://127.0.0.1:8080"
      ],
      "origin_dns": {
        "name": "origin.example.com",
        "ttl": 600,
        "type": ""
      },
      "origin_port": 22,
      "proxy_protocol": "off",
      "tls": "off"
    }
  ],
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  }
}