docs(api): designed the backup endpoints
This commit is contained in:
parent
3f59c1981f
commit
76f371b6ee
|
@ -40,9 +40,9 @@ __(ND)__ -> Not designed yet.
|
||||||
- [ ] `/delete` (ND)
|
- [ ] `/delete` (ND)
|
||||||
- `/admin`
|
- `/admin`
|
||||||
- `/backup`
|
- `/backup`
|
||||||
- [ ] `/list` (ND)
|
- [ ] `/list`
|
||||||
- [ ] `/fetch/{id}` (ND)
|
- [ ] `/fetch/{id}`
|
||||||
- [ ] `/create` (ND)
|
- [ ] `/create`
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
An example _Register -> Verify -> Authenticate -> Delete_ flow.
|
An example _Register -> Verify -> Authenticate -> Delete_ flow.
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
# `/admin/backup/create` - POST
|
||||||
|
Creates a new backup.
|
||||||
|
|
||||||
|
## HTTP Headers
|
||||||
|
| Header | Content |
|
||||||
|
|---------------|--------------------|
|
||||||
|
| Authorization | `Bearer {token}` |
|
||||||
|
| Content-Type | `application/json` |
|
||||||
|
|
||||||
|
## Content - JSON
|
||||||
|
This json body defines what will be included in the backup.
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"all": true
|
||||||
|
|
||||||
|
/ OR /
|
||||||
|
|
||||||
|
/opt/ "NginxConfig": <bool>
|
||||||
|
/opt/ "MailServer": <bool>
|
||||||
|
/opt/ "Docker": {
|
||||||
|
/opt/ "Stacks": [<name/id>] / "all"
|
||||||
|
/opt/ "Images": [<name/id>] / "all"
|
||||||
|
/opt/ "Volumes": [<name/id>] / "all"
|
||||||
|
}
|
||||||
|
/opt/ "SslCerts": <bool>
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Responses
|
||||||
|
### 200 - Success
|
||||||
|
__Content - JSON:__
|
||||||
|
|
||||||
|
| Field | Description |
|
||||||
|
|---------|----------------------------------|
|
||||||
|
| backups | A list of (id, timestamp) pairs. |
|
||||||
|
### 400 - Error: Bad Request
|
||||||
|
The request was malformed.
|
||||||
|
### 401 - Error: Unauthorized
|
||||||
|
The provided auth token doesn't allow you to perform this operation.
|
||||||
|
### 403 - Error: Forbidden
|
||||||
|
Blocked for security reasons.
|
||||||
|
### 404 - Error: Not Found
|
||||||
|
There was a unknown option in the content.
|
||||||
|
|
||||||
|
__Content - JSON:__
|
||||||
|
|
||||||
|
| Field | Description |
|
||||||
|
|---------|-----------------------------------------------------------------------------|
|
||||||
|
| problem | Tells you where the problem is. Example: "docker/stacks/not_existing_stack" |
|
|
@ -0,0 +1,17 @@
|
||||||
|
# `/admin/backup/fetch/{id}` - GET
|
||||||
|
Downloads the backup identified by `ìd`.
|
||||||
|
|
||||||
|
## HTTP Headers
|
||||||
|
| Header | Content |
|
||||||
|
|---------------|--------------------|
|
||||||
|
| Authorization | `Bearer {token}` |
|
||||||
|
|
||||||
|
## Responses
|
||||||
|
### 200 - Success
|
||||||
|
__Content - BYTES__
|
||||||
|
### 401 - Error: Unauthorized
|
||||||
|
The provided auth token doesn't allow you to perform this operation.
|
||||||
|
### 403 - Error: Forbidden
|
||||||
|
Blocked for security reasons.
|
||||||
|
### 404 - Error: Not Found
|
||||||
|
There was no backup found with the given id.
|
|
@ -0,0 +1,18 @@
|
||||||
|
# `/admin/backup/list` - GET
|
||||||
|
Lists all available backups.
|
||||||
|
|
||||||
|
## HTTP Headers
|
||||||
|
| Header | Content |
|
||||||
|
|---------------|--------------------|
|
||||||
|
| Authorization | `Bearer {token}` |
|
||||||
|
|
||||||
|
## Responses
|
||||||
|
### 200 - Success
|
||||||
|
__Content - JSON:__
|
||||||
|
| Field | Description |
|
||||||
|
|---------|----------------------------------|
|
||||||
|
| backups | A list of (id, timestamp) pairs. |
|
||||||
|
### 401 - Error: Unauthorized
|
||||||
|
The provided auth token doesn't allow you to perform this operation.
|
||||||
|
### 403 - Error: Forbidden
|
||||||
|
Blocked for security reasons.
|
Loading…
Reference in New Issue