Skip to content
Start here

Get network path breakdown for a traceroute test

zero_trust.dex.traceroute_tests.network_path(strtest_id, TracerouteTestNetworkPathParams**kwargs) -> NetworkPathResponse
GET/accounts/{account_id}/dex/traceroute-tests/{test_id}/network-path

Get a breakdown of metrics by hop for individual traceroute test runs

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

API Resource UUID tag.

maxLength36
device_id: str

Device to filter tracroute result runs to

from_: str

Start time for aggregate metrics in ISO ms

interval: Literal["minute", "hour"]

Time interval for aggregate time slots.

One of the following:
"minute"
"hour"
to: str

End time for aggregate metrics in ISO ms

ReturnsExpand Collapse
class NetworkPathResponse:
id: str

API Resource UUID tag.

maxLength36
device_name: Optional[str]
interval: Optional[str]

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

kind: Optional[Literal["traceroute"]]
name: Optional[str]
network_path: Optional[NetworkPath]
slots: List[Slot]
id: str

API Resource UUID tag.

maxLength36
client_to_app_rtt_ms: Optional[int]

Round trip time in ms of the client to app mile

client_to_cf_egress_rtt_ms: Optional[int]

Round trip time in ms of the client to Cloudflare egress mile

client_to_cf_ingress_rtt_ms: Optional[int]

Round trip time in ms of the client to Cloudflare ingress mile

timestamp: str
client_to_isp_rtt_ms: Optional[int]

Round trip time in ms of the client to ISP mile

sampling: Optional[Sampling]

Specifies the sampling applied, if any, to the slots response. When sampled, results shown represent the first test run to the start of each sampling interval.

unit: Literal["hours"]
value: int
url: Optional[str]

The host of the Traceroute synthetic application test

Get network path breakdown for a traceroute test

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
network_path_response = client.zero_trust.dex.traceroute_tests.network_path(
    test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
    account_id="01a7362d577a6c3019a474fd6f485823",
    device_id="deviceId",
    from_="1689520412000",
    interval="minute",
    to="1689606812000",
)
print(network_path_response.id)
{
  "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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
    "deviceName": "deviceName",
    "interval": "0h5m0s",
    "kind": "traceroute",
    "name": "name",
    "networkPath": {
      "slots": [
        {
          "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
          "clientToAppRttMs": 0,
          "clientToCfEgressRttMs": 0,
          "clientToCfIngressRttMs": 0,
          "timestamp": "2023-07-16 15:00:00+00",
          "clientToIspRttMs": 0
        }
      ],
      "sampling": {
        "unit": "hours",
        "value": 0
      }
    },
    "url": "1.1.1.1"
  }
}
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": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
    "deviceName": "deviceName",
    "interval": "0h5m0s",
    "kind": "traceroute",
    "name": "name",
    "networkPath": {
      "slots": [
        {
          "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
          "clientToAppRttMs": 0,
          "clientToCfEgressRttMs": 0,
          "clientToCfIngressRttMs": 0,
          "timestamp": "2023-07-16 15:00:00+00",
          "clientToIspRttMs": 0
        }
      ],
      "sampling": {
        "unit": "hours",
        "value": 0
      }
    },
    "url": "1.1.1.1"
  }
}