summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axil@gitlab.com>2019-04-04 14:45:54 +0200
committerAchilleas Pipinellis <axil@gitlab.com>2019-04-04 14:45:54 +0200
commit510f54f73406b520e7a88ce77f87209d7f48f88d (patch)
tree557e15a5c99c1b563150062017d6a718794ddf37
parent60a0ef21d385e1943f9e6a68adc9d7e04e8d69c8 (diff)
downloadgitlab-ce-docs/register-runner-api.tar.gz
Clarify the Runner registration and authentication tokensdocs/register-runner-api
-rw-r--r--doc/api/runners.md35
1 files changed, 29 insertions, 6 deletions
diff --git a/doc/api/runners.md b/doc/api/runners.md
index 0b7ef46888c..083efb9ea98 100644
--- a/doc/api/runners.md
+++ b/doc/api/runners.md
@@ -4,6 +4,29 @@
[ce-2640]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2640
+## The registration and authentication tokens
+
+There are two tokens to take into account when connecting a Runner with GitLab.
+
+| Token | Description |
+| ----- | ----------- |
+| Registration token | The token that is used to [register the Runner](https://docs.gitlab.com/runner/register/). It can be [obtained through GitLab](../ci/runners/README.md). |
+| Authentication token | The token that is used to authenticate the Runner with the GitLab instance. It is obtained either automatically when [registering a Runner](https://docs.gitlab.com/runner/register/), or manually when [registering the Runner via the Runners API](#register-a-new-runner). |
+
+Here's an example of how the process works:
+
+1. You register the Runner via the GitLab API using a registration token, and an
+ authentication token is returned.
+1. You use that authentication token to add it to the
+ [Runner's configuration file](https://docs.gitlab.com/runner/commands/#configuration-file):
+
+ ```toml
+ [[runners]]
+ token = "<authentication_token>"
+ ```
+
+1. GitLab and Runner are then connected.
+
## List owned runners
Get a list of specific runners available to the user.
@@ -456,7 +479,7 @@ POST /runners
| Attribute | Type | Required | Description |
|-------------|---------|----------|---------------------|
-| `token` | string | yes | Registration token ([Read how to obtain a token](../ci/runners/README.md)) |
+| `token` | string | yes | [The registration token](#the-registration-and-authentication-tokens). |
| `description`| string | no | Runner's description|
| `info` | hash | no | Runner's metadata |
| `active` | boolean| no | Whether the Runner is active |
@@ -466,7 +489,7 @@ POST /runners
| `maximum_timeout` | integer | no | Maximum timeout set when this Runner will handle the job |
```
-curl --request POST "https://gitlab.example.com/api/v4/runners" --form "token=ipzXrMhuyyJPifUt6ANz" --form "description=test-1-20150125-test" --form "tag_list=ruby,mysql,tag1,tag2"
+curl --request POST "https://gitlab.example.com/api/v4/runners" --form "token=<registration_token>" --form "description=test-1-20150125-test" --form "tag_list=ruby,mysql,tag1,tag2"
```
Response:
@@ -494,10 +517,10 @@ DELETE /runners
| Attribute | Type | Required | Description |
|-------------|---------|----------|---------------------|
-| `token` | string | yes | Runner's authentication token |
+| `token` | string | yes | Runner's [authentication token](#the-registration-and-authentication-tokens). |
```
-curl --request DELETE "https://gitlab.example.com/api/v4/runners" --form "token=ebb6fc00521627750c8bb750f2490e"
+curl --request DELETE "https://gitlab.example.com/api/v4/runners" --form "token=<authentication_token>"
```
Response:
@@ -516,10 +539,10 @@ POST /runners/verify
| Attribute | Type | Required | Description |
|-------------|---------|----------|---------------------|
-| `token` | string | yes | Runner's authentication token |
+| `token` | string | yes | Runner's [authentication token](#the-registration-and-authentication-tokens). |
```
-curl --request POST "https://gitlab.example.com/api/v4/runners/verify" --form "token=ebb6fc00521627750c8bb750f2490e"
+curl --request POST "https://gitlab.example.com/api/v4/runners/verify" --form "token=<authentication_token>"
```
Response: