2015-07-29 23:33:25 +00:00
|
|
|
---
|
|
|
|
layout: "docs"
|
|
|
|
page_title: "Coordinate (HTTP)"
|
|
|
|
sidebar_current: "docs-agent-http-coordinate"
|
|
|
|
description: >
|
2015-12-29 00:34:09 +00:00
|
|
|
The Coordinate endpoint is used to query for the network coordinates for
|
2015-07-29 23:33:25 +00:00
|
|
|
nodes in the local datacenter as well as Consul servers in the local
|
|
|
|
datacenter and remote datacenters.
|
|
|
|
---
|
|
|
|
|
|
|
|
# Coordinate HTTP Endpoint
|
|
|
|
|
2015-12-29 00:34:09 +00:00
|
|
|
The Coordinate endpoint is used to query for the network coordinates for nodes
|
2015-07-29 23:33:25 +00:00
|
|
|
in the local datacenter as well as Consul servers in the local datacenter and
|
|
|
|
remote datacenters.
|
|
|
|
|
2015-10-22 00:29:43 +00:00
|
|
|
See the [Network Coordinates](/docs/internals/coordinates.html) internals guide
|
|
|
|
for more information on how these coordinates are computed, and for details on
|
|
|
|
how to perform calculations with them.
|
|
|
|
|
2015-07-29 23:33:25 +00:00
|
|
|
The following endpoints are supported:
|
|
|
|
|
|
|
|
* [`/v1/coordinate/datacenters`](#coordinate_datacenters) : Queries for WAN coordinates of Consul servers
|
|
|
|
* [`/v1/coordinate/nodes`](#coordinate_nodes) : Queries for LAN coordinates of Consul nodes
|
|
|
|
|
|
|
|
### <a name="coordinate_datacenters"></a> /v1/coordinate/datacenters
|
|
|
|
|
2016-11-25 17:34:07 +00:00
|
|
|
This endpoint is hit with a `GET` and returns the WAN network coordinates for
|
2015-07-29 23:33:25 +00:00
|
|
|
all Consul servers, organized by DCs.
|
|
|
|
|
|
|
|
It returns a JSON body like this:
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
[
|
|
|
|
{
|
|
|
|
"Datacenter": "dc1",
|
|
|
|
"Coordinates": [
|
|
|
|
{
|
|
|
|
"Node": "agent-one",
|
|
|
|
"Coord": {
|
|
|
|
"Adjustment": 0,
|
|
|
|
"Error": 1.5,
|
2015-10-22 00:29:43 +00:00
|
|
|
"Height": 0,
|
2015-07-29 23:33:25 +00:00
|
|
|
"Vec": [0,0,0,0,0,0,0,0]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
```
|
|
|
|
|
|
|
|
This endpoint serves data out of the server's local Serf data about the WAN, so
|
|
|
|
its results may vary as requests are handled by different servers in the
|
2015-10-22 00:29:43 +00:00
|
|
|
cluster. Also, it does not support blocking queries or any consistency modes.
|
2015-07-29 23:33:25 +00:00
|
|
|
|
|
|
|
### <a name=""coordinate_nodes></a> /v1/coordinate/nodes
|
|
|
|
|
2016-11-25 17:34:07 +00:00
|
|
|
This endpoint is hit with a `GET` and returns the LAN network coordinates for
|
2015-07-29 23:33:25 +00:00
|
|
|
all nodes in a given DC. By default, the datacenter of the agent is queried;
|
2016-11-25 17:34:07 +00:00
|
|
|
however, the `dc` can be provided using the `?dc=` query parameter.
|
2015-07-29 23:33:25 +00:00
|
|
|
|
|
|
|
It returns a JSON body like this:
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
[
|
|
|
|
{
|
|
|
|
"Node": "agent-one",
|
|
|
|
"Coord": {
|
|
|
|
"Adjustment": 0,
|
|
|
|
"Error": 1.5,
|
2015-10-22 00:29:43 +00:00
|
|
|
"Height": 0,
|
2015-07-29 23:33:25 +00:00
|
|
|
"Vec": [0,0,0,0,0,0,0,0]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
```
|
|
|
|
|
|
|
|
This endpoint supports blocking queries and all consistency modes.
|