Skip to content

API Jobs

Cátia Raquel Jesus Vaz edited this page Nov 26, 2023 · 15 revisions

GET /projects/{project}/jobs

Description: Retrieves the specified page of jobs

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

Success Response:

  • Status Code: 200 OK
  • Content: A list of objects with the information of the jobs
  • Content Type:
    • application/json
  • Schema:
[
   {
      "id": String
      "completed": boolean
      "cancelled": boolean
   },
   ...
]
  • Example:
[{"id": "c965f4ae-f31c-48ad-8fcf-266c8d0281aa", "completed": false, "cancelled": false}, {"id": "12c1da88-e997-49d8-be2e-9820245f6ce1", "completed": true, "cancelled": false}]

Error Responses:

  • 400 Bad Request
  • 401 Unauthorized

Role: User

POST /projects/{project}/jobs

Description: Creates the specified job. It creates the job only if exists more than one profile, in case of being an inference job, or in the inference exists, in case of being a visualization job.

Request:

  • URI Params:
    • project (String) Project identifier
  • Content: An object containing the job information. If the job is an inference, that is the "analysis" property has the value "inference", then the "parameters" property must contain the dataset identifier, and the number of lvs. However, if the job is a visualization, that is the "analysis" property has the value "visualization", then the "parameters" property must contain the dataset identifier and the inference identifier.
  • Content Type:
    • application/json
  • Schema:
{
   "analysis": String - "inference" or "visualization"
   "algorithm": String
   "parameters": Object[]
}
  • Example:
curl --location --request POST 'http://localhost:8080/projects/8fdaea41-23ca-42cc-a3aa-063bb42bb842/jobs?provider=google'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer {Access Token}'
--data-raw '{
   "analysis": "inference",
   "algorithm": "goeburst",
   "parameters": ["eb6e9c65-8230-4b75-9ecf-d7d453b67102", 3]
}'

Success Response:

  • Status Code: 202 Accepted
  • Content: An object with the identifiers to track the job and the analysis to be created, either inference or visualization
  • Content Type:
    • application/json
  • Schema:
{
   "job_id": String
   "analysis_id": String
}
  • Example:
{
   "job_id": "6c5ceae3-a745-4601-bc83-99a6a11194bd",
   "analysis_id": "4af95b39-7ca8-40f8-87f8-617dd961fb73"
}

Error Responses:

  • 404 Not Found
  • 401 Unauthorized

Role: User

DELETE /projects/{project}/jobs/{job}

Description: Removes the specified job

Request:

  • URI Params:
    • project (String) Project identifier
    • job (String) Job identifier
  • Example:
curl --location --request DELETE 'http://localhost:8080/projects/8fdaea41-23ca-42cc-a3aa-063bb42bb842/jobs/6c5ceae3-a745-4601-bc83-99a6a11194bdprovider=google'
--header 'Authorization: Bearer {Access Token}'

Success Response:

  • Status Code: 204 No Content

Error Responses:

  • 401 Unauthorized

Role: User