schemas_v1_api_regions - OmniCloudOrg/OmniOrchestrator GitHub Wiki
Path: src/schemas/v1/api/regions.rs
- struct CreateRegionRequest
- struct UpdateRegionRequest
- async fn list_regions
- async fn list_provider_regions
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>,
}
pub struct UpdateRegionRequest {
name: String,
description: String,
url: String,
org_id: i64,
}
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
}
pub async fn list_provider_regions(
platform_id: i64,
db_manager: &State<Arc<DatabaseManager>>,
) -> Result<Json<Vec<ProviderRegion>>, (Status, Json<Value>)> {
// ... function body
}