Service HTTP API
The /service
endpoints are used to query and interact with Nomad services.
List Services
This endpoint lists all the currently available Nomad services.
Method | Path | Produces |
---|---|---|
GET | /v1/services | application/json |
The table below shows this endpoint's support for blocking queries and required ACLs.
Blocking Queries | ACL Required |
---|---|
YES | namespace:read-job |
Sample Request
Sample Response
Read Service
This endpoint reads a specific service.
Method | Path | Produces |
---|---|---|
GET | /service/:service_name | application/json |
The table below shows this endpoint's support for blocking queries, consistency modes and required ACLs.
Blocking Queries | Consistency Modes | ACL Required |
---|---|---|
YES | all | namespace:read-job |
Parameters
:service_name
(string: <required>)
- Specifies the service name. This is specified as part of the path.namespace
(string: "default")
- Specifies the target namespace. This parameter is used before anyfilter
expression is applied.next_token
(string: "")
- This endpoint supports paging. Thenext_token
parameter accepts a string which identifies the next expected service. This value can be obtained from theX-Nomad-NextToken
header from the previous response.per_page
(int: 0)
- Specifies a maximum number of services to return for this request. If omitted, the response is not paginated. The value of theX-Nomad-NextToken
header of the last response can be used as thenext_token
of the next request to fetch additional pages.filter
(string: "")
- Specifies the expression used to filter the results. Consider using pagination or a query parameter to reduce resource used to serve the request.choose
(string: "")
- Specifies the number of services to return and a hash key. Must be in the form<number>|<key>
. Nomad uses rendezvous hashing to deliver consistent results for a given key, and stable results when the number of services changes.
Sample Request
Sample Response
Delete Service Registration
This endpoint is used to delete an individual service registration.
Method | Path | Produces |
---|---|---|
DELETE | /v1/service/:service_name/:service_id | application/json |
The table below shows this endpoint's support for blocking queries and required ACLs.
Blocking Queries | ACL Required |
---|---|
NO | namespace:submit-job |
Parameters
:service_name
(string: <required>)
- Specifies the service name. This is specified as part of the path.:service_id
(string: <required>)
- Specifies the service ID. This is specified as part of the path.
Sample Request