FluxIP/app/fleet/regions.py

34 lines
2.0 KiB
Python

from __future__ import annotations
from typing import Final
AWS_LIGHTSAIL_REGIONS: Final[tuple[dict[str, str], ...]] = (
{"code": "ap-east-1", "name_zh": "亚太地区(香港)", "icon": "🇭🇰"},
{"code": "ap-northeast-1", "name_zh": "亚太地区(东京)", "icon": "🇯🇵"},
{"code": "ap-northeast-2", "name_zh": "亚太地区(首尔)", "icon": "🇰🇷"},
{"code": "ap-south-1", "name_zh": "亚太地区(孟买)", "icon": "🇮🇳"},
{"code": "ap-southeast-1", "name_zh": "亚太地区(新加坡)", "icon": "🇸🇬"},
{"code": "ap-southeast-2", "name_zh": "亚太地区(悉尼)", "icon": "🇦🇺"},
{"code": "ap-southeast-3", "name_zh": "亚太地区(雅加达)", "icon": "🇮🇩"},
{"code": "ap-southeast-5", "name_zh": "亚太地区(马来西亚)", "icon": "🇲🇾"},
{"code": "ca-central-1", "name_zh": "加拿大(中部)", "icon": "🇨🇦"},
{"code": "eu-central-1", "name_zh": "欧洲(法兰克福)", "icon": "🇩🇪"},
{"code": "eu-north-1", "name_zh": "欧洲(斯德哥尔摩)", "icon": "🇸🇪"},
{"code": "eu-south-2", "name_zh": "欧洲(西班牙)", "icon": "🇪🇸"},
{"code": "eu-west-1", "name_zh": "欧洲(爱尔兰)", "icon": "🇮🇪"},
{"code": "eu-west-2", "name_zh": "欧洲(伦敦)", "icon": "🇬🇧"},
{"code": "eu-west-3", "name_zh": "欧洲(巴黎)", "icon": "🇫🇷"},
{"code": "sa-east-1", "name_zh": "南美洲(圣保罗)", "icon": "🇧🇷"},
{"code": "us-east-1", "name_zh": "美国东部(弗吉尼亚北部)", "icon": "🇺🇸"},
{"code": "us-east-2", "name_zh": "美国东部(俄亥俄)", "icon": "🇺🇸"},
{"code": "us-west-2", "name_zh": "美国西部(俄勒冈)", "icon": "🇺🇸"},
)
AWS_LIGHTSAIL_REGION_CODES: Final[frozenset[str]] = frozenset(
region["code"] for region in AWS_LIGHTSAIL_REGIONS
)
def list_lightsail_regions() -> list[dict[str, str]]:
return [dict(region) for region in AWS_LIGHTSAIL_REGIONS]