API Reference¶
The example requests shown here were made using httpie.
All endpoints described here require authorization. When developing basic HTTP authentication may be used. The deployed version requires bearer HTTP authentication using a token provided by your Open ID Connect provider.
Recording¶
Use the endpoints in this module to manage REEs defined using the recording strategy.
- ree.web.api.recording.build() tuple[dict[str, str | None], int] ¶
Start a process to build an REE that was defined using the recording strategy.
- Endpoint:
/api/recording/build
- Form fields:
- file - Path to the ZIP file containing the defined REE.tag - Optional, tag for the started process.
- Returns:
A JSON object containing details about the started process.
- Statuscode 200:
Successfully started the process.
- Statuscode 400:
Incorrect request.
Example request:
http --form POST localhost:5000/api/replay/create tag=my_build file@/path/to/my_recording.zip
Example response:
HTTP/1.1 200 OK { "uuid": "bd4765b4-3ffb-412f-96ad-fc634b72abbd", "tag": "my_build", "status_endpoint": "/api/process/status/bd4765b4-3ffb-412f-96ad-fc634b72abbd" }
- ree.web.api.recording.define() tuple[dict[str, str | None], int] ¶
Start a process to define a new REE using the recording strategy.
- Endpoint:
/api/recording/create
- Form fields:
- file - Path to the ZIP file from which to define the REE.tag - Optional, tag for the started process.dockerfile - Optional, name of the Dockerfile (default ‘Dockerfile’).
- Returns:
A JSON object containing details about the started process.
- Statuscode 200:
Successfully started the process.
- Statuscode 400:
Incorrect request.
Example request:
http --form POST localhost:5000/api/recording/create tag=my_definition file@/path/to/my/project.zip
Example response:
HTTP/1.1 200 OK { "uuid": "d190d794-ae40-43ba-a93a-44d27e8ea134", "tag": "my_definition", "status_endpoint": "/api/process/status/d190d794-ae40-43ba-a93a-44d27e8ea134" }
SBOM¶
- ree.web.api.sbom.define() tuple[dict[str, str | None], int] ¶
Start a process to define a new REE using the SBOM strategy.
- Endpoint:
/api/sbom/define
- Form fields:
- file - Path to the ZIP file from which to define the REE.tag - Optional, tag for the started process.
- Returns:
A JSON object containing details about the started process.
- Statuscode 200:
Successfully started the process.
- Statuscode 400:
Incorrect request.
Example request:
http --form POST localhost:5000/api/sbom/define tag=my_definition file@/path/to/my_project.zip
Example response:
HTTP/1.1 200 OK { "uuid": "bd4765b4-3ffb-412f-96ad-fc634b72abbd", "tag": "my_definition", "status_endpoint": "/api/process/status/bd4765b4-3ffb-412f-96ad-fc634b72abbd" }
Process¶
- ree.web.api.process.download_log(process_uuid: str) tuple[Response | dict[str, str], int] ¶
Download the log corresponding to the process identified by the given UUID.
- Endpoint:
/api/process/log/<process_uuid>
- Parameters:
process_uuid – UUID of the process.
- Returns:
Plain text log.
- Statuscode 200:
Successfully downloaded the log.
- Statuscode 404:
Process not found.
Example request:
http GET localhost:5000/api/process/log/bd4765b4-3ffb-412f-96ad-fc634b72abbd
Example response:
HTTP/1.1 200 OK #0 building with "default" instance using docker driver #1 [internal] load build definition from Dockerfile #1 transferring dockerfile: 106B done #1 DONE 0.0s ...
- ree.web.api.process.download_output(process_uuid: str) tuple[Response | dict[str, str], int] ¶
Download the output of the process identified by the given UUID.
- Endpoint:
/api/process/download/<process_uuid>
- Parameters:
process_uuid – UUID of the process.
- Returns:
The output of the process as a ZIP file.
- Statuscode 200:
Successfully downloaded the output.
- Statuscode 404:
Process not found.
Example request:
http GET localhost:5000/api/process/download/bd4765b4-3ffb-412f-96ad-fc634b72abbd
Example response:
HTTP/1.1 200 OK +-----------------------------------------+ | NOTE: binary data not shown in terminal | +-----------------------------------------+
- ree.web.api.process.get_status(process_uuid: str) tuple[dict[str, str | None], int] ¶
Retrieve status details of the process identified by the given UUID.
- Endpoint:
/api/process/status/<process_uuid>
- Parameters:
process_uuid – UUID of the process.
- Returns:
A JSON object containing status details.
- Statuscode 200:
Successfully retrieved status details.
- Statuscode 404:
Process not found.
Example request:
http GET localhost:5000/api/process/status/bd4765b4-3ffb-412f-96ad-fc634b72abbd
Example response:
HTTP/1.1 200 OK { "download_log_endpoint": "/api/log/download/bd4765b4-3ffb-412f-96ad-fc634b72abbd", "download_endpoint": "/api/process/download/bd4765b4-3ffb-412f-96ad-fc634b72abbd", "uuid": "bd4765b4-3ffb-412f-96ad-fc634b72abbd", "tag": "my_process", "status": "processed" }
Image¶
Use the endpoints in this module to manage base images.
- ree.web.api.image.download_image(image_name: str) tuple[Response | dict[str, str], int] ¶
Download the base image with the given name.
- Parameters:
image_name – Name of the image.
- Returns:
The image in TAR format
- Statuscode 200:
Successfully downloaded the image.
- Statuscode 404:
Image not found.
Example request:
http GET localhost:5000/api/image/download/python_3_11
Example response:
HTTP/1.1 200 OK +-----------------------------------------+ | NOTE: binary data not shown in terminal | +-----------------------------------------+
- ree.web.api.image.list_images() list[dict[str, str]] ¶
Retrieve a list of available base images.
- Returns:
A JSON object containing the list of images.
- Statuscode 200:
Successfully retrieved the list of images.
Example request:
http GET localhost:5000/api/image/list
Example response:
HTTP/1.1 200 OK [ { "download_endpoint": "/api/image/download/python_3_11", "name": "python_3_11" } ]