Skip to content

Commit 7d49ecf

Browse files
authored
Changes by create-pull-request action (#167)
2 parents c9db676 + 101bd4a commit 7d49ecf

File tree

2 files changed

+29
-8
lines changed

2 files changed

+29
-8
lines changed

docs/dictionary/wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ pem
269269
pgvolume
270270
phenome
271271
pkcs
272+
playload
272273
png
273274
podSelector
274275
podman

docs/services/api.md

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,37 +49,57 @@ Endpoints:
4949
Admin endpoints are only available to a set of whitelisted users specified in the application config.
5050

5151
- `/file/ingest`
52-
- accepts `POST` requests with JSON data with the format: `{"filepath": "</PATH/TO/FILE/IN/INBOX>", "user": "<USERNAME>"}`
52+
- accepts `POST` requests with either:
53+
- A JSON payload: `{"filepath": "</PATH/TO/FILE/IN/INBOX>", "user": "<USERNAME>"}`
54+
- OR a `fileid` query parameter: `/file/ingest?fileid=<FILE_UUID>`
5355
- triggers the ingestion of the file.
5456

57+
- If both a JSON payload and a `fileid` query parameter are provided in the same request, a `400 Bad Request` is returned.
58+
5559
- Error codes
56-
- `200` Query execute ok.
57-
- `400` Error due to bad payload i.e. wrong `user` + `filepath` combination.
60+
- `200` Query executed successfully.
61+
- `400` Bad request (e.g. wrong `user` + `filepath` combination, both payload and fileid provided, invalid fileid, or invalid JSON).
5862
- `401` Token user is not in the list of admins.
5963
- `500` Internal error due to DB or MQ failures.
6064

61-
Example:
65+
Example (JSON payload):
6266

6367
```bash
6468
curl -H "Authorization: Bearer $token" -H "Content-Type: application/json" -X POST -d '{"filepath": "/uploads/file.c4gh", "user": "testuser"}' https://HOSTNAME/file/ingest
6569
```
6670

71+
Example (fileid query parameter):
72+
73+
```bash
74+
curl -H "Authorization: Bearer $token" -X POST "https://HOSTNAME/file/ingest?fileid=<FILE_UUID>"
75+
6776
- `/file/accession`
68-
- accepts `POST` requests with JSON data with the format: `{"accession_id": "<FILE_ACCESSION>", "filepath": "</PATH/TO/FILE/IN/INBOX>", "user": "<USERNAME>"}`
77+
- accepts `POST` requests with either:
78+
- A JSON playload: `{"accession_id": "<FILE_ACCESSION>", "filepath": "</PATH/TO/FILE/IN/INBOX>", "user": "<USERNAME>"}`
79+
- OR query parameters: `/file/accession?fileid=<FILE_UUID>&accessionid=<ACCESSION_ID>`
6980
- assigns accession ID to the file.
7081
82+
- If both a JSON payload and query parameters are provided in the same request, a `400 Bad Request` is returned.
83+
7184
- Error codes
72-
- `200` Query execute ok.
73-
- `400` Error due to bad payload i.e. wrong `user` + `filepath` combination.
85+
- `200` Query executed successfully.
86+
- `400` Bad request (e.g. wrong `user` + `filepath` combination, both payload and parameters provided, invalid fileid, or invalid JSON).
7487
- `401` Token user is not in the list of admins.
88+
- `404` Decrypted checksum not found.
7589
- `500` Internal error due to DB or MQ failures.
7690
77-
Example:
91+
Example (JSON payload):
7892
7993
```bash
8094
curl -H "Authorization: Bearer $token" -H "Content-Type: application/json" -X POST -d '{"accession_id": "my-id-01", "filepath": "/uploads/file.c4gh", "user": "testuser"}' https://HOSTNAME/file/accession
8195
```
8296

97+
Example (query parameters):
98+
99+
```bash
100+
curl -H "Authorization: Bearer $token" -X POST "https://HOSTNAME/file/accession?fileid=<FILE_UUID>&accessionid=<ACCESSION_ID>"
101+
```
102+
83103
- `/file/verify/:accession`
84104
- accepts `PUT` requests with an accession ID as the last element in the query
85105
- triggers re-verification of the file with the specific accession ID.

0 commit comments

Comments
 (0)