api_v1_builds - OmniCloudOrg/OmniOrchestrator GitHub Wiki

builds (src/api/v1)

Path: src/api/v1/builds.rs

Module Documentation

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

Table of Contents

Public Items

async fn list_builds

Definition

pub async fn list_builds(
    pool: &State<sqlx::Pool<MySql>>,
    page: Option<u32>,
    per_page: Option<u32>,
) -> Json<serde_json::Value> {
    // ... function body
}

Documentation

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.

Arguments
  • pool - Database connection pool
  • page - Optional page number for pagination (defaults to 1)
  • per_page - Optional number of items per page (defaults to 10)
Returns

A JSON array of build objects

async fn list_builds_for_app

Definition

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
}

Documentation

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.

Arguments
  • 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)
Returns

A JSON array of build objects for the specified application

async fn get_build

Definition

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();

Documentation

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.

Arguments
  • pool - Database connection pool
  • build_id - ID of the build to retrieve
Returns

A JSON object containing the build details

⚠️ **GitHub.com Fallback** ⚠️