The TES API specification defines 5 API endpoints. These endpoints follow the RESTful service philosophy. They use JSON in requests and responses and standard HTTP/HTTPS for information transport.
-
GET Service Info
/service-info
- Provides information about the service -
GET List Tasks
/tasks
- List tasks tracked by the TES server. -
GET Task by ID
/tasks/{id}
- Get a single task, based on providing the exact task ID string. -
POST Create Task
/tasks
- Create a new task. -
POST Cancel Task
/tasks/{id}:cancel
- Cancel a task based on providing an exact task ID.
The compliance suite currently supports the TES API specification v1.0. The latest TES API specifications are available here.
The API Models can be generated automatically via Pydantic, eliminating the need to write them everytime
the specification are changed. Instead of JSON schema based validation, the compliance suite relies on
the Pydantic
validation approach.
To generate the models for a newer API specification version, the following steps need to be followed:
- Install
datamodel-code-generator
library that generates pydantic models from just about any data source.
pip install datamodel-code-generator
- Save the API spec locally. Run the command and provide the YAML file as input.
datamodel-codegen --input api_spec.yaml --output model.py
- The converted Python Pydantic API models are present in the output
model.py
file. Now copy this file to thecompliance_suite/models
directory and rename it appropriately.
The official guide by Pydantic is also available here.