2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-12-22 19:31:35 +00:00

Add healthz to readme, add error case for set_not_found

This commit is contained in:
asonix 2023-07-07 13:44:21 -05:00
parent 3ccb8ecd8c
commit 0c98d1644c

View file

@ -391,11 +391,15 @@ pict-rs offers the following endpoints:
GET /image/process.jpg?src=asdf.png&thumbnail=256&blur=3.0 GET /image/process.jpg?src=asdf.png&thumbnail=256&blur=3.0
``` ```
which would create a 256x256px JPEG thumbnail and blur it which would create a 256x256px JPEG thumbnail and blur it
- `GET /image/process_backgrounded.{ext}?src={file}&...` queue transformations to be applied to a given file. This accepts the same arguments as the `process.{ext}` endpoint, but does not wait for the processing to complete. - `GET /image/process_backgrounded.{ext}?src={file}&...` queue transformations to be applied to a
given file. This accepts the same arguments as the `process.{ext}` endpoint, but does not wait
for the processing to complete.
- `GET /image/details/process.{ext}?src={file}&...` for getting the details of a processed image. - `GET /image/details/process.{ext}?src={file}&...` for getting the details of a processed image.
The returned JSON is the same format as listed for the full-resolution details endpoint. The returned JSON is the same format as listed for the full-resolution details endpoint.
- `DELETE /image/delete/{delete_token}/{file}` or `GET /image/delete/{delete_token}/{file}` to - `DELETE /image/delete/{delete_token}/{file}` or `GET /image/delete/{delete_token}/{file}` to
delete a file, where `delete_token` and `file` are from the `/image` endpoint's JSON delete a file, where `delete_token` and `file` are from the `/image` endpoint's JSON
- `GET /healthz` Check the health of the pict-rs server. This will check that the `sled` embedded
database is functional and that the configured store is accessible
The following endpoints are protected by an API key via the `X-Api-Token` header, and are disabled The following endpoints are protected by an API key via the `X-Api-Token` header, and are disabled
@ -446,6 +450,14 @@ A secure API key can be generated by any password generator.
} }
``` ```
In the event pict-rs can't find the provided alias, it will return a 400 Bad Request with the
following json:
```json
{
"msg": "No hash associated with provided alias"
}
```
Additionally, all endpoints support setting deadlines, after which the request will cease Additionally, all endpoints support setting deadlines, after which the request will cease
processing. To enable deadlines for your requests, you can set the `X-Request-Deadline` header to an processing. To enable deadlines for your requests, you can set the `X-Request-Deadline` header to an
i128 value representing the number of nanoseconds since the UNIX Epoch. A simple way to calculate i128 value representing the number of nanoseconds since the UNIX Epoch. A simple way to calculate