carboncue_sdk.region_mapper¶
region_mapper ¶
Region mapping utilities for cloud providers to Electricity Maps zones.
RegionMapper ¶
Maps cloud provider regions to Electricity Maps zone identifiers.
get_zone_id
staticmethod
¶
Get Electricity Maps zone ID for a cloud region.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
region
|
str
|
Cloud provider region code (e.g., us-west-2, eastus) |
required |
provider
|
str
|
Cloud provider name (aws, azure, gcp, digitalocean) |
'aws'
|
Returns:
| Type | Description |
|---|---|
str
|
Electricity Maps zone ID (e.g., US-CAL-CISO) |
Raises:
| Type | Description |
|---|---|
ValueError
|
If region or provider is not supported |
Source code in packages/sdk/src/carboncue_sdk/region_mapper.py
get_supported_regions
staticmethod
¶
Get list of supported regions for a cloud provider.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
provider
|
str
|
Cloud provider name |
'aws'
|
Returns:
| Type | Description |
|---|---|
list[str]
|
List of supported region codes |
Raises:
| Type | Description |
|---|---|
ValueError
|
If provider is not supported |
Source code in packages/sdk/src/carboncue_sdk/region_mapper.py
get_supported_providers
staticmethod
¶
Get list of all supported cloud providers.
Returns:
| Type | Description |
|---|---|
list[str]
|
List of supported provider names |