docs(api): updated to new "targets" naming

pull/245/head
Jef Roosens 2022-06-14 22:41:28 +02:00 committed by Jef Roosens
parent 102a7f8899
commit 9727b86203
Signed by: Jef Roosens
GPG Key ID: B580B976584B5F30
3 changed files with 31 additions and 32 deletions

View File

@ -24,7 +24,7 @@ curl \
"data": [ "data": [
{ {
"id": 1, "id": 1,
"repo_id": 3, "target_id": 3,
"start_time": 1652008554, "start_time": 1652008554,
"end_time": 1652008559, "end_time": 1652008559,
"arch": "x86_64", "arch": "x86_64",
@ -46,7 +46,7 @@ Parameter | Description
--------- | ----------- --------- | -----------
limit | Maximum amount of results to return. limit | Maximum amount of results to return.
offset | Offset of results. offset | Offset of results.
repo | Only return builds published to this repository. target | Only return builds for this target id.
before | Only return logs started before this time (UTC epoch) before | Only return logs started before this time (UTC epoch)
after | Only return logs started after this time (UTC epoch) after | Only return logs started after this time (UTC epoch)
arch | Only return logs built on this architecture arch | Only return logs built on this architecture
@ -58,7 +58,7 @@ exit_codes | Comma-separated list of exit codes to limit result to; using `!` as
```shell ```shell
curl \ curl \
-H 'X-Api-Key: secret' \ -H 'X-Api-Key: secret' \
https://example.com/api/logs/15 https://example.com/api/logs/1
``` ```
> JSON output format > JSON output format
@ -68,7 +68,7 @@ curl \
"message": "", "message": "",
"data": { "data": {
"id": 1, "id": 1,
"repo_id": 3, "target_id": 3,
"start_time": 1652008554, "start_time": 1652008554,
"end_time": 1652008559, "end_time": 1652008559,
"arch": "x86_64", "arch": "x86_64",
@ -129,11 +129,11 @@ Publish a new build log to the server.
Parameter | Description Parameter | Description
--------- | ----------- --------- | -----------
id | ID of requested log
startTime | Start time of the build (UTC epoch) startTime | Start time of the build (UTC epoch)
endTime | End time of the build (UTC epoch) endTime | End time of the build (UTC epoch)
arch | Architecture on which the build was done arch | Architecture on which the build was done
exitCode | Exit code of the build container exitCode | Exit code of the build container
target | id of target this build is for
### Request body ### Request body

View File

@ -1,4 +1,4 @@
# Git Repositories # Targets
<aside class="notice"> <aside class="notice">
@ -6,15 +6,14 @@ All routes in this section require authentication.
</aside> </aside>
Endpoints for interacting with the list of Git repositories stored on the Endpoints for interacting with the list of targets stored on the server.
server.
## List repos ## List targets
```shell ```shell
curl \ curl \
-H 'X-Api-Key: secret' \ -H 'X-Api-Key: secret' \
https://example.com/api/repos?offset=10&limit=20 https://example.com/api/targets?offset=10&limit=20
``` ```
> JSON output format > JSON output format
@ -32,7 +31,7 @@ curl \
"arch": [ "arch": [
{ {
"id": 1, "id": 1,
"repo_id": 1, "target_id": 1,
"value": "x86_64" "value": "x86_64"
} }
] ]
@ -41,11 +40,11 @@ curl \
} }
``` ```
Retrieve a list of Git repositories. Retrieve a list of targets.
### HTTP Request ### HTTP Request
`GET /api/repos` `GET /api/targets`
### Query Parameters ### Query Parameters
@ -53,14 +52,14 @@ Parameter | Description
--------- | ----------- --------- | -----------
limit | Maximum amount of results to return. limit | Maximum amount of results to return.
offset | Offset of results. offset | Offset of results.
repo | Limit results to repositories that publish to the given repo. repo | Limit results to targets that publish to the given repo.
## Get a repo ## Get specific target
```shell ```shell
curl \ curl \
-H 'X-Api-Key: secret' \ -H 'X-Api-Key: secret' \
https://example.com/api/repos/15 https://example.com/api/targets/1
``` ```
> JSON output format > JSON output format
@ -77,7 +76,7 @@ curl \
"arch": [ "arch": [
{ {
"id": 1, "id": 1,
"repo_id": 1, "target_id": 1,
"value": "x86_64" "value": "x86_64"
} }
] ]
@ -85,25 +84,25 @@ curl \
} }
``` ```
Get info about a specific Git repository. Get info about a specific target.
### HTTP Request ### HTTP Request
`GET /api/repos/:id` `GET /api/targets/:id`
### URL Parameters ### URL Parameters
Parameter | Description Parameter | Description
--------- | ----------- --------- | -----------
id | ID of requested repo id | id of requested target
## Create a new repo ## Create a new target
Create a new Git repository with the given data. Create a new target with the given data.
### HTTP Request ### HTTP Request
`POST /api/repos` `POST /api/targets`
### Query Parameters ### Query Parameters
@ -115,19 +114,19 @@ repo | Vieter repository to publish built packages to.
schedule | Cron build schedule (syntax explained [here](https://rustybever.be/docs/vieter/usage/builds/schedule/)) schedule | Cron build schedule (syntax explained [here](https://rustybever.be/docs/vieter/usage/builds/schedule/))
arch | Comma-separated list of architectures to build package on. arch | Comma-separated list of architectures to build package on.
## Modify a repo ## Modify a target
Modify the data of an existing Git repository. Modify the data of an existing target.
### HTTP Request ### HTTP Request
`PATCH /api/repos/:id` `PATCH /api/targets/:id`
### URL Parameters ### URL Parameters
Parameter | Description Parameter | Description
--------- | ----------- --------- | -----------
id | ID of requested repo id | id of target to modify
### Query Parameters ### Query Parameters
@ -139,16 +138,16 @@ repo | Vieter repository to publish built packages to.
schedule | Cron build schedule schedule | Cron build schedule
arch | Comma-separated list of architectures to build package on. arch | Comma-separated list of architectures to build package on.
## Remove a repo ## Remove a target
Remove a Git repository from the server. Remove a target from the server.
### HTTP Request ### HTTP Request
`DELETE /api/repos/:id` `DELETE /api/targets/:id`
### URL Parameters ### URL Parameters
Parameter | Description Parameter | Description
--------- | ----------- --------- | -----------
id | ID of repo to remove id | id of target to remove

View File

@ -9,7 +9,7 @@ toc_footers:
includes: includes:
- repository - repository
- git - targets
- logs - logs
search: true search: true