Skip to content

Commit

Permalink
[api] fixup readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jbygdell committed Aug 13, 2024
1 parent 352b542 commit d9789c0
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions sda/cmd/api/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ Admin endpoints are only available to a set of whitelisted users specified in th
- accepts `POST` requests with JSON data with the format: `{"filepath": "</PATH/TO/FILE/IN/INBOX>", "user": "<USERNAME>"}`
- triggers the ingestion of the file.

- Error codes
- `200` Query execute ok.
- `400` Error due to bad payload i.e. wrong `user` + `filepath` combination.
- `401` Token user is not in the list of admins.
- `500` Internal error due to DB or MQ failures.
- Error codes
- `200` Query execute ok.
- `400` Error due to bad payload i.e. wrong `user` + `filepath` combination.
- `401` Token user is not in the list of admins.
- `500` Internal error due to DB or MQ failures.

Example:

Expand All @@ -45,11 +45,11 @@ Admin endpoints are only available to a set of whitelisted users specified in th
- accepts `POST` requests with JSON data with the format: `{"accession_id": "<FILE_ACCESSION>", "filepath": "</PATH/TO/FILE/IN/INBOX>", "user": "<USERNAME>"}`
- assigns accession ID to the file.

- Error codes
- `200` Query execute ok.
- `400` Error due to bad payload i.e. wrong `user` + `filepath` combination.
- `401` Token user is not in the list of admins.
- `500` Internal error due to DB or MQ failures.
- Error codes
- `200` Query execute ok.
- `400` Error due to bad payload i.e. wrong `user` + `filepath` combination.
- `401` Token user is not in the list of admins.
- `500` Internal error due to DB or MQ failures.

Example:

Expand Down Expand Up @@ -77,11 +77,11 @@ Admin endpoints are only available to a set of whitelisted users specified in th
- accepts `POST` requests with the dataset name as last part of the path`
- releases a dataset so that it can be downloaded.
- Error codes
- `200` Query execute ok.
- `400` Error due to bad payload.
- `401` Token user is not in the list of admins.
- `500` Internal error due to DB or MQ failures.
- Error codes
- `200` Query execute ok.
- `400` Error due to bad payload.
- `401` Token user is not in the list of admins.
- `500` Internal error due to DB or MQ failures.
Example:
Expand All @@ -99,25 +99,25 @@ Admin endpoints are only available to a set of whitelisted users specified in th
curl -H "Authorization: Bearer $token" -X GET https://HOSTNAME/users
```

- Error codes
- `200` Query execute ok.
- `401` Token user is not in the list of admins.
- `500` Internal error due to DB failure.
- Error codes
- `200` Query execute ok.
- `401` Token user is not in the list of admins.
- `500` Internal error due to DB failure.

- `/users/:username/files`
- accepts `GET` requests`
- Returns all files (that is not part of a dataset) for a user with active uploads as a JSON array
- Returns all files (that are not part of a dataset) for a user with active uploads as a JSON array
Example:
```bash
curl -H "Authorization: Bearer $token" -X GET https://HOSTNAME/users/[email protected]/files
```

- Error codes
- `200` Query execute ok.
- `401` Token user is not in the list of admins.
- `500` Internal error due to DB failure.
- Error codes
- `200` Query execute ok.
- `401` Token user is not in the list of admins.
- `500` Internal error due to DB failure.

#### Configure Admin users

Expand Down

0 comments on commit d9789c0

Please sign in to comment.