BigW Consortium Gitlab

runners.md 1.62 KB
Newer Older
1
# Register and Delete Runners API
2 3 4 5 6 7 8 9 10 11 12 13 14

API used by Runners to register and delete themselves.

>**Note:**
This API is intended to be used only by Runners as their own
communication channel. For the consumer API see the
[new Runners API](../runners.md).

## Authentication

This API uses two types of authentication:

1. Unique Runner's token, which is the token assigned to the Runner after it
15 16 17
   has been registered.  This token can be found on the Runner's edit page (go to
   **Project > Runners**, select one of the Runners listed under **Runners activated for
   this project**).
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39

2. Using Runners' registration token.
   This is a token that can be found in project's settings.
   It can also be found in the **Admin > Runners** settings area.
   There are two types of tokens you can pass: shared Runner registration
   token or project specific registration token.

## Register a new runner

Used to make GitLab CI aware of available runners.

```sh
POST /ci/api/v1/runners/register
```

| Attribute | Type    | Required  | Description |
| --------- | ------- | --------- | ----------- |
| `token`   | string  | yes       | Runner's registration token |

Example request:

```sh
40
curl --request POST "https://gitlab.example.com/ci/api/v1/runners/register" --form "token=t0k3n"
41 42 43 44 45 46 47 48 49 50 51 52
```

## Delete a Runner

Used to remove a Runner.

```sh
DELETE /ci/api/v1/runners/delete
```

| Attribute | Type    | Required  | Description |
| --------- | ------- | --------- | ----------- |
53
| `token`   | string  | yes       | Unique Runner's token |
54 55 56 57

Example request:

```sh
58
curl --request DELETE "https://gitlab.example.com/ci/api/v1/runners/delete" --form "token=t0k3n"
59
```