Skip to content

Ping a host from the node

Request

Runs ping -O -I {source} {host} on the node and streams the output. Use ?wait=1 to block and receive the ping output.


Requires nodes::service:tg-ping or nodes::remote-execute permission.

Security
JWTAuthorizer
Path
nodeIDstringrequired

Node ID

Query
waitinteger

Pass 1 to block until the node responds and return its output.

Value:1
Bodyapplication/jsonrequired
sourcestring

Source interface IP address

Default:"127.0.0.1"
Example:"192.168.1.10"
hoststringrequired

Target IP or hostname to ping

Example:"8.8.8.8"
curl -i -X POST \
  'https://apidocs.trustgrid.io/_mock/node/{nodeID}/trigger/tg-ping?wait=1' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "source": "192.168.1.10",
    "host": "8.8.8.8"
  }'

Responses

OK

Bodyapplication/json
boolean
Response
true