forked from slatedocs/slate
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add API documentation about the agent health status endpoint
- Loading branch information
Showing
3 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Agent Health | ||
|
||
The agents API allows users to monitor if the agent is connected to the server and is authorized to perform a build. | ||
|
||
<%= render_all_sub_topics('agent-health') %> |
43 changes: 43 additions & 0 deletions
43
source/includes/agent-health/_00-get-agent-health-status.md.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
## Check agent-server connectivity | ||
|
||
```shell | ||
$ curl 'http://localhost:8152/health/v1/isConnectedToServer' | ||
``` | ||
|
||
> The above command returns a plain text response: | ||
|
||
```http | ||
HTTP/1.1 200 OK | ||
Content-Type: text/plain; charset=utf-8 | ||
|
||
OK! | ||
``` | ||
|
||
This API when invoked on an agent, will indicate if the agent-server connectivity is in a state that allows agents to run builds. | ||
|
||
<%= available_since('17.11') %> | ||
|
||
<p class='http-request-heading'>HTTP Request</p> | ||
|
||
`GET /health/v1/isConnectedToServer` | ||
|
||
You may alternatively use: | ||
|
||
`GET /health/latest/isConnectedToServer` | ||
|
||
which will render the most recent version of the api. | ||
|
||
<p class='http-request-return-description'>Returns</p> | ||
|
||
A status code `200` along with text `OK!` if all the following conditions are met: | ||
|
||
- able to establish HTTP(s) contact with the server | ||
- is authorized by the server (by an admin, or by auto-registration) | ||
|
||
The endpoint will return status `503` in any other cases. | ||
|
||
Two consecutive failing pings will be treated as having failed healthcheck. | ||
|
||
<aside class="notice"> | ||
<strong>Note:</strong> When a GoCD server is upgraded, the agent will automatically upgrade itself by downloading a copy from the GoCD server. During the time a new agent jar is being downloaded, this api endpoint may not be available. | ||
</aside> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters