pub async fn get_active_regions(pool: &Pool<MySql>) -> Result<Vec<Region>>
Expand description
Retrieves all active deployment regions.
This function fetches all regions with a status of “active”, indicating they are available for new deployments. It’s typically used for deployment target selection and region availability displays.
§Arguments
pool
- Database connection pool for executing the query
§Returns
Ok(Vec<Region>)
- Successfully retrieved list of active regionsErr(anyhow::Error)
- Failed to fetch active regions
§Use Cases
Common use cases include:
- Populating region selection dropdowns in deployment interfaces
- Determining valid deployment targets for automated processes
- Calculating resource availability across active regions
- Health status dashboards showing operational deployment locations
§Query Details
Results are filtered by status=“active” and ordered by creation time, with the most recently created regions appearing first in the list.