forked from go-vela/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add information for schedules (go-vela#366)
- Loading branch information
Showing
17 changed files
with
968 additions
and
17 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
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
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
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,14 @@ | ||
--- | ||
title: "Schedule" | ||
linkTitle: "Schedule" | ||
description: > | ||
Learn how to use API endpoints for the schedule resource. | ||
--- | ||
|
||
The below endpoints are available to operate on the `schedule` resource. | ||
|
||
{{% alert color="warning" %}} | ||
This section assumes you already know how to authenticate to the API. | ||
|
||
To authenticate to the API, please review the [authentication documentation](/docs/reference/api/authentication/). | ||
{{% /alert %}} |
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,78 @@ | ||
--- | ||
title: "Add" | ||
linkTitle: "Add" | ||
description: > | ||
Learn how to create a schedule. | ||
--- | ||
|
||
## Endpoint | ||
|
||
``` | ||
POST /api/v1/schedules/:org/:repo | ||
``` | ||
|
||
## Parameters | ||
|
||
The following parameters are used to configure the endpoint: | ||
|
||
| Name | Description | | ||
|--------|----------------------| | ||
| `org` | name of organization | | ||
| `repo` | name of repository | | ||
|
||
## Permissions | ||
|
||
COMING SOON! | ||
|
||
## Responses | ||
|
||
| Status Code | Description | | ||
|-------------|-----------------------------------------------------| | ||
| `200` | indicates the request has succeeded | | ||
| `401` | indicates the user does not have proper permissions | | ||
|
||
## Sample | ||
|
||
{{% alert color="warning" %}} | ||
This section assumes you already know how to authenticate to the API. | ||
|
||
To authenticate to the API, please review the [authentication documentation](/docs/reference/api/authentication/). | ||
{{% /alert %}} | ||
|
||
#### File | ||
|
||
```json | ||
{ | ||
"name": "hourly", | ||
"entry": "0 * * * *", | ||
"active": true | ||
} | ||
``` | ||
|
||
#### Request | ||
|
||
```sh | ||
curl \ | ||
-X POST \ | ||
-H "Authorization: Bearer <token>" \ | ||
-H "Content-Type: application/json" \ | ||
-d "@data.json" \ | ||
"http://127.0.0.1:8080/api/v1/schedules/github/octocat" | ||
``` | ||
|
||
#### Response | ||
|
||
```json | ||
{ | ||
"id": 1, | ||
"repo_id": 1, | ||
"active": true, | ||
"name": "hourly", | ||
"entry": "0 * * * *", | ||
"created_at": 1641314085, | ||
"created_by": "octokitty", | ||
"updated_at": 1641314085, | ||
"updated_by": "octokitty", | ||
"scheduled_at": 0 | ||
} | ||
``` |
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,83 @@ | ||
--- | ||
title: "Get" | ||
linkTitle: "Get" | ||
description: > | ||
Learn how to list schedules. | ||
--- | ||
|
||
## Endpoint | ||
|
||
``` | ||
GET /api/v1/schedules/:org/:repo | ||
``` | ||
|
||
## Parameters | ||
|
||
The following parameters are used to configure the endpoint: | ||
|
||
| Name | Description | | ||
|--------|----------------------| | ||
| `org` | name of organization | | ||
| `repo` | name of repository | | ||
|
||
## Permissions | ||
|
||
COMING SOON! | ||
|
||
## Responses | ||
|
||
| Status Code | Description | | ||
|-------------|-----------------------------------------------------| | ||
| `200` | indicates the request has succeeded | | ||
| `400` | unable to retrieve the schedules | | ||
| `401` | indicates the user does not have proper permissions | | ||
| `404` | unable to retrieve the schedules | | ||
| `500` | system error while retrieving the schedules | | ||
|
||
## Sample | ||
|
||
{{% alert color="warning" %}} | ||
This section assumes you already know how to authenticate to the API. | ||
|
||
To authenticate to the API, please review the [authentication documentation](/docs/reference/api/authentication/). | ||
{{% /alert %}} | ||
|
||
#### Request | ||
|
||
```sh | ||
curl \ | ||
-X GET \ | ||
-H "Authorization: Bearer <token>" \ | ||
"http://127.0.0.1:8080/api/v1/schedules/github/octocat" | ||
``` | ||
|
||
#### Response | ||
|
||
```json | ||
[ | ||
{ | ||
"id": 2, | ||
"repo_id": 1, | ||
"active": true, | ||
"name": "nightly", | ||
"entry": "0 0 * * *", | ||
"created_at": 1641314086, | ||
"created_by": "octokitty", | ||
"updated_at": 1641314086, | ||
"updated_by": "octokitty", | ||
"scheduled_at": 0 | ||
}, | ||
{ | ||
"id": 1, | ||
"repo_id": 1, | ||
"active": true, | ||
"name": "hourly", | ||
"entry": "0 * * * *", | ||
"created_at": 1641314085, | ||
"created_by": "octokitty", | ||
"updated_at": 1641314085, | ||
"updated_by": "octokitty", | ||
"scheduled_at": 0 | ||
} | ||
] | ||
``` |
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,56 @@ | ||
--- | ||
title: "Remove" | ||
linkTitle: "Remove" | ||
description: > | ||
Learn how to delete a schedule. | ||
--- | ||
|
||
## Endpoint | ||
|
||
``` | ||
DELETE /api/v1/schedules/:org/:repo/:schedule | ||
``` | ||
|
||
## Parameters | ||
|
||
The following parameters are used to configure the endpoint: | ||
|
||
| Name | Description | | ||
|------------|----------------------------------| | ||
| `org` | name of organization | | ||
| `repo` | name of repository | | ||
| `schedule` | name of schedule from repository | | ||
|
||
## Permissions | ||
|
||
COMING SOON! | ||
|
||
## Responses | ||
|
||
| Status Code | Description | | ||
|-------------|-----------------------------------------------------| | ||
| `200` | indicates the request has succeeded | | ||
| `401` | indicates the user does not have proper permissions | | ||
|
||
## Sample | ||
|
||
{{% alert color="warning" %}} | ||
This section assumes you already know how to authenticate to the API. | ||
|
||
To authenticate to the API, please review the [authentication documentation](/docs/reference/api/authentication/). | ||
{{% /alert %}} | ||
|
||
#### Request | ||
|
||
```sh | ||
curl \ | ||
-X DELETE \ | ||
-H "Authorization: Bearer <token>" \ | ||
"http://127.0.0.1:8080/api/v1/schedules/github/octocat/hourly" | ||
``` | ||
|
||
#### Response | ||
|
||
```sh | ||
schedule "hourly" deleted | ||
``` |
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,77 @@ | ||
--- | ||
title: "Update" | ||
linkTitle: "Update" | ||
description: > | ||
Learn how to modify a schedule. | ||
--- | ||
|
||
## Endpoint | ||
|
||
``` | ||
PUT /api/v1/schedules/:org/:repo/:schedule | ||
``` | ||
|
||
## Parameters | ||
|
||
The following parameters are used to configure the endpoint: | ||
|
||
| Name | Description | | ||
|------------|----------------------------------| | ||
| `org` | name of organization | | ||
| `repo` | name of repository | | ||
| `schedule` | name of schedule from repository | | ||
|
||
## Permissions | ||
|
||
COMING SOON! | ||
|
||
## Responses | ||
|
||
| Status Code | Description | | ||
|-------------|-----------------------------------------------------| | ||
| `200` | indicates the request has succeeded | | ||
| `401` | indicates the user does not have proper permissions | | ||
|
||
## Sample | ||
|
||
{{% alert color="warning" %}} | ||
This section assumes you already know how to authenticate to the API. | ||
|
||
To authenticate to the API, please review the [authentication documentation](/docs/reference/api/authentication/). | ||
{{% /alert %}} | ||
|
||
#### File | ||
|
||
```json | ||
{ | ||
"active": false | ||
} | ||
``` | ||
|
||
#### Request | ||
|
||
```sh | ||
curl \ | ||
-X PUT \ | ||
-H "Authorization: Bearer <token>" \ | ||
-H "Content-Type: application/json" \ | ||
-d "@data.json" \ | ||
"http://127.0.0.1:8080/api/v1/schedules/github/octocat/hourly" | ||
``` | ||
|
||
#### Response | ||
|
||
```json | ||
{ | ||
"id": 1, | ||
"repo_id": 1, | ||
"active": false, | ||
"name": "hourly", | ||
"entry": "0 * * * *", | ||
"created_at": 1641314085, | ||
"created_by": "octokitty", | ||
"updated_at": 1641314086, | ||
"updated_by": "octokitty", | ||
"scheduled_at": 0 | ||
} | ||
``` |
Oops, something went wrong.