schemas_v1_db_queries_storage - OmniCloudOrg/OmniOrchestrator GitHub Wiki

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

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

Table of Contents

Public Items

struct StorageClassFilter

Definition

pub struct StorageClassFilter {
    pub storage_type: Option<String>,
    pub volume_binding_mode: Option<String>,
    pub allow_volume_expansion: Option<bool>,
}

Documentation

Storage class query filters

struct StorageVolumeFilter

Definition

pub struct StorageVolumeFilter {
    pub app_id: Option<i64>,
    pub storage_class_id: Option<i64>,
    pub status: Option<String>,
    pub node_id: Option<i64>,
    pub persistence_level: Option<String>,
    pub write_concern: Option<String>,
}

Documentation

Storage volume query filters

async fn list_storage_classes

Definition

pub async fn list_storage_classes(
    pool: &Pool<MySql>,
    filter: StorageClassFilter,
) -> anyhow::Result<Vec<StorageClass>> {
    // ... function body
}

Documentation

Retrieves all storage classes with optional filtering

async fn get_storage_class_by_id

Definition

pub async fn get_storage_class_by_id(
    pool: &Pool<MySql>,
    id: i64,
) -> anyhow::Result<Option<StorageClass>> {
    // ... function body
}

Documentation

Retrieves a single storage class by ID

async fn list_storage_volumes

Definition

pub async fn list_storage_volumes(
    pool: &Pool<MySql>,
    filter: StorageVolumeFilter,
    page: i64,
    per_page: i64,
) -> anyhow::Result<Vec<StorageVolume>> {
    // ... function body
}

Documentation

Retrieves a paginated list of storage volumes with filtering

async fn count_storage_volumes_with_filter

Definition

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

Documentation

Counts storage volumes with the same filtering options

async fn get_volumes_by_storage_class

Definition

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

Documentation

Get volumes by storage class

async fn list_storage_qos_policies

Definition

pub async fn list_storage_qos_policies(
    pool: &Pool<MySql>,
) -> anyhow::Result<Vec<StorageQosPolicy>> {
    // ... function body
}

Documentation

Get QoS policies

async fn get_volumes_by_write_concern

Definition

pub async fn get_volumes_by_write_concern(
    pool: &Pool<MySql>,
    write_concern: String,
    page: i64,
    per_page: i64,
) -> anyhow::Result<Vec<StorageVolume>> {
    // ... function body
}

Documentation

Get storage with specified write concern

async fn get_volumes_by_persistence_level

Definition

pub async fn get_volumes_by_persistence_level(
    pool: &Pool<MySql>,
    persistence_level: String,
    page: i64, 
    per_page: i64,
) -> anyhow::Result<Vec<StorageVolume>> {
    // ... function body
}

Documentation

Get volumes with specific persistence level

struct RegionVolumes

Definition

pub struct RegionVolumes {
    pub region: Region,
    pub volumes: Vec<StorageVolume>
}

Documentation

Struct to represent a Region with its storage volumes

async fn get_volumes_for_region

Definition

pub async fn get_volumes_for_region(
    pool: &Pool<MySql>,
    region_id: i64,
    page: i64,
    per_page: i64,
) -> anyhow::Result<RegionVolumes> {
    // ... function body
}

Documentation

Retrieves storage volumes for a specific region grouped by region with pagination

async fn count_volumes_for_region

Definition

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

Documentation

Counts the total number of storage volumes for a specific region

struct ProviderRegionVolumes

Definition

pub struct ProviderRegionVolumes {
    pub provider: Provider,
    pub regions: Vec<RegionVolumes>
}

async fn get_volumes_for_provider

Definition

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

Documentation

Retrieves storage volumes for a specific provider grouped by region with pagination

async fn count_volumes_for_provider

Definition

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

Documentation

Counts the total number of storage volumes for a specific provider

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