Skip to content

API Isolates

Brunovski edited this page Dec 28, 2020 · 15 revisions

GET /projects/{project}/datasets/{dataset}/isolates

Description: Retrieves the specified page of isolates

Request:

  • URI Params:
    • project (String) Project identifier
    • dataset (String) Dataset 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/eb6e9c65-8230-4b75-9ecf-d7d453b67102/isolates?provider=google'
--header 'Authorization: Bearer {Access Token}'

Success Response:

  • Status Code: 200 OK
  • Content: A list of objects with the resumed information of the isolates
  • Content Type:
    • application/json
  • Schema:
[
   {
      "id": String
      "version": Integer
   },
   ...
]
  • Example:
[{"id": "1", "version": 1}, {"id": "2", "version": 2}]

Error Responses:

  • 400 Bad Request
  • 401 Unauthorized

Role: User

GET /projects/{project}/datasets{dataset}/isolates/{isolate}

Description: Retrieves the specified profile

Request:

  • URI Params:
    • project (String) Project identifier
    • dataset (String) Dataset identifier
    • isolate (String) Isolate identifier
  • Query String:
    • version (Integer, Optional) Version of the isolate 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/isolates/1?provider=google'
--header 'Authorization: Bearer {Access Token}'

Success Response:

  • Status Code: 200 OK
  • Content: An object with the information of the isolate
  • Content Type:
    • application/json
  • Schema:
{
   "project_id": String
   "dataset_id": String
   "id": String
   "version": Integer
   "deprecated": Boolean
   "description": String
   "profile": {"id": String, "version": Integer}
   "ancillaries": [{ "key": String, "value": String}]
}
  • Example:
{
   "project_id": "8fdaea41-23ca-42cc-a3aa-063bb42bb842",
   "dataset_id": "eb6e9c65-8230-4b75-9ecf-d7d453b67102",
   "id": "1",
   "version": 1,
   "deprecated": false,
   "description": "Example isolate",
   "profile": {"id": "1", "version": 1},
   "ancillaries": [{ "key": "country", "value": "Portugal"}]
}

Error Responses:

  • 404 Not Found
  • 401 Unauthorized

Role: User

GET /projects/{project}/datasets{dataset}/isolates/files

Description: Retrieves the specified page of isolates in formatted string

Request:

  • URI Params:
    • project (String) Project identifier
    • dataset (String) Dataset 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/eb6e9c65-8230-4b75-9ecf-d7d453b67102/isolates/files?provider=google'
--header 'Authorization: Bearer {Access Token}'

Success Response:

  • Status Code: 200 OK
  • Content: A formatted string with the respective page of isolates
  • Content Type:
    • text/plain
  • Example:
id   isolate	country    continent   ST
1    AU13161	Portugal   Europe      1
2    LMG 1231T	Unknown                2

Error Responses:

  • 400 Bad Request
  • 401 Unauthorized

Role: User

PUT /projects/{project}/datasets{dataset}/isolates/{isolate}

Description: Stores the specified isolate. It stores the isolate only if in case of the profile is not null then it must already exist.

Request:

  • URI Params:
    • project (String) Project identifier
    • dataset (String) Dataset identifier
    • isolate (String) Isolate identifier
  • Content: An object with the information of the isolate
  • Content Type:
    • application/json
  • Schema:
{
   "id": String
   "description": String
   "profile_id": String (Optional)
   "ancillaries": [{ "key": String, "value": String}]
}
  • Example:
curl --location --request PUT 'http://localhost:8080/projects/8fdaea41-23ca-42cc-a3aa-063bb42bb842/datasets/eb6e9c65-8230-4b75-9ecf-d7d453b67102/isolates/1?provider=google'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer {Access Token}'
--data-raw '{
   "id": "1",
   "description": "Example isolate",
   "profile": "1",
   "ancillaries": [{ "key": "country", "value": "Portugal"}]
}'

Success Response:

  • Status Code: 204 No Content

Error Responses:

  • 400 Bad Request
  • 401 Unauthorized

Role: User

PUT /projects/{project}/datasets{dataset}/isolates/files

Description: Stores the isolates of the file

Request:

  • URI Params:
    • project (String) Project identifier
    • dataset (String) Dataset identifier
  • Query String:
    • id (Integer, Optional) Column of the file that contains the isolates identifier. Default value is 0
    • file (File) File that contains the isolates
  • Content: A file with isolates
  • Content Type:
    • multipart/form-data
  • Example:
curl --location --request PUT 'http://localhost:8080/projects/8fdaea41-23ca-42cc-a3aa-063bb42bb842/datasets/eb6e9c65-8230-4b75-9ecf-d7d453b67102/isolates/files?provider=google'
--header 'Content-Type: multipart/form-data'
--header 'Authorization: Bearer {Access Token}'
--form 'file=@/filelocation/filename.txt'

Success Response:

  • Status Code: 200 OK
  • Content Type:
    • application/json
  • Schema:
{
   "invalid_lines": Integer[]
   "invalid_entities": String[]
}
  • Example:
{
   "invalid_lines": [1, 2],
   "invalid_entities": ["3"]
}

Error Responses:

  • 400 Bad Request
  • 401 Unauthorized

Role: User

POST /projects/{project}/datasets{dataset}/isolates/files

Description: Stores the non-existing profiles of the file

Request:

  • URI Params:
    • project (String) Project identifier
    • dataset (String) Dataset identifier
  • Query String:
    • id (Integer, Optional) Column of the file that contains the isolates identifier. Default value is 0
    • file (File) File that contains the isolates
  • Content: A file with isolates
  • Content Type:
    • multipart/form-data
  • Example:
curl --location --request PUT 'http://localhost:8080/projects/8fdaea41-23ca-42cc-a3aa-063bb42bb842/datasets/eb6e9c65-8230-4b75-9ecf-d7d453b67102/isolates/files?provider=google'
--header 'Content-Type: multipart/form-data'
--header 'Authorization: Bearer {Access Token}'
--form 'file=@/filelocation/filename.txt'

Success Response:

  • Status Code: 200 OK
  • Content Type:
    • application/json
  • Schema:
{
   "invalid_lines": Integer[]
   "invalid_entities": String[]
}
  • Example:
{
   "invalid_lines": [1, 2],
   "invalid_entities": ["3"]
}

Error Responses:

  • 400 Bad Request
  • 401 Unauthorized

Role: User

DELETE /projects/{project}/datasets{dataset}/isolates/{isolate}

Description: Deprecates the specified isolate

Request:

  • URI Params:
    • project (String) Project identifier
    • dataset (String) Dataset identifier
    • isolate (String) Isolate identifier
  • Example:
curl --location --request DELETE 'http://localhost:8080/projects/8fdaea41-23ca-42cc-a3aa-063bb42bb842/datasets/eb6e9c65-8230-4b75-9ecf-d7d453b67102/isolates/1?provider=google'
--header 'Authorization: Bearer {Access Token}'

Success Response:

  • Status Code: 204 No Content

Error Responses:

  • 401 Unauthorized

Role: User

Clone this wiki locally