Events HTTP API
The /event/stream
endpoint is used to stream events generated by Nomad.
Event Stream
This endpoint streams a server's backlog of events as well as new events as they occur.
The stream will be kept alive until the connection is closed. The format of the response
body will be valid ndjson. This means splitting the streaming
response at every \n
character will guarantee each message is a valid JSON object.
Note that each JSON object may include multiple events (high server activity) or no
events (heartbeating to keep the connection open).
Method | Path | Produces |
---|---|---|
GET | /v1/event/stream | application/json |
The table below shows this endpoint's required ACLs. Due to the nature of this endpoint individual topics require specific policies.
Note that if you do not include a topic
parameter all topics will be included
by default, requiring a management token.
Topic | ACL Required |
---|---|
* | management |
ACLToken | management |
ACLPolicy | management |
ACLRole | management |
Job | namespace:read-job |
Allocation | namespace:read-job |
Deployment | namespace:read-job |
Evaluation | namespace:read-job |
Node | node:read |
NodePool | management |
Service | namespace:read-job |
Parameters
index
(int: 0)
- Specifies the index to start streaming events from. If the requested index is no longer in the buffer the stream will start at the next available index.namespace
(string: "default")
- Specifies the target namespace to filter on. Specifying*
includes all namespaces for event types that support namespaces. If you specify all namespaces (*
) you'll either need a management token, or an ACL Policy that explicitly applies to all namespaces (*
).topic
(topic:filter_key: "*:*")
- Specifies a topic to subscribe to and filter on. The default is to subscribe to all topics. Multiple topics may be specified by passing multipletopic
parameters. A valid topic parameter includes atopic
type and an optionalfilter_key
separated by a colon:
. As an example?topic=Deployment:redis
would subscribe to allDeployment
events for a job redis. an additional topic&topic=Deployment:web
would include deployment events for redis and web. To only subscribe toNode
events a topic parameter of?topic=Node
without a separator value would be used.?topic=Node:*
is also valid.
Event Topics
Topic | Output |
---|---|
ACLToken | ACLToken |
ACLPolicy | ACLPolicy |
ACLRoles | ACLRole |
Allocation | Allocation (no job information) |
Job | Job |
Evaluation | Evaluation |
Deployment | Deployment |
Node | Node |
NodeDrain | Node |
NodePool | NodePool |
Service | Service Registrations |
Event Types
Type |
---|
ACLTokenUpserted |
ACLTokenDeleted |
ACLPolicyUpserted |
ACLPolicyDeleted |
ACLRoleUpserted |
ACLRoleDeleted |
AllocationCreated |
AllocationUpdated |
AllocationUpdateDesiredStatus |
DeploymentStatusUpdate |
DeploymentPromotion |
DeploymentAllocHealth |
EvaluationUpdated |
JobRegistered |
JobDeregistered |
JobBatchDeregistered |
NodeRegistration |
NodeDeregistration |
NodeEligibility |
NodeDrain |
NodeEvent |
NodePoolUpserted |
NodePoolDeleted |
PlanResult |
ServiceRegistration |
ServiceDeregistration |
Sample Request
Sample Response