Nodes HTTP API
The /node
endpoints are used to query for and interact with client nodes.
List Nodes
This endpoint lists all nodes registered with Nomad.
Method | Path | Produces |
---|---|---|
GET | /v1/nodes | application/json |
The table below shows this endpoint's support for blocking queries and required ACLs.
Blocking Queries | ACL Required |
---|---|
YES | node:read |
Parameters
prefix
(string: "")
- Specifies a string to filter nodes based on an ID prefix. Because the value is decoded to bytes, the prefix must have an even number of hexadecimal characters (0-9a-f). This is specified as a query string parameter.resources
(bool: false)
- Specifies whether or not to include theNodeResources
andReservedResources
fields in the response.
Sample Request
Sample Response
Read Node
This endpoint queries the status of a client node.
Method | Path | Produces |
---|---|---|
GET | /v1/node/:node_id | application/json |
The table below shows this endpoint's support for blocking queries and required ACLs.
Blocking Queries | ACL Required |
---|---|
YES | node:read |
Parameters
:node_id
(string: <required>)
- Specifies the ID of the node. This must be the full UUID, not the short 8-character one. This is specified as part of the path.
Sample Request
Sample Response
List Node Allocations
This endpoint lists all of the allocations for the given node. This can be used to determine what allocations have been scheduled on the node, their current status, and the values of dynamically assigned resources, like ports.
Method | Path | Produces |
---|---|---|
GET | /v1/node/:node_id/allocations | application/json |
The table below shows this endpoint's support for blocking queries and required ACLs.
Blocking Queries | ACL Required |
---|---|
YES | node:read,namespace:read-job |
Parameters
:node_id
(string: <required>)
- Specifies the UUID of the node. This must be the full UUID, not the short 8-character one. This is specified as part of the path.
Sample Request
Sample Response
Create Node Evaluation
This endpoint creates a new evaluation for the given node. This can be used to force a run of the scheduling logic.
Method | Path | Produces |
---|---|---|
POST | /v1/node/:node_id/evaluate | application/json |
The table below shows this endpoint's support for blocking queries and required ACLs.
Blocking Queries | ACL Required |
---|---|
NO | node:write |
Parameters
:node_id
(string: <required>)
- Specifies the UUID of the node. This must be the full UUID, not the short 8-character one. This is specified as part of the path.
Sample Request
Sample Response
Drain Node
This endpoint toggles the drain mode of the node. When draining is enabled, no further allocations will be assigned to this node, and existing allocations will be migrated to new nodes. See the Workload Migration Guide for suggested usage.
Method | Path | Produces |
---|---|---|
POST | /v1/node/:node_id/drain | application/json |
The table below shows this endpoint's support for blocking queries and required ACLs.
Blocking Queries | ACL Required |
---|---|
NO | node:write |
Parameters
:node_id
(string: <required>)
- Specifies the UUID of the node. This must be the full UUID, not the short 8-character one. This is specified as part of the path.DrainSpec
(object: <optional>)
- Specifies if drain mode should be enabled. A missing or null value disables an existing drain.Deadline
(int: <required>)
- Specifies how long to wait in nanoseconds for allocations to finish migrating before they are force stopped. This is also how long batch jobs are given to complete before being migrated.IgnoreSystemJobs
(bool: false)
- Specifies whether or not to stop system jobs as part of a drain. By default system jobs will be stopped after all other allocations have migrated or the deadline is reached. Setting this totrue
means system jobs are always left running.
MarkEligible
(bool: false)
- Specifies whether to mark a node as eligible for scheduling again when disabling a drain.
Sample Payload
Sample Request
Sample Response
Purge Node
This endpoint purges a node from the system. Nodes can still join the cluster if they are alive.
Method | Path | Produces |
---|---|---|
POST | /v1/node/:node_id/purge | application/json |
The table below shows this endpoint's support for blocking queries and required ACLs.
Blocking Queries | ACL Required |
---|---|
NO | node:write |
Parameters
:node_id
(string: <required>)
- Specifies the UUID of the node. This must be the full UUID, not the short 8-character one. This is specified as part of the path.
Sample Request
Sample Response
Toggle Node Eligibility
This endpoint toggles the scheduling eligibility of the node.
Method | Path | Produces |
---|---|---|
POST | /v1/node/:node_id/eligibility | application/json |
The table below shows this endpoint's support for blocking queries and required ACLs.
Blocking Queries | ACL Required |
---|---|
NO | node:write |
Parameters
:node_id
(string: <required>)
- Specifies the UUID of the node. This must be the full UUID, not the short 8-character one. This is specified as part of the path.Eligibility
(string: <required>)
- Eithereligible
orineligible
.
Sample Payload
Sample Request
Sample Response
Field Reference
Events - A list of the last 10 node events for this node. A node event is a high level concept of noteworthy events for a node.
Each node event has the following fields:
Message
- The specific message for the event, detailing what occurred.Subsystem
- The subsystem where the node event took place. Subsystems include:Details
- Any further details about the event, formatted as a key/value pair.Timestamp
- Each node event has an ISO 8601 timestamp.CreateIndex
- The Raft index at which the event was committed.