const url = 'https://api.defined.net/v1/hosts/host-24NVITKMNU3CYCEDNFWKAOBX7I/command';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"command":"StreamLogs","args":{"durationSeconds":1,"level":"panic"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.defined.net/v1/hosts/host-24NVITKMNU3CYCEDNFWKAOBX7I/command \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "command": "StreamLogs", "args": { "durationSeconds": 1, "level": "panic" } }'Send debug commands to the dnclient running on a host.
Token scope required: hosts:debug
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Example
host-24NVITKMNU3CYCEDNFWKAOBX7IRequest Bodyrequired
Section titled “Request Bodyrequired”object
Begin a streaming logs session for a specified number of seconds, up to 10 minutes
object
object
Trigger the creation of a tunnel to a specified host IP address
object
IP address of target host
object
Print the current host’s tunnel information for a given target host
object
IP address of target host
object
Print the certificate of a target host, from the current host’s hostmap
object
IP address of target host
object
Show target lighthouse’s host map. Also triggers an update, run twice for most up-to-date information.
object
IP address of target lighthouse
object
Print a stack trace of the dnclient process
object
Restart Nebula on the host, tearing down its tunnels and rebinding its UDP port. Requires DNClient 0.9.1 or later.
Responses
Section titled “Responses”Successful operation. ‘StreamLogs’ will return a newline-delimited JSON stream, the rest return standard JSON.
Examples
{ "data": "{\"durationSeconds\":300,\"level\":\"info\",\"msg\":\"Log streaming session started\",\"time\":\"2024-07-15T14:45:38-04:00\"}\\n{\"handshake\":{\"stage\":1,\"style\":\"ix_psk0\"},\"level\":\"info\",\"localIndex\":1038004327,\"msg\":\"Handshake message sent\",\"remoteIndex\":0,\"time\":\"2024-07-15T14:45:43-04:00\",\"udpAddrs\":[{\"ip\":\"1.2.3.4\",\"port\":65535}],\"vpnIp\":\"100.100.0.2\"}"}{ "data": { "details": { "curve": "CURVE25519", "groups": [ "role:ops" ], "ips": [ "10.255.0.5/9" ], "isCa": false, "issuer": "c652a897fee60414423b3e5e16951151099558799fc562c37f6ec73c376ecc15", "name": "mikeg", "notAfter": "2025-04-22T11:22:52-04:00", "notBefore": "2024-04-22T11:21:52-04:00", "publicKey": "2f97c72ca059c1d148aaada0593379be5b21dc034d57121c95d4a96282555f65", "subnets": [] }, "fingerprint": "7a8d0a73c93aaddae1589e53cf6d5bd160a9d8cb79a0c0c6d6d33ff7de24acb1", "signature": "679b2el234lkjkjdsaf234lkjsdao5k324444d4b3d2a87f6d32035b8bdd0325dsfszd5c2fc6955fa9d82a643a607e097cd72f3d191ca7ff55bd6babdd374e6ccc903" }}{ "data": { "vpnIp": "10.255.0.11", "localIndex": 3758197150, "remoteIndex": 65044350, "remoteAddrs": [ { "ip": "100.64.1.2", "port": 57304 }, { "ip": "162.194.213.135", "port": 57304 }, { "ip": "192.168.68.34", "port": 57304 }, { "ip": "192.168.123.7", "port": 57304 } ], "cachedPackets": 0, "cert": { "details": { "curve": "CURVE25519", "groups": [ "role:ops" ], "ips": [ "10.255.0.11/9" ], "isCa": false, "issuer": "2f97c72ca059c1d148aaada0593379be5b21dc034d57121c95d4a96282555f65", "name": "jmaguire", "notAfter": "2025-04-24T10:53:51-04:00", "notBefore": "2024-04-24T10:52:51-04:00", "publicKey": "4f46c2b14aa7ef8345d8bebeb2fad757d8cdfa5734bfc321da4f149d34c44555", "subnets": [] }, "fingerprint": "213fd79d91f892a48f47858227430adc1447e38a3960e66d63b562500faa02d1", "signature": "6856aa7b941330a75c98edcb12ed6fdfe4f49da94098a4394ca1a13600c942fae1a8bea83aa1e635f266311ba60c794036b7e367467526f9115488e3b904140b" }, "messageCounter": 4, "currentRemote": { "ip": "162.194.213.135", "port": 57304 }, "currentRelaysToMe": [], "currentRelaysThroughMe": [] }}{ "data": "Created"}{ "data": { "10.128.42.11": { "reported": [ { "ip": "162.194.213.135", "port": 52148 }, { "ip": "192.168.68.34", "port": 52148 }, { "ip": "192.168.123.7", "port": 52148 }, { "ip": "100.64.1.2", "port": 52148 } ], "relay": [] }, "10.128.30.182": { "reported": [ { "ip": "162.194.213.135", "port": 52148 }, { "ip": "192.168.68.34", "port": 52148 }, { "ip": "192.168.123.7", "port": 52148 }, { "ip": "100.64.1.2", "port": 52148 } ], "relay": [] }, "10.255.89.11": { "learned": [ { "ip": "162.194.213.8", "port": 52148 } ], "relay": [] } }}{ "data": { "restart": "triggered" }}The API key is missing, invalid or expired.
object
object
A static name for the error type
A short human readable description of the error
Describes the variable missing or malformed
The query parameter the error relates to, such as filter.targetType
Machine-readable details about the error. ERR_LIMIT_EXCEEDED errors carry limit and limitName.
object
The maximum number of resources allowed
The kind of resource the limit applies to
Example
{ "errors": [ { "code": "ERR_UNAUTHORIZED", "message": "unauthorized" } ]}The API key lacks a required scope.
object
object
A static name for the error type
A short human readable description of the error
Describes the variable missing or malformed
The query parameter the error relates to, such as filter.targetType
Machine-readable details about the error. ERR_LIMIT_EXCEEDED errors carry limit and limitName.
object
The maximum number of resources allowed
The kind of resource the limit applies to
Examples
The API key lacks a required scope.
{ "errors": [ { "code": "ERR_FORBIDDEN", "message": "api key must support the following scopes: hosts:read" } ]}Host not found
object
object
A static name for the error type
A short human readable description of the error
Describes the variable missing or malformed
The query parameter the error relates to, such as filter.targetType
Machine-readable details about the error. ERR_LIMIT_EXCEEDED errors carry limit and limitName.
object
The maximum number of resources allowed
The kind of resource the limit applies to
Example
{ "errors": [ { "code": "ERR_NOT_FOUND", "message": "resource not found" } ]}The organization has exceeded its API request rate limit. Retry the request after a short delay.
object
object
A static name for the error type
A short human readable description of the error
Describes the variable missing or malformed
The query parameter the error relates to, such as filter.targetType
Machine-readable details about the error. ERR_LIMIT_EXCEEDED errors carry limit and limitName.
object
The maximum number of resources allowed
The kind of resource the limit applies to
Example
{ "errors": [ { "code": "ERR_TOO_MANY_REQUESTS", "message": "too many requests" } ]}