api_v1_builds - OmniCloudOrg/OmniOrchestrator GitHub Wiki
Path: src/api/v1/builds.rs
Build management module for handling application builds.
This module provides a REST API for managing builds, including:
- Listing all builds with pagination
- Listing builds for a specific application
- Getting details of a specific build
pub async fn list_builds(
pool: &State<sqlx::Pool<MySql>>,
page: Option<u32>,
per_page: Option<u32>,
) -> Json<serde_json::Value> {
// ... function body
}
List all builds with pagination support. This endpoint retrieves a paginated list of all builds in the system, allowing administrators to monitor and track build activities.
-
pool
- Database connection pool -
page
- Optional page number for pagination (defaults to 1) -
per_page
- Optional number of items per page (defaults to 10)
A JSON array of build objects
pub async fn list_builds_for_app(
pool: &State<sqlx::Pool<MySql>>,
app_id: i64,
page: Option<u32>,
per_page: Option<u32>,
) -> Json<Vec<Build>> {
// ... function body
}
List builds for a specific application with pagination support. This endpoint retrieves a paginated list of builds for a specific application, allowing users to track the build history of an application.
-
pool
- Database connection pool -
app_id
- ID of the application to list builds for -
page
- Optional page number for pagination (defaults to 1) -
per_page
- Optional number of items per page (defaults to 10)
A JSON array of build objects for the specified application
pub async fn get_build(pool: &State<sqlx::Pool<MySql>>, build_id: i64) -> Json<Build> {
let build = db::build::get_build_by_id(pool, build_id).await.unwrap();
Get a specific build by ID. This endpoint retrieves detailed information about a specific build, which can be used to inspect the build status, logs, and other details.
-
pool
- Database connection pool -
build_id
- ID of the build to retrieve
A JSON object containing the build details