schemas_v1_api_regions - OmniCloudOrg/OmniOrchestrator GitHub Wiki

regions (src/schemas/v1/api)

Path: src/schemas/v1/api/regions.rs

Table of Contents

Public Items

struct CreateRegionRequest

Definition

pub struct CreateRegionRequest {
    /// The name of the region, e.g. 'us-east-1'
    name: String,
    /// A human-friendly name for the region, e.g. 'US East'
    display_name: String,
    /// What provider is responsible for this region? eg. 'kubernetes', 'docker', 'aws', 'gcp', 'azure', 'detee'
    provider: String,
    /// What does your cloud provicer call this region? e.g. 'us-east-1'
    provider_region: Option<String>,
    /// Country / State / province / City in which the data center is located
    location: Option<String>,
    /// Coordinates for the region, can be used for geolocation or mapping
    coordinates: Option<String>, // Will need conversion to POINT in DB layer
    /// The status of the region, can be used to indicate if the region is usable or not
    status: Option<String>, // ENUM('active', 'maintenance', 'offline', 'deprecated')
    /// Can be used to indicate if the region is visible and usable to all orgs
    is_public: Option<bool>,
    /// If you have multiple types of regions, for certain kinds of compute optimization
    class: Option<String>,
}

struct UpdateRegionRequest

Definition

pub struct UpdateRegionRequest {
    name: String,
    description: String,
    url: String,
    org_id: i64,
}

async fn list_regions

Definition

pub async fn list_regions(
    platform_id: i64,
    page: Option<i64>,
    per_page: Option<i64>,
    db_manager: &State<Arc<DatabaseManager>>,
) -> Result<Json<Vec<Region>>, (Status, Json<Value>)> {
    // ... function body
}

async fn list_provider_regions

Definition

pub async fn list_provider_regions(
    platform_id: i64,
    db_manager: &State<Arc<DatabaseManager>>,
) -> Result<Json<Vec<ProviderRegion>>, (Status, Json<Value>)> {
    // ... function body
}
⚠️ **GitHub.com Fallback** ⚠️