backport of commit 772ddd3638d4130b0e3590c5d0279e5757823250 (#19193)

Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
This commit is contained in:
hc-github-team-nomad-core 2023-11-27 16:58:54 -06:00 committed by GitHub
parent f149c55d5a
commit 627dc49147
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 10 deletions

View File

@ -2,25 +2,29 @@
layout: api layout: api
page_title: Client - HTTP API page_title: Client - HTTP API
description: |- description: |-
The /client endpoints are used to access client information and inspect The /client endpoints are used to access client information, read and write
allocations running on a particular client. dynamic node metadata, and inspect allocations running on a particular
client.
--- ---
# Client HTTP API # Client HTTP API
The `/v1/client` endpoints are used to interact with the Nomad clients. The `/client` endpoints are used to interact with the Nomad clients.
Since Nomad 0.8.0, both a client and server can handle client endpoints. This is Both clients and servers can handle client endpoints. This is particularly
particularly useful for when a direct connection to a client is not possible due useful for when a direct connection to a client is not possible due to the
to the network configuration. For high volume access to the client endpoints, network configuration. For high volume access to the client endpoints,
particularly endpoints streaming file contents, direct access to the node should particularly endpoints streaming file contents, direct access to the node
be preferred as it avoids adding additional load to the servers. should be preferred as it avoids adding additional load to the servers.
When accessing the endpoints via the server, if the desired node is ambiguous When accessing the endpoints via the server, if the desired node is ambiguous
based on the URL, an additional `?node_id` query parameter must be provided to based on the URL, an additional `?node_id` query parameter must be provided to
disambiguate. disambiguate.
## Read Node Metadata The [`/node`](/nomad/api-docs/nodes) endpoints provide node information that
are retried from Nomad servers.
## Read Dynamic Node Metadata
This endpoint queries Node metadata on a specific Client agent and responds This endpoint queries Node metadata on a specific Client agent and responds
with the following fields: with the following fields:
@ -97,7 +101,7 @@ Formatted by appending `?pretty` above.
### Sample Request ### Sample Request
## Update Node Metadata ## Update Dynamic Node Metadata
This endpoint updates dynamic Node metadata on a specific Client agent. Since This endpoint updates dynamic Node metadata on a specific Client agent. Since
dynamic Node metadata is only periodically synchronized to Nomad Servers, the dynamic Node metadata is only periodically synchronized to Nomad Servers, the

View File

@ -8,6 +8,10 @@ description: The /node endpoints are used to query for and interact with client
The `/node` endpoints are used to query for and interact with client nodes. The `/node` endpoints are used to query for and interact with client nodes.
Requests to these endpoints are always forwarded to and answered by Nomad
servers. The [`/client`](/nomad/api-docs/client) endpoints provide node
information that are answered directly by the Nomad client.
## List Nodes ## List Nodes
This endpoint lists all nodes registered with Nomad. This endpoint lists all nodes registered with Nomad.