schemas_v1_api_providers - OmniCloudOrg/OmniOrchestrator GitHub Wiki
Path: src/schemas/v1/api/providers.rs
Provider management module for handeling CRUD operations on providers.
This module provides functionality to create, read, update, and delete providers in the system. It includes API endpoints for managing providers and their associated resources. It also includes a function to retrieve a paginated list of providers from the database. It is designed to be used primarily by the dashboard to add new providers and manage existing ones. The resulting database table is read at runtime by the various directories to determine which provider configs they need to have access to.
pub async fn list_providers(
platform_id: i64,
page: Option<i64>,
per_page: Option<i64>,
db_manager: &rocket::State<Arc<DatabaseManager>>,
) -> Result<Json<Value>, (Status, Json<Value>)> {
// ... function body
}
List all providers in the system with pagination support.
-
platform_id
- The ID of the platform to retrieve providers for. -
page
- The page number to retrieve. -
per_page
- The number of providers to retrieve per page. -
db_manager
- The database manager for accessing platform-specific database pools.
A JSON response containing the list of providers and pagination information.
pub async fn get_provider_audit_logs_paginated(
platform_id: i64,
provider_id: i64,
page: Option<i64>,
per_page: Option<i64>,
db_manager: &rocket::State<Arc<DatabaseManager>>,
) -> Result<Json<Value>, (Status, Json<Value>)> {
// ... function body
}
Retrieves a paginated list of audit logs for a specific provider.
pub async fn get_provider_instances(
platform_id: i64,
provider_id: i64,
page: Option<i64>,
per_page: Option<i64>,
db_manager: &rocket::State<Arc<DatabaseManager>>,
) -> Result<Json<Value>, (Status, Json<Value>)> {
// ... function body
}
Fetch all instances for a given provider.