schemas_v1_db_queries_provider - OmniCloudOrg/OmniOrchestrator GitHub Wiki

provider (src/schemas/v1/db/queries)

Path: src/schemas/v1/db/queries/provider.rs

Table of Contents

Public Items

async fn get_providers_paginated

Definition

pub async fn get_providers_paginated(
    pool: &Pool<MySql>,
    page: i64,
    page_size: i64,
) -> anyhow::Result<Vec<Provider>> {
    // ... function body
}

Documentation

Retrieves a paginated list of providers from the database.

async fn get_provider_count

Definition

pub async fn get_provider_count(pool: &Pool<MySql>) -> anyhow::Result<i64> {
    let query = sqlx::query_scalar::<_, i64>("SELECT COUNT(*) FROM providers");

Documentation

Counts the total number of providers in the database.

async fn get_provider_audit_logs_paginated

Definition

pub async fn get_provider_audit_logs_paginated(
    pool: &Pool<MySql>,
    provider_id: i64,
    page: i64,
    per_page: i64,
) -> anyhow::Result<Vec<ProviderAuditLog>> {
    // ... function body
}

Documentation

Retrieves a pagnated list of audit logs for a specific provider.

Arguments
  • pool - The database connection pool.
  • provider_id - The ID of the provider to retrieve audit logs for.
  • page - The page number to retrieve.
  • per_page - The number of audit logs to retrieve per page.
Returns

A JSON response containing the list of audit logs and pagination information.

async fn get_provider_audit_log_count

Definition

pub async fn get_provider_audit_log_count(
    pool: &Pool<MySql>,
    provider_id: i64,
) -> anyhow::Result<i64> {
    // ... function body
}

Documentation

Counts the total number of audit logs for a given provider.

async fn get_provider_instances

Definition

pub async fn get_provider_instances(
    pool: &Pool<MySql>,
    provider_id: i64,
    page: i64,
    page_size: i64,
) -> anyhow::Result<Vec<Instance>> {
    // ... function body
}

Documentation

Fetch all the instances a provider is responsible for via the regions table between them, with pagination

async fn get_provider_instance_count

Definition

pub async fn get_provider_instance_count(
    pool: &Pool<MySql>,
    provider_id: i64,
) -> anyhow::Result<i64> {
    // ... function body
}

Documentation

Counts the total number of instances associated with a provider.

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