Skip to content
Start here

List DEX test analytics

client.ZeroTrust.DEX.Tests.List(ctx, params) (*V4PagePagination[Tests], error)
GET/accounts/{account_id}/dex/tests/overview

List DEX tests with overview metrics

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 DEXTestListParams
AccountID param.Field[string]

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

maxLength32
Colo param.Field[string]optional

Query param: Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param.

DeviceID param.Field[[]string]optional

Query param: Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param.

Kind param.Field[DEXTestListParamsKind]optional

Query param: Filter by test type

const DEXTestListParamsKindHTTP DEXTestListParamsKind = "http"
const DEXTestListParamsKindTraceroute DEXTestListParamsKind = "traceroute"
Page param.Field[float64]optional

Query param: Page number of paginated results

minimum1
PerPage param.Field[float64]optional

Query param: Number of items per page

maximum50
minimum1
TestName param.Field[string]optional

Query param: Optionally filter results by test name

ReturnsExpand Collapse
type Tests struct{…}
OverviewMetrics TestsOverviewMetrics
TestsTotal int64

number of tests.

AvgHTTPAvailabilityPct float64optional

percentage availability for all HTTP test results in response

formatfloat
AvgTracerouteAvailabilityPct float64optional

percentage availability for all traceroutes results in response

formatfloat
Tests []TestsTest

array of test results objects.

ID string

API Resource UUID tag.

maxLength36
Created string

date the test was created.

Description string

the test description defined during configuration

Enabled bool

if true, then the test will run on targeted devices. Else, the test will not run.

Host string
Interval string

The interval at which the synthetic application test is set to run.

Kind TestsTestsKind

test type, http or traceroute

One of the following:
const TestsTestsKindHTTP TestsTestsKind = "http"
const TestsTestsKindTraceroute TestsTestsKind = "traceroute"
Name string

name given to this test

Updated string
HTTPResults TestsTestsHTTPResultsoptional
ResourceFetchTime TestsTestsHTTPResultsResourceFetchTime
History []TestsTestsHTTPResultsResourceFetchTimeHistory
Units AggregateTimePeriodUnits
One of the following:
const AggregateTimePeriodUnitsHours AggregateTimePeriodUnits = "hours"
const AggregateTimePeriodUnitsDays AggregateTimePeriodUnits = "days"
const AggregateTimePeriodUnitsTestRuns AggregateTimePeriodUnits = "testRuns"
Value int64
AvgMs int64optional
DeltaPct float64optional
formatfloat
AvgMs int64optional
OverTime TestsTestsHTTPResultsResourceFetchTimeOverTimeoptional
Units AggregateTimePeriodUnits
One of the following:
const AggregateTimePeriodUnitsHours AggregateTimePeriodUnits = "hours"
const AggregateTimePeriodUnitsDays AggregateTimePeriodUnits = "days"
const AggregateTimePeriodUnitsTestRuns AggregateTimePeriodUnits = "testRuns"
Value int64
Values []TestsTestsHTTPResultsResourceFetchTimeOverTimeValue
AvgMs int64
Timestamp string
HTTPResultsByColo []TestsTestsHTTPResultsByColooptional
Colo string

Cloudflare colo

ResourceFetchTime TestsTestsHTTPResultsByColoResourceFetchTime
History []TestsTestsHTTPResultsByColoResourceFetchTimeHistory
Units AggregateTimePeriodUnits
One of the following:
const AggregateTimePeriodUnitsHours AggregateTimePeriodUnits = "hours"
const AggregateTimePeriodUnitsDays AggregateTimePeriodUnits = "days"
const AggregateTimePeriodUnitsTestRuns AggregateTimePeriodUnits = "testRuns"
Value int64
AvgMs int64optional
DeltaPct float64optional
formatfloat
AvgMs int64optional
OverTime TestsTestsHTTPResultsByColoResourceFetchTimeOverTimeoptional
Units AggregateTimePeriodUnits
One of the following:
const AggregateTimePeriodUnitsHours AggregateTimePeriodUnits = "hours"
const AggregateTimePeriodUnitsDays AggregateTimePeriodUnits = "days"
const AggregateTimePeriodUnitsTestRuns AggregateTimePeriodUnits = "testRuns"
Value int64
Values []TestsTestsHTTPResultsByColoResourceFetchTimeOverTimeValue
AvgMs int64
Timestamp string
Method stringoptional

for HTTP, the method to use when running the test

TargetPolicies []DigitalExperienceMonitoroptional
ID string

API Resource UUID tag.

maxLength36
Default bool

Whether the policy is the default for the account

Name string
Targeted booloptional
TracerouteResults TestsTestsTracerouteResultsoptional
RoundTripTime TestsTestsTracerouteResultsRoundTripTime
History []TestsTestsTracerouteResultsRoundTripTimeHistory
Units AggregateTimePeriodUnits
One of the following:
const AggregateTimePeriodUnitsHours AggregateTimePeriodUnits = "hours"
const AggregateTimePeriodUnitsDays AggregateTimePeriodUnits = "days"
const AggregateTimePeriodUnitsTestRuns AggregateTimePeriodUnits = "testRuns"
Value int64
AvgMs int64optional
DeltaPct float64optional
formatfloat
AvgMs int64optional
OverTime TestsTestsTracerouteResultsRoundTripTimeOverTimeoptional
Units AggregateTimePeriodUnits
One of the following:
const AggregateTimePeriodUnitsHours AggregateTimePeriodUnits = "hours"
const AggregateTimePeriodUnitsDays AggregateTimePeriodUnits = "days"
const AggregateTimePeriodUnitsTestRuns AggregateTimePeriodUnits = "testRuns"
Value int64
Values []TestsTestsTracerouteResultsRoundTripTimeOverTimeValue
AvgMs int64
Timestamp string
TracerouteResultsByColo []TestsTestsTracerouteResultsByColooptional
Colo string

Cloudflare colo

RoundTripTime TestsTestsTracerouteResultsByColoRoundTripTime
History []TestsTestsTracerouteResultsByColoRoundTripTimeHistory
Units AggregateTimePeriodUnits
One of the following:
const AggregateTimePeriodUnitsHours AggregateTimePeriodUnits = "hours"
const AggregateTimePeriodUnitsDays AggregateTimePeriodUnits = "days"
const AggregateTimePeriodUnitsTestRuns AggregateTimePeriodUnits = "testRuns"
Value int64
AvgMs int64optional
DeltaPct float64optional
formatfloat
AvgMs int64optional
OverTime TestsTestsTracerouteResultsByColoRoundTripTimeOverTimeoptional
Units AggregateTimePeriodUnits
One of the following:
const AggregateTimePeriodUnitsHours AggregateTimePeriodUnits = "hours"
const AggregateTimePeriodUnitsDays AggregateTimePeriodUnits = "days"
const AggregateTimePeriodUnitsTestRuns AggregateTimePeriodUnits = "testRuns"
Value int64
Values []TestsTestsTracerouteResultsByColoRoundTripTimeOverTimeValue
AvgMs int64
Timestamp string

List DEX test analytics

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.Tests.List(context.TODO(), zero_trust.DEXTestListParams{
    AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"),
  })
  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": {
    "overviewMetrics": {
      "testsTotal": 0,
      "avgHttpAvailabilityPct": 0,
      "avgTracerouteAvailabilityPct": 0
    },
    "tests": [
      {
        "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
        "created": "created",
        "description": "description",
        "enabled": true,
        "host": "host",
        "interval": "interval",
        "kind": "http",
        "name": "name",
        "updated": "updated",
        "httpResults": {
          "resourceFetchTime": {
            "history": [
              {
                "timePeriod": {
                  "units": "hours",
                  "value": 0
                },
                "avgMs": 0,
                "deltaPct": 0
              }
            ],
            "avgMs": 0,
            "overTime": {
              "timePeriod": {
                "units": "hours",
                "value": 0
              },
              "values": [
                {
                  "avgMs": 0,
                  "timestamp": "timestamp"
                }
              ]
            }
          }
        },
        "httpResultsByColo": [
          {
            "colo": "SJC",
            "resourceFetchTime": {
              "history": [
                {
                  "timePeriod": {
                    "units": "hours",
                    "value": 0
                  },
                  "avgMs": 0,
                  "deltaPct": 0
                }
              ],
              "avgMs": 0,
              "overTime": {
                "timePeriod": {
                  "units": "hours",
                  "value": 0
                },
                "values": [
                  {
                    "avgMs": 0,
                    "timestamp": "timestamp"
                  }
                ]
              }
            }
          }
        ],
        "method": "method",
        "target_policies": [
          {
            "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
            "default": true,
            "name": "name"
          }
        ],
        "targeted": true,
        "tracerouteResults": {
          "roundTripTime": {
            "history": [
              {
                "timePeriod": {
                  "units": "hours",
                  "value": 0
                },
                "avgMs": 0,
                "deltaPct": 0
              }
            ],
            "avgMs": 0,
            "overTime": {
              "timePeriod": {
                "units": "hours",
                "value": 0
              },
              "values": [
                {
                  "avgMs": 0,
                  "timestamp": "timestamp"
                }
              ]
            }
          }
        },
        "tracerouteResultsByColo": [
          {
            "colo": "SJC",
            "roundTripTime": {
              "history": [
                {
                  "timePeriod": {
                    "units": "hours",
                    "value": 0
                  },
                  "avgMs": 0,
                  "deltaPct": 0
                }
              ],
              "avgMs": 0,
              "overTime": {
                "timePeriod": {
                  "units": "hours",
                  "value": 0
                },
                "values": [
                  {
                    "avgMs": 0,
                    "timestamp": "timestamp"
                  }
                ]
              }
            }
          }
        ]
      }
    ]
  }
}
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": {
    "overviewMetrics": {
      "testsTotal": 0,
      "avgHttpAvailabilityPct": 0,
      "avgTracerouteAvailabilityPct": 0
    },
    "tests": [
      {
        "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
        "created": "created",
        "description": "description",
        "enabled": true,
        "host": "host",
        "interval": "interval",
        "kind": "http",
        "name": "name",
        "updated": "updated",
        "httpResults": {
          "resourceFetchTime": {
            "history": [
              {
                "timePeriod": {
                  "units": "hours",
                  "value": 0
                },
                "avgMs": 0,
                "deltaPct": 0
              }
            ],
            "avgMs": 0,
            "overTime": {
              "timePeriod": {
                "units": "hours",
                "value": 0
              },
              "values": [
                {
                  "avgMs": 0,
                  "timestamp": "timestamp"
                }
              ]
            }
          }
        },
        "httpResultsByColo": [
          {
            "colo": "SJC",
            "resourceFetchTime": {
              "history": [
                {
                  "timePeriod": {
                    "units": "hours",
                    "value": 0
                  },
                  "avgMs": 0,
                  "deltaPct": 0
                }
              ],
              "avgMs": 0,
              "overTime": {
                "timePeriod": {
                  "units": "hours",
                  "value": 0
                },
                "values": [
                  {
                    "avgMs": 0,
                    "timestamp": "timestamp"
                  }
                ]
              }
            }
          }
        ],
        "method": "method",
        "target_policies": [
          {
            "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
            "default": true,
            "name": "name"
          }
        ],
        "targeted": true,
        "tracerouteResults": {
          "roundTripTime": {
            "history": [
              {
                "timePeriod": {
                  "units": "hours",
                  "value": 0
                },
                "avgMs": 0,
                "deltaPct": 0
              }
            ],
            "avgMs": 0,
            "overTime": {
              "timePeriod": {
                "units": "hours",
                "value": 0
              },
              "values": [
                {
                  "avgMs": 0,
                  "timestamp": "timestamp"
                }
              ]
            }
          }
        },
        "tracerouteResultsByColo": [
          {
            "colo": "SJC",
            "roundTripTime": {
              "history": [
                {
                  "timePeriod": {
                    "units": "hours",
                    "value": 0
                  },
                  "avgMs": 0,
                  "deltaPct": 0
                }
              ],
              "avgMs": 0,
              "overTime": {
                "timePeriod": {
                  "units": "hours",
                  "value": 0
                },
                "values": [
                  {
                    "avgMs": 0,
                    "timestamp": "timestamp"
                  }
                ]
              }
            }
          }
        ]
      }
    ]
  }
}