你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Subscriptions - List Locations

获取所有可用的地理位置。
此操作提供资源提供程序可用的所有位置;但是,每个资源提供程序都可能支持此列表的子集。

GET https://management.azure.com/subscriptions/{subscriptionId}/locations?api-version=2022-12-01
GET https://management.azure.com/subscriptions/{subscriptionId}/locations?api-version=2022-12-01&includeExtendedLocations={includeExtendedLocations}

URI 参数

名称 必需 类型 说明
subscriptionId
path True

string

目标订阅的 ID。

api-version
query True

string

要用于此操作的 API 版本。

includeExtendedLocations
query

boolean

是否包括扩展位置。

响应

名称 类型 说明
200 OK

LocationListResult

正常 - 返回位置数组。

Other Status Codes

CloudError

描述操作失败原因的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 流

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名称 说明
user_impersonation 模拟用户帐户

示例

GetLocationsWithASubscriptionId
GetLocationsWithExtendedLocations

GetLocationsWithASubscriptionId

Sample Request

GET https://management.azure.com/subscriptions/a1ffc958-d2c7-493e-9f1e-125a0477f536/locations?api-version=2022-12-01

Sample Response

{
  "value": [
    {
      "id": "/subscriptions/a1ffc958-d2c7-493e-9f1e-125a0477f536/locations/eastus",
      "name": "eastus",
      "type": "Region",
      "displayName": "East US",
      "regionalDisplayName": "(US) East US",
      "metadata": {
        "regionType": "Physical",
        "regionCategory": "Recommended",
        "geography": "United States",
        "geographyGroup": "US",
        "longitude": "-79.8164",
        "latitude": "37.3719",
        "physicalLocation": "Virginia",
        "pairedRegion": [
          {
            "name": "westus",
            "id": "/subscriptions/a1ffc958-d2c7-493e-9f1e-125a0477f536/locations/westus"
          }
        ]
      },
      "availabilityZoneMappings": [
        {
          "logicalZone": "1",
          "physicalZone": "eastus-az1"
        },
        {
          "logicalZone": "2",
          "physicalZone": "eastus-az3"
        },
        {
          "logicalZone": "3",
          "physicalZone": "eastus-az2"
        }
      ]
    },
    {
      "id": "/subscriptions/a1ffc958-d2c7-493e-9f1e-125a0477f536/locations/eastus2",
      "name": "eastus2",
      "type": "Region",
      "displayName": "East US 2",
      "regionalDisplayName": "(US) East US 2",
      "metadata": {
        "regionType": "Physical",
        "regionCategory": "Recommended",
        "geography": "United States",
        "geographyGroup": "US",
        "longitude": "-78.3889",
        "latitude": "36.6681",
        "physicalLocation": "Virginia",
        "pairedRegion": [
          {
            "name": "centralus",
            "id": "/subscriptions/a1ffc958-d2c7-493e-9f1e-125a0477f536/locations/centralus"
          }
        ]
      },
      "availabilityZoneMappings": [
        {
          "logicalZone": "1",
          "physicalZone": "eastus2-az1"
        },
        {
          "logicalZone": "2",
          "physicalZone": "eastus2-az3"
        },
        {
          "logicalZone": "3",
          "physicalZone": "eastus2-az2"
        }
      ]
    }
  ]
}

GetLocationsWithExtendedLocations

Sample Request

GET https://management.azure.com/subscriptions/a1ffc958-d2c7-493e-9f1e-125a0477f536/locations?api-version=2022-12-01&includeExtendedLocations=true

Sample Response

{
  "value": [
    {
      "id": "/subscriptions/a1ffc958-d2c7-493e-9f1e-125a0477f536/locations/eastus",
      "name": "eastus",
      "type": "Region",
      "displayName": "East US",
      "regionalDisplayName": "(US) East US",
      "metadata": {
        "regionType": "Physical",
        "regionCategory": "Recommended",
        "geography": "United States",
        "geographyGroup": "US",
        "longitude": "-79.8164",
        "latitude": "37.3719",
        "physicalLocation": "Virginia",
        "pairedRegion": [
          {
            "name": "westus",
            "id": "/subscriptions/a1ffc958-d2c7-493e-9f1e-125a0477f536/locations/westus"
          }
        ]
      },
      "availabilityZoneMappings": [
        {
          "logicalZone": "1",
          "physicalZone": "eastus-az1"
        },
        {
          "logicalZone": "2",
          "physicalZone": "eastus-az3"
        },
        {
          "logicalZone": "3",
          "physicalZone": "eastus-az2"
        }
      ]
    },
    {
      "id": "/subscriptions/a1ffc958-d2c7-493e-9f1e-125a0477f536/locations/eastus2",
      "name": "eastus2",
      "type": "Region",
      "displayName": "East US 2",
      "regionalDisplayName": "(US) East US 2",
      "metadata": {
        "regionType": "Physical",
        "regionCategory": "Recommended",
        "geography": "United States",
        "geographyGroup": "US",
        "longitude": "-78.3889",
        "latitude": "36.6681",
        "physicalLocation": "Virginia",
        "pairedRegion": [
          {
            "name": "centralus",
            "id": "/subscriptions/a1ffc958-d2c7-493e-9f1e-125a0477f536/locations/centralus"
          }
        ]
      },
      "availabilityZoneMappings": [
        {
          "logicalZone": "1",
          "physicalZone": "eastus2-az1"
        },
        {
          "logicalZone": "2",
          "physicalZone": "eastus2-az3"
        },
        {
          "logicalZone": "3",
          "physicalZone": "eastus2-az2"
        }
      ]
    },
    {
      "id": "/subscriptions/a1ffc958-d2c7-493e-9f1e-125a0477f536/locations/eastus/edgeZones/ezecustomerlabboston1",
      "name": "ezecustomerlabboston1",
      "type": "EdgeZone",
      "displayName": "EZE Customer Lab Boston 1",
      "regionalDisplayName": "(US) EZE Customer Lab Boston 1",
      "metadata": {
        "regionType": "Physical",
        "regionCategory": "Extended",
        "geographyGroup": "US",
        "geography": "United States",
        "longitude": "-71.219038",
        "latitude": "42.301218"
      }
    },
    {
      "id": "/subscriptions/a1ffc958-d2c7-493e-9f1e-125a0477f536/locations/southcentralus/edgeZones/ezecustomerlabhouston1",
      "name": "ezecustomerlabhouston1",
      "type": "EdgeZone",
      "displayName": "EZE Customer Lab Houston 1",
      "regionalDisplayName": "(US) EZE Customer Lab Houston 1",
      "metadata": {
        "regionType": "Physical",
        "regionCategory": "Extended",
        "geographyGroup": "US",
        "geography": "United States",
        "longitude": "-95.41452",
        "latitude": "29.9411"
      }
    }
  ]
}

定义

名称 说明
AvailabilityZoneMappings

区域的可用性区域映射

CloudError

资源管理请求的错误响应。

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

Location

位置信息。

LocationListResult

位置列表操作响应。

LocationMetadata

位置元数据信息

LocationType

位置类型。

PairedRegion

有关配对区域的信息。

RegionCategory

区域的类别。

RegionType

区域的类型。

AvailabilityZoneMappings

区域的可用性区域映射

名称 类型 说明
logicalZone

string

可用性区域的逻辑区域 ID

physicalZone

string

逻辑区域 ID 映射到的可用性区域的完全限定物理区域 ID

CloudError

资源管理请求的错误响应。

名称 类型 说明
error

ErrorResponse

错误响应
对所有 Azure 资源管理器 API 的常见错误响应,可返回失败操作的错误详细信息。 (这也遵循 OData 错误响应格式.) 。

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

Location

位置信息。

名称 类型 说明
availabilityZoneMappings

AvailabilityZoneMappings[]

此区域的可用性区域映射。

displayName

string

位置的显示名称。

id

string

位置的完全限定 ID。 例如,/subscriptions/8d65815f-a5b6-402f-9298-045155da7d74/locations/westus。

metadata

LocationMetadata

位置的元数据,例如 lat/long、配对区域等。

name

string

位置名称。

regionalDisplayName

string

位置及其区域的显示名称。

subscriptionId

string

订阅的 ID。

type

LocationType

位置类型。

LocationListResult

位置列表操作响应。

名称 类型 说明
value

Location[]

位置数组。

LocationMetadata

位置元数据信息

名称 类型 说明
geography

string

位置的地理位置。

geographyGroup

string

位置的地理组。

homeLocation

string

边缘区域的主位置。

latitude

string

位置所在的纬度。

longitude

string

位置所在的经度。

pairedRegion

PairedRegion[]

与该区域配对的区域。

physicalLocation

string

Azure 位置的物理位置。

regionCategory

RegionCategory

区域的类别。

regionType

RegionType

区域的类型。

LocationType

位置类型。

名称 类型 说明
EdgeZone

string

Region

string

PairedRegion

有关配对区域的信息。

名称 类型 说明
id

string

位置的完全限定 ID。 例如,/subscriptions/8d65815f-a5b6-402f-9298-045155da7d74/locations/westus。

name

string

配对区域的名称。

subscriptionId

string

订阅的 ID。

RegionCategory

区域的类别。

名称 类型 说明
Extended

string

Other

string

Recommended

string

RegionType

区域的类型。

名称 类型 说明
Logical

string

Physical

string