Skip to content

API Inferences

Brunovski edited this page Dec 28, 2020 · 14 revisions

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

Description: Retrieves the specified page of inferences

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/inferences?provider=google'
--header 'Authorization: Bearer {Access Token}'

Success Response:

  • Status Code: 200 OK
  • Content: A list of objects with the resumed information of the inferences
  • Content Type:
    • application/json
  • Schema:
[
   {
      "id": String
   },
   ...
]
  • Example:
[{"id": "4af95b39-7ca8-40f8-87f8-617dd961fb73"}, {"id": "12c1da88-e997-49d8-be2e-9820245f6ce1"}]

Error Responses:

  • 400 Bad Request
  • 401 Unauthorized

Role: User

GET /projects/{project}/datasets{dataset}/inferences/{inference}

Description: Retrieves the specified inference

Request:

  • URI Params:
    • project (String) Project identifier
    • dataset (String) Dataset identifier
    • inference (String) Inference identifier
  • Query String:
    • format (String, Optional) Format of the inference tree. Default value is newick
  • Example:
curl --location --request GET 'http://localhost:8080/projects/8fdaea41-23ca-42cc-a3aa-063bb42bb842/datasets/eb6e9c65-8230-4b75-9ecf-d7d453b67102/inferences/4af95b39-7ca8-40f8-87f8-617dd961fb73?provider=google'
--header 'Authorization: Bearer {Access Token}'

Success Response:

  • Status Code: 200 OK
  • Content: An object with the information of the inference
  • Content Type:
    • application/json
  • Schema:
{
   "project_id": String
   "dataset_id": String
   "id": String
   "deprecated": Boolean
   "algorithm": String
   "tree": String
}
  • Example:
{
   "project_id": "8fdaea41-23ca-42cc-a3aa-063bb42bb842",
   "dataset_id": "eb6e9c65-8230-4b75-9ecf-d7d453b67102",
   "id": "4af95b39-7ca8-40f8-87f8-617dd961fb73",
   "deprecated": false,
   "algorithm": "goeburst",
   "tree": "(1:1,2:2)3;"
}

Error Responses:

  • 404 Not Found
  • 401 Unauthorized

Role: User

POST /projects/{project}/datasets{dataset}/inferences

Description: Creates the specified inference. It creates the inference only if the format is supported, there is at least one edge composing the tree, and all the vertices composing the tree represent existing profiles.

Request:

  • URI Params:
    • project (String) Project identifier
    • dataset (String) Dataset identifier
  • Query String:
    • format (String, Optional) Format of the inference tree
    • file (File, Optional) File that contains the inference tree
  • Content: An object with an id to identify the created inference
  • Content Type:
    • application/json
  • Example:
curl --location --request POST 'http://localhost:8080/projects/8fdaea41-23ca-42cc-a3aa-063bb42bb842/datasets/eb6e9c65-8230-4b75-9ecf-d7d453b67102/inferences?provider=google'
--header 'Content-Type: multipart/form-data'
--header 'Authorization: Bearer {Access Token}'
--form 'file=@/filelocation/filename.txt'

Success Response:

  • Status Code: 201 Created
  • Content: An object with an id to identify the created inference
  • Content Type:
    • application/json
  • Schema:
{
   "id": String
}
  • Example:
{
   "id": "b0145762-abb8-438b-a8a7-5800a633668a"
}

Error Responses:

  • 400 Bad Request
  • 401 Unauthorized

Role: User

DELETE /projects/{project}/datasets{dataset}/inferences/{inference}

Description: Deprecates the specified inference

Request:

  • URI Params:
    • project (String) Project identifier
    • dataset (String) Dataset identifier
    • inference (String) Inference identifier
  • Example:
curl --location --request DELETE 'http://localhost:8080/projects/8fdaea41-23ca-42cc-a3aa-063bb42bb842/datasets/eb6e9c65-8230-4b75-9ecf-d7d453b67102/inferences/4af95b39-7ca8-40f8-87f8-617dd961fb73?provider=google'
--header 'Authorization: Bearer {Access Token}'

Success Response:

  • Status Code: 204 No Content

Error Responses:

  • 401 Unauthorized

Role: User

Clone this wiki locally