Skip to content

Test TCP port connectivity from the node's local network

Request

Runs nc -v -z {host} {port} from the node, binding to the specified source address. Returns the netcat output and exit code.

Use ?wait=1 to block and receive the result synchronously.


Requires nodes::service:tg-nc 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 IP address to bind to

Default:"127.0.0.1"
Example:"192.168.1.10"
hoststringrequired

Target host IP or hostname

Example:"10.0.0.1"
portintegerrequired

Target TCP port

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

Responses

OK

Bodyapplication/json
outputobject
Response
{ "output": { "message": "string", "exitCode": "string" } }