From d9789c00757f5e80ac8390eab28053dcde86c028 Mon Sep 17 00:00:00 2001 From: Joakim Bygdell Date: Tue, 13 Aug 2024 09:46:05 +0200 Subject: [PATCH] [api] fixup readme --- sda/cmd/api/api.md | 48 +++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/sda/cmd/api/api.md b/sda/cmd/api/api.md index fb7236b90..3887a1749 100644 --- a/sda/cmd/api/api.md +++ b/sda/cmd/api/api.md @@ -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": "", "user": ""}` - 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: @@ -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": "", "filepath": "", "user": ""}` - 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: @@ -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: @@ -99,14 +99,14 @@ 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: @@ -114,10 +114,10 @@ Admin endpoints are only available to a set of whitelisted users specified in th curl -H "Authorization: Bearer $token" -X GET https://HOSTNAME/users/submitter@example.org/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