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:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
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"
}
}