Retrieve node hostname
GET/node/hostname
Get the current hostname of the node.
Request
Query Parameters
Default value: _any
Target: _any (load-balanced), _all (broadcast), hostname (direct), or key:value (label group, e.g., group:web.dev).
Responses
- 200
- 400
- 401
- 403
- 500
A JSON object containing the node's hostname.
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
The job ID used to process this request.
results
object[]
required
The system's hostname.
labels
object
Key-value labels configured on the agent.
Error message if the agent failed to process the request.
{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"results": [
{
"hostname": "my-linux-server",
"labels": {},
"error": "string"
}
]
}
Invalid request parameters.
- application/json
- Schema
- Example (from schema)
Schema
A description of the error that occurred.
Additional details about the error.
The error code.
{
"error": "Failed to retrieve status.",
"details": "Failed due to network timeout.",
"code": 500
}
Unauthorized - API key required
- application/json
- Schema
- Example (from schema)
Schema
A description of the error that occurred.
Additional details about the error.
The error code.
{
"error": "Failed to retrieve status.",
"details": "Failed due to network timeout.",
"code": 500
}
Forbidden - Insufficient permissions
- application/json
- Schema
- Example (from schema)
Schema
A description of the error that occurred.
Additional details about the error.
The error code.
{
"error": "Failed to retrieve status.",
"details": "Failed due to network timeout.",
"code": 500
}
Error retrieving hostname.
- application/json
- Schema
- Example (from schema)
Schema
A description of the error that occurred.
Additional details about the error.
The error code.
{
"error": "Failed to retrieve status.",
"details": "Failed due to network timeout.",
"code": 500
}