Skip to content
Start here

Get network path breakdown for a traceroute test

client.ZeroTrust.DEX.TracerouteTests.NetworkPath(ctx, testID, params) (*NetworkPathResponse, error)
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
testID string

API Resource UUID tag.

maxLength36
params DEXTracerouteTestNetworkPathParams
AccountID param.Field[string]

Path param: unique identifier linked to an account

maxLength32
DeviceID param.Field[string]

Query param: Device to filter tracroute result runs to

From param.Field[string]

Query param: Start time for aggregate metrics in ISO ms

Query param: Time interval for aggregate time slots.

const DEXTracerouteTestNetworkPathParamsIntervalMinute DEXTracerouteTestNetworkPathParamsInterval = "minute"
const DEXTracerouteTestNetworkPathParamsIntervalHour DEXTracerouteTestNetworkPathParamsInterval = "hour"
To param.Field[string]

Query param: End time for aggregate metrics in ISO ms

ReturnsExpand Collapse
type NetworkPathResponse struct{…}
ID string

API Resource UUID tag.

maxLength36
DeviceName stringoptional
Interval stringoptional

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

Kind NetworkPathResponseKindoptional
Name stringoptional
NetworkPath NetworkPathoptional
Slots []NetworkPathSlot
ID string

API Resource UUID tag.

maxLength36
ClientToAppRTTMs int64

Round trip time in ms of the client to app mile

ClientToCfEgressRTTMs int64

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

ClientToCfIngressRTTMs int64

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

Timestamp string
ClientToISPRTTMs int64optional

Round trip time in ms of the client to ISP mile

Sampling NetworkPathSamplingoptional

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 NetworkPathSamplingUnit
Value int64
URL stringoptional

The host of the Traceroute synthetic application test

Get network path breakdown for a traceroute test

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"),
  )
  networkPathResponse, err := client.ZeroTrust.DEX.TracerouteTests.NetworkPath(
    context.TODO(),
    "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
    zero_trust.DEXTracerouteTestNetworkPathParams{
      AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"),
      DeviceID: cloudflare.F("deviceId"),
      From: cloudflare.F("1689520412000"),
      Interval: cloudflare.F(zero_trust.DEXTracerouteTestNetworkPathParamsIntervalMinute),
      To: cloudflare.F("1689606812000"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", networkPathResponse.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"
  }
}