2022-06-14 22:41:28 +02:00
|
|
|
# Targets
|
2022-06-03 19:48:15 +02:00
|
|
|
|
|
|
|
<aside class="notice">
|
|
|
|
|
|
|
|
All routes in this section require authentication.
|
|
|
|
|
|
|
|
</aside>
|
|
|
|
|
2022-06-14 22:41:28 +02:00
|
|
|
Endpoints for interacting with the list of targets stored on the server.
|
2022-06-03 19:48:15 +02:00
|
|
|
|
2022-06-14 22:41:28 +02:00
|
|
|
## List targets
|
2022-06-03 19:48:15 +02:00
|
|
|
|
|
|
|
```shell
|
|
|
|
curl \
|
|
|
|
-H 'X-Api-Key: secret' \
|
2022-06-16 22:38:42 +02:00
|
|
|
https://example.com/api/v1/targets?offset=10&limit=20
|
2022-06-03 19:48:15 +02:00
|
|
|
```
|
|
|
|
|
2022-06-04 12:18:30 +02:00
|
|
|
> JSON output format
|
2022-06-03 19:48:15 +02:00
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"message": "",
|
|
|
|
"data": [
|
|
|
|
{
|
|
|
|
"id": 1,
|
|
|
|
"url": "https://aur.archlinux.org/discord-ptb.git",
|
|
|
|
"branch": "master",
|
|
|
|
"repo": "bur",
|
|
|
|
"schedule": "",
|
|
|
|
"arch": [
|
|
|
|
{
|
|
|
|
"id": 1,
|
2022-06-14 22:41:28 +02:00
|
|
|
"target_id": 1,
|
2022-06-03 19:48:15 +02:00
|
|
|
"value": "x86_64"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2022-06-14 22:41:28 +02:00
|
|
|
Retrieve a list of targets.
|
2022-06-03 19:48:15 +02:00
|
|
|
|
|
|
|
### HTTP Request
|
|
|
|
|
2022-06-16 22:38:42 +02:00
|
|
|
`GET /api/v1/targets`
|
2022-06-03 19:48:15 +02:00
|
|
|
|
|
|
|
### Query Parameters
|
|
|
|
|
|
|
|
Parameter | Description
|
|
|
|
--------- | -----------
|
|
|
|
limit | Maximum amount of results to return.
|
|
|
|
offset | Offset of results.
|
2022-06-14 22:41:28 +02:00
|
|
|
repo | Limit results to targets that publish to the given repo.
|
2022-06-03 19:48:15 +02:00
|
|
|
|
2022-06-14 22:41:28 +02:00
|
|
|
## Get specific target
|
2022-06-03 19:48:15 +02:00
|
|
|
|
|
|
|
```shell
|
|
|
|
curl \
|
|
|
|
-H 'X-Api-Key: secret' \
|
2022-06-16 22:38:42 +02:00
|
|
|
https://example.com/api/v1/targets/1
|
2022-06-03 19:48:15 +02:00
|
|
|
```
|
|
|
|
|
2022-06-04 12:18:30 +02:00
|
|
|
> JSON output format
|
2022-06-03 19:48:15 +02:00
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"message": "",
|
|
|
|
"data": {
|
|
|
|
"id": 1,
|
|
|
|
"url": "https://aur.archlinux.org/discord-ptb.git",
|
|
|
|
"branch": "master",
|
|
|
|
"repo": "bur",
|
2022-06-04 12:18:30 +02:00
|
|
|
"schedule": "0 3",
|
2022-06-03 19:48:15 +02:00
|
|
|
"arch": [
|
|
|
|
{
|
|
|
|
"id": 1,
|
2022-06-14 22:41:28 +02:00
|
|
|
"target_id": 1,
|
2022-06-03 19:48:15 +02:00
|
|
|
"value": "x86_64"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2022-06-14 22:41:28 +02:00
|
|
|
Get info about a specific target.
|
2022-06-03 19:48:15 +02:00
|
|
|
|
|
|
|
### HTTP Request
|
|
|
|
|
2022-06-16 22:38:42 +02:00
|
|
|
`GET /api/v1/targets/:id`
|
2022-06-03 19:48:15 +02:00
|
|
|
|
|
|
|
### URL Parameters
|
|
|
|
|
|
|
|
Parameter | Description
|
|
|
|
--------- | -----------
|
2022-06-14 22:41:28 +02:00
|
|
|
id | id of requested target
|
2022-06-03 19:48:15 +02:00
|
|
|
|
2022-06-14 22:41:28 +02:00
|
|
|
## Create a new target
|
2022-06-03 19:48:15 +02:00
|
|
|
|
2022-06-14 22:41:28 +02:00
|
|
|
Create a new target with the given data.
|
2022-06-03 19:48:15 +02:00
|
|
|
|
|
|
|
### HTTP Request
|
|
|
|
|
2022-06-16 22:38:42 +02:00
|
|
|
`POST /api/v1/targets`
|
2022-06-03 19:48:15 +02:00
|
|
|
|
|
|
|
### Query Parameters
|
|
|
|
|
|
|
|
Parameter | Description
|
|
|
|
--------- | -----------
|
|
|
|
url | URL of the Git repository.
|
|
|
|
branch | Branch of the Git repository.
|
|
|
|
repo | Vieter repository to publish built packages to.
|
2022-06-09 17:24:16 +02:00
|
|
|
schedule | Cron build schedule (syntax explained [here](https://rustybever.be/docs/vieter/usage/builds/schedule/))
|
2022-06-03 19:48:15 +02:00
|
|
|
arch | Comma-separated list of architectures to build package on.
|
|
|
|
|
2022-06-14 22:41:28 +02:00
|
|
|
## Modify a target
|
2022-06-03 19:48:15 +02:00
|
|
|
|
2022-06-14 22:41:28 +02:00
|
|
|
Modify the data of an existing target.
|
2022-06-03 19:48:15 +02:00
|
|
|
|
|
|
|
### HTTP Request
|
|
|
|
|
2022-06-16 22:38:42 +02:00
|
|
|
`PATCH /api/v1/targets/:id`
|
2022-06-04 12:18:30 +02:00
|
|
|
|
|
|
|
### URL Parameters
|
|
|
|
|
|
|
|
Parameter | Description
|
|
|
|
--------- | -----------
|
2022-06-14 22:41:28 +02:00
|
|
|
id | id of target to modify
|
2022-06-03 19:48:15 +02:00
|
|
|
|
|
|
|
### Query Parameters
|
|
|
|
|
|
|
|
Parameter | Description
|
|
|
|
--------- | -----------
|
|
|
|
url | URL of the Git repository.
|
|
|
|
branch | Branch of the Git repository.
|
|
|
|
repo | Vieter repository to publish built packages to.
|
|
|
|
schedule | Cron build schedule
|
|
|
|
arch | Comma-separated list of architectures to build package on.
|
|
|
|
|
2022-06-14 22:41:28 +02:00
|
|
|
## Remove a target
|
2022-06-03 19:48:15 +02:00
|
|
|
|
2022-06-14 22:41:28 +02:00
|
|
|
Remove a target from the server.
|
2022-06-03 19:48:15 +02:00
|
|
|
|
|
|
|
### HTTP Request
|
|
|
|
|
2022-06-16 22:38:42 +02:00
|
|
|
`DELETE /api/v1/targets/:id`
|
2022-06-03 19:48:15 +02:00
|
|
|
|
|
|
|
### URL Parameters
|
|
|
|
|
|
|
|
Parameter | Description
|
|
|
|
--------- | -----------
|
2022-06-14 22:41:28 +02:00
|
|
|
id | id of target to remove
|