Orion API Reference
Orion is a Buck2 controller with an HTTP API interface.
Build
A build task contains 3 steps & 2 API endpoints.
- start a build task
- get the build output (SSE)
- get notification when the build is done
Start a build task
Request to start a build task.
POST /build
Request Body
Content-Type: application/json
repo
(string): The name of the repository.target
(string): The build target.args
(array of string): Optional. An array of extra build arguments.webhook
(string): Optional. The webhook URL to notify (POST) once the build is complete.
Example
{
"repo": "hello_world",
"target": "//:main",
"args": [],
"webhook": "https://webhook.site/11ee0e3b-f803-4baa-b993-fb0abbf15c23"
}
Response
id
(string): The build ID.success
(boolean): Whether the build task is started successfully.message
(string): sth. like "Build started".
Example
{
"success": true,
"id": "0193ed6c-3e61-7290-ace2-d8b26adfb1ef",
"message": "Build started"
}
Webhook
The build server will send a POST request to the webhook URL once the build is complete.
Request Body
id
(string): The build ID.success
(boolean): Whether the build task is successful.exit_code
(number,i32
): The exit code of the build task.null
if build failed or stopped by signal.message
(string): sth. like "Build success".
Example
{
"success": true,
"id": "0193ed6c-3e61-7290-ace2-d8b26adfb1ef",
"exit_code": 0,
"message": "Build success"
}
Get the build output
Get the build output in real-time by the build ID.
If the build has ended, all the output will be sent in one event.
GET /build-output/{id}
Path Params
id
(string): The build ID.
Example
GET /build-output/0193ed6c-3e61-7290-ace2-d8b26adfb1ef
Response
The build server will send the build output as Server-Sent Events (SSE).
- Content-Type:
text/event-stream