-
Notifications
You must be signed in to change notification settings - Fork 5
API Datasets
Brunovski edited this page Jul 27, 2020
·
14 revisions
Description: Retrieves the specified page of datasets
Request:
-
URI Params:
- project (String) Project identifier
-
Query String:
- page (Integer, Optional) Page to retrieve. Default value is 0
- Example:
curl --location --request GET 'http://localhost:8080/projects/8fdaea41-23ca-42cc-a3aa-063bb42bb842/datasets?provider=google'
--header 'Content: application/json'
--header 'Authorization: Bearer {Access Token}
Success Response:
- Status Code: 200 OK
- Content: A list of objects with the resumed information of the datasets
-
Content Type:
- application/json
- Schema:
[
{
"id": String
"version": Integer
},
...
]
- Example:
[{"id": "eb6e9c65-8230-4b75-9ecf-d7d453b67102", "version": 1}, {"id": "12c1da88-e997-49d8-be2e-9820245f6ce1", "version": 2}]Error Responses:
- 400 Bad Request
- 401 Unauthorized
Role: User
Description: Retrieves the specified dataset
Request:
-
URI Params:
- project (String) Project identifier
- dataset (String) Dataset identifier
-
Query String:
- version (Integer, Optional) Version of the dataset information. Default value is the current version
- Example:
curl --location --request GET 'http://localhost:8080/projects/8fdaea41-23ca-42cc-a3aa-063bb42bb842/datasets/eb6e9c65-8230-4b75-9ecf-d7d453b67102?provider=google'
--header 'Content: application/json'
--header 'Authorization: Bearer {Access Token}
Success Response:
- Status Code: 200 OK
- Content: An object with the information of the dataset
-
Content Type:
- application/json
- Schema:
{
"project_id": String
"id": String
"version": Integer
"deprecated": Boolean
"description": String
"schema": {"taxon_id": String, "id": String, "version": Integer, "deprecated": Boolean}
}
- Example:
{
"project_id": "8fdaea41-23ca-42cc-a3aa-063bb42bb842",
"id": "eb6e9c65-8230-4b75-9ecf-d7d453b67102",
"version": 1,
"deprecated": false,
"description": "Example dataset",
"schema": {"taxon_id": "bbacilliformis", "id": "mlst7", "version": 1, "deprecated": false}
}Error Responses:
- 404 Not Found
- 401 Unauthorized
Role: User
Description: Updates the specified dataset
Request:
-
URI Params:
- project (String) Project identifier
- dataset (String) Dataset identifier
- Content: An object with the dataset information
-
Content Type:
- application/json
- Schema:
{
"id": String
"taxon_id": String
"schema_id": String
"description": String
}
- Example:
curl --location --request PUT 'http://localhost:8080/projects/8fdaea41-23ca-42cc-a3aa-063bb42bb842/datasets/eb6e9c65-8230-4b75-9ecf-d7d453b67102?provider=google'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer {Access Token}
--data-raw '{
"id": "eb6e9c65-8230-4b75-9ecf-d7d453b67102",
"taxon_id": "bbacilliformis",
"schema_id": "mlst7",
"description": "Example dataset"
}'
Success Response:
- Status Code: 204 No Content
Error Responses:
- 400 Bad Request
- 401 Unauthorized
Role: User
Description: Creates the specified project
Request:
-
URI Params:
- project (String) Project identifier
- Content: An object with the dataset information
-
Content Type:
- application/json
- Schema:
{
"taxon_id": String
"schema_id": String
"description": String
}
- Example:
curl --location --request POST 'http://localhost:8080/projects/8fdaea41-23ca-42cc-a3aa-063bb42bb842/datasets?provider=google'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer {Access Token}
--data-raw '{
"taxon_id": "bbacilliformis",
"schema_id": "mlst7",
"description": "Example dataset"
}'
Success Response:
- Status Code: 201 Created
- Content: An object with an id to identify the created dataset
-
Content Type:
- application/json
- Example:
{
"id": "b0145762-abb8-438b-a8a7-5800a633668a"
}Error Responses:
- 400 Bad Request
- 401 Unauthorized
Role: User
Description: Deprecates the specified dataset
Request:
-
URI Params:
- project (String) Project identifier
- dataset (String) Dataset identifier
- Example:
curl --location --request DELETE 'http://localhost:8080/projects/8fdaea41-23ca-42cc-a3aa-063bb42bb842/datasets/eb6e9c65-8230-4b75-9ecf-d7d453b67102?provider=google'
--header 'Authorization: Bearer {Access Token}
Success Response:
- Status Code: 204 No Content
Error Responses:
- 401 Unauthorized
Role: User