Skip to content
Start here

List Cloudflare colos

client.ZeroTrust.DEX.Colos.List(ctx, params) (*SinglePage[DEXColoListResponse], error)
GET/accounts/{account_id}/dex/colos

List Cloudflare colos that account's devices were connected to during a time period, sorted by usage starting from the most used colo. Colos without traffic are also returned and sorted alphabetically.

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)
Cloudflare DEX WriteCloudflare DEX ReadZero Trust ReportZero Trust Read
ParametersExpand Collapse
params DEXColoListParams
AccountID param.Field[string]

Path param: unique identifier linked to an account in the API request path.

maxLength32
From param.Field[string]

Query param: Start time for connection period in ISO (RFC3339 - ISO 8601) format

To param.Field[string]

Query param: End time for connection period in ISO (RFC3339 - ISO 8601) format

SortBy param.Field[DEXColoListParamsSortBy]optional

Query param: Type of usage that colos should be sorted by. If unspecified, returns all Cloudflare colos sorted alphabetically.

const DEXColoListParamsSortByFleetStatusUsage DEXColoListParamsSortBy = "fleet-status-usage"
const DEXColoListParamsSortByApplicationTestsUsage DEXColoListParamsSortBy = "application-tests-usage"
ReturnsExpand Collapse
type DEXColoListResponse struct{…}
AirportCode string

Airport code

City string

City

CountryCode string

Country code

List Cloudflare colos

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  page, err := client.ZeroTrust.DEX.Colos.List(context.TODO(), zero_trust.DEXColoListParams{
    AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"),
    From: cloudflare.F("2023-08-20T20:45:00Z"),
    To: cloudflare.F("2023-08-24T20:45:00Z"),
  })
  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": [
    {
      "airportCode": "SFO",
      "city": "San Francisco",
      "countryCode": "US"
    }
  ]
}
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": [
    {
      "airportCode": "SFO",
      "city": "San Francisco",
      "countryCode": "US"
    }
  ]
}