Skip to content
Start here

List DEX test analytics

zero_trust.dex.tests.list(TestListParams**kwargs) -> SyncV4PagePagination[Optional[Tests]]
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
account_id: str
maxLength32
colo: Optional[str]

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

device_id: Optional[SequenceNotStr[str]]

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

kind: Optional[Literal["http", "traceroute"]]

Filter by test type

One of the following:
"http"
"traceroute"
page: Optional[float]

Page number of paginated results

minimum1
per_page: Optional[float]

Number of items per page

maximum50
minimum1
test_name: Optional[str]

Optionally filter results by test name

ReturnsExpand Collapse
class Tests:
overview_metrics: OverviewMetrics
tests_total: int

number of tests.

avg_http_availability_pct: Optional[float]

percentage availability for all HTTP test results in response

formatfloat
avg_traceroute_availability_pct: Optional[float]

percentage availability for all traceroutes results in response

formatfloat
tests: List[Test]

array of test results objects.

id: str

API Resource UUID tag.

maxLength36
created: str

date the test was created.

description: str

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: str
interval: str

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

kind: Literal["http", "traceroute"]

test type, http or traceroute

One of the following:
"http"
"traceroute"
name: str

name given to this test

updated: str
http_results: Optional[TestHTTPResults]
resource_fetch_time: TestHTTPResultsResourceFetchTime
history: List[TestHTTPResultsResourceFetchTimeHistory]
time_period: AggregateTimePeriod
units: Literal["hours", "days", "testRuns"]
One of the following:
"hours"
"days"
"testRuns"
value: int
avg_ms: Optional[int]
delta_pct: Optional[float]
formatfloat
avg_ms: Optional[int]
over_time: Optional[TestHTTPResultsResourceFetchTimeOverTime]
time_period: AggregateTimePeriod
units: Literal["hours", "days", "testRuns"]
One of the following:
"hours"
"days"
"testRuns"
value: int
values: List[TestHTTPResultsResourceFetchTimeOverTimeValue]
avg_ms: int
timestamp: str
http_results_by_colo: Optional[List[TestHTTPResultsByColo]]
colo: str

Cloudflare colo

resource_fetch_time: TestHTTPResultsByColoResourceFetchTime
history: List[TestHTTPResultsByColoResourceFetchTimeHistory]
time_period: AggregateTimePeriod
units: Literal["hours", "days", "testRuns"]
One of the following:
"hours"
"days"
"testRuns"
value: int
avg_ms: Optional[int]
delta_pct: Optional[float]
formatfloat
avg_ms: Optional[int]
over_time: Optional[TestHTTPResultsByColoResourceFetchTimeOverTime]
time_period: AggregateTimePeriod
units: Literal["hours", "days", "testRuns"]
One of the following:
"hours"
"days"
"testRuns"
value: int
values: List[TestHTTPResultsByColoResourceFetchTimeOverTimeValue]
avg_ms: int
timestamp: str
method: Optional[str]

for HTTP, the method to use when running the test

target_policies: Optional[List[DigitalExperienceMonitor]]
id: str

API Resource UUID tag.

maxLength36
default: bool

Whether the policy is the default for the account

name: str
targeted: Optional[bool]
traceroute_results: Optional[TestTracerouteResults]
round_trip_time: TestTracerouteResultsRoundTripTime
history: List[TestTracerouteResultsRoundTripTimeHistory]
time_period: AggregateTimePeriod
units: Literal["hours", "days", "testRuns"]
One of the following:
"hours"
"days"
"testRuns"
value: int
avg_ms: Optional[int]
delta_pct: Optional[float]
formatfloat
avg_ms: Optional[int]
over_time: Optional[TestTracerouteResultsRoundTripTimeOverTime]
time_period: AggregateTimePeriod
units: Literal["hours", "days", "testRuns"]
One of the following:
"hours"
"days"
"testRuns"
value: int
values: List[TestTracerouteResultsRoundTripTimeOverTimeValue]
avg_ms: int
timestamp: str
traceroute_results_by_colo: Optional[List[TestTracerouteResultsByColo]]
colo: str

Cloudflare colo

round_trip_time: TestTracerouteResultsByColoRoundTripTime
history: List[TestTracerouteResultsByColoRoundTripTimeHistory]
time_period: AggregateTimePeriod
units: Literal["hours", "days", "testRuns"]
One of the following:
"hours"
"days"
"testRuns"
value: int
avg_ms: Optional[int]
delta_pct: Optional[float]
formatfloat
avg_ms: Optional[int]
over_time: Optional[TestTracerouteResultsByColoRoundTripTimeOverTime]
time_period: AggregateTimePeriod
units: Literal["hours", "days", "testRuns"]
One of the following:
"hours"
"days"
"testRuns"
value: int
values: List[TestTracerouteResultsByColoRoundTripTimeOverTimeValue]
avg_ms: int
timestamp: str

List DEX test analytics

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
page = client.zero_trust.dex.tests.list(
    account_id="01a7362d577a6c3019a474fd6f485823",
)
page = page.result.items[0]
print(page.overview_metrics)
{
  "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"
                  }
                ]
              }
            }
          }
        ]
      }
    ]
  }
}