UtilitiesCommon

tracerouteFromDevice

POST
/api/v1/sites/{site_id}/devices/{device_id}/traceroute

Traceroute can be performed from the Device.

The output will be available through websocket. As there can be multiple commands issued against the same Device at the same time and the output all goes through the same websocket stream, session is introduced for demux.

Subscribe to Device Command outputs

WS /api-ws/v1/stream

{    "subscribe": "/sites/{site_id}/devices/{device_id}/cmd"}

Example output from ws stream

{  "channel": "/sites/d6fb4f96-xxxx-xxxx-xxxx-xxxxxxxxxxxx/devices/00000000-0000-0000-1000-xxxxxxxxxxxx/cmd",  "event": "data",  "data": {    "session": "9106e908-74dc-4a4f-9050-9c2adcaf44a5",    "raw": "Running traceroute...\ntraceroute to 8.8.8.8, 64 hops max\n 0  192.168.1.1 1 ms  192.168.1.1 1 ms  192.168.1.1 1 ms\n 1  80.10.236.81 2 ms  80.10.236.81 4 ms  80.10.236.81 2 ms\n 2  193.253.80.250 3 ms  193.253.80.250 2 ms  193.253.80.250 2 ms\n 3  193.252.159.41 2 ms  193.252.159.41 1 ms  193.252.159.41 3 ms\n"}

Authorization

Authorization<token>

Preferred authentication method for automation and integrations. Send the API token in the HTTP Authorization header.

Format: Authorization: Token {apitoken}

Notes:

  • An API token generated for a specific admin has the same privileges as that admin
  • An API token is automatically removed if it is not used for more than 90 days
  • SSO admins cannot generate admin API tokens. Use organization API tokens when scoped Org/Site privileges are needed.

In: header

Path Parameters

site_id*string
Formatuuid
device_id*string
Formatuuid

Request Body

application/json

Request Body

Request body for running a traceroute utility command

host?string

Destination IP address, IPv6 address, or hostname for traceroute

network?string

For SSR, source network from which to initiate traceroute

Default"internal"
node?ha_cluster_node_enum

HA cluster node from which to run traceroute. enum: node0, node1.

Value in

  • "node0"
  • "node1"
port?integer

When protocol==udp, not supported in SSR. The udp port to use

Default33434
protocol?utils_traceroute_protocol

Transport protocol to use for traceroute. enum: icmp, udp.

Default"udp"

Value in

  • "icmp"
  • "udp"
timeout?integer

Not supported in SSR. Maximum time in seconds to wait for the response

Default60
use_ipv6?boolean

Whether to resolve hostname targets over IPv6

Defaultfalse
vrf?string

For SRX, routing instance or VRF from which to initiate traceroute; master VRF/RI is used by default

Response Body

curl -X POST "https://example.com/api/v1/sites/000000ab-00ab-00ab-00ab-0000000000ab/devices/000000ab-00ab-00ab-00ab-0000000000ab/traceroute" \  -H "Content-Type: application/json" \  -d '{    "host": "string",    "port": 33434,    "protocol": "udp"  }'
{  "session": "19e73828-937f-05e6-f709-e29efdb0a82b"}