全部產品
Search
文件中心

CloudOps Orchestration Service:通過公用參數擷取阿里雲地區、可用性區域及雲產品相關資訊

更新時間:Mar 07, 2025

相比普通參數由您自己建立和管理,OOS提供的公用參數由阿里雲統一管理和維護,您可以直接使用公用參數快速擷取阿里雲的地區(所有地區或某個產品支援的地區)、可用性區域、雲產品以及雲產品的Endpoint相關資訊。

準備工作

已安裝並配置阿里雲CLI。如未安裝或配置阿里雲CLI,請參見:

說明

如果您只是用於臨時調試,不需要安裝阿里雲CLI,您可使用阿里雲提供的雲命令列Cloud Shell來調用API介面擷取雲產品主機相關資訊。

  1. 安裝阿里雲CLI。

  2. 配置阿里雲CLI。

    配置調用阿里雲資源所需的身份憑證資訊、服務要求地區等。具體配置,請參見身份憑證類型

操作步驟

擷取阿里雲的地區資訊

支援的所有地區

  • 請求命令

    您可以在阿里雲CLI上運行以下命令,調用GetParametersByPath介面並使用公用參數路徑,快速擷取阿里雲支援的所有地區資訊。

    aliyun oos GetParametersByPath --Path aliyun/services/global-infrastructure/regions

    其中,Path指定要擷取的參數路徑,在該情境下,路徑指定為aliyun/services/global-infrastructure/regions公用參數路徑,表示請求擷取阿里雲支援的所有地區資訊。

  • 返回樣本

    樣本傳回值包括支援的地區ID和名稱,建立時間、更新時間等資訊。僅展示部分地區,例如支援cn-hangzhoucn-shanghai地區。

    樣本:cn-hangzhoucn-shanghai地區資訊

    {
     "MaxResults": 10,
     "Parameters": [
     {
     "Id": "p-xxxxxx",
     "Name": "aliyun/services/global-infrastructure/regions/cn-hangzhou",
     "CreatedDate": "2023-05-17T06:21:15Z",
     "UpdatedDate": "2023-05-17T06:21:15Z",
     "Value": "cn-hangzhou"
     },
     {
     "Id": "p-xxxxxx",
     "Name": "aliyun/services/global-infrastructure/regions/cn-shanghai",
     "CreatedDate": "2023-05-17T06:21:15Z",
     "UpdatedDate": "2023-05-17T06:21:15Z",
     "Value": "cn-shanghai"
     }
     ],
     "RequestId": "xxxxxxxxxxxxxx"
    }

某個產品支援的地區

  • 請求命令

    您可以在阿里雲CLI上運行以下命令,調用GetParametersByPath介面並使用公用參數路徑,快速擷取阿里雲某個產品支援的地區資訊。

    aliyun oos GetParametersByPath --Path aliyun/services/global-infrastructure/products/oos/regions

    其中,Path指定要擷取的參數路徑,在此情境下,路徑指定為aliyun/services/global-infrastructure/products/{product_code}/regions{product_code}為特定產品的代碼(例如oos)。

  • 返回樣本

    樣本傳回值包括地區ID和名稱、建立時間、更新時間等資訊。僅展示部分地區,例如擷取到OOS產品支援cn-hangzhoucn-shanghai地區。

    樣本:OOS支援的部分地區展示

    {
     "MaxResults": 10,
     "Parameters": [
     {
     "Id": "p-xxxxxx",
     "Name": "aliyun/services/global-infrastructure/products/oos/regions/cn-hangzhou",
     "CreatedDate": "2023-05-17T06:21:15Z",
     "UpdatedDate": "2023-05-17T06:21:15Z",
     "Value": "cn-hangzhou"
     },
     {
     "Id": "p-xxxxxx",
     "Name": "aliyun/services/global-infrastructure/products/oos/regions/cn-shanghai",
     "CreatedDate": "2023-05-17T06:21:15Z",
     "UpdatedDate": "2023-05-17T06:21:15Z",
     "Value": "cn-shanghai"
     }
     ],
     "RequestId": "xxxxxxxxxxxxxx"
    }

擷取阿里雲所有可用性區域

  • 請求命令

    您可以在阿里雲CLI上運行以下命令,調用GetParametersByPath介面並使用公用參數路徑,快速擷取阿里雲支援的所有可用性區域。

    aliyun oos GetParametersByPath --Path aliyun/services/global-infrastructure/availability-zones

    其中,Path為指定要擷取的參數路徑。在此情境下,路徑指定為aliyun/services/global-infrastructure/availability-zones,表示請求擷取支援的所有可用性區域資訊。

  • 返回樣本

    樣本傳回值包括可用性區域ID和名稱、建立時間、更新時間等資訊。僅展示部分可用性區域,例如支援cn-shanghai-g-alipaycn-shanghai-x6可用性區域。

    樣本:cn-shanghai-g-alipaycn-shanghai-x6可用性區域資訊

    {
     "MaxResults": 10,
     "Parameters": [
     {
     "Id": "p-xxxxxx",
     "Name": "aliyun/services/global-infrastructure/availability-zones/cn-shanghai-g-alipay",
     "CreatedDate": "2023-05-17T06:21:15Z",
     "UpdatedDate": "2023-05-17T06:21:15Z",
     "Value": "cn-shanghai-g-alipay"
     },
     {
     "Id": "p-xxxxxx",
     "Name": "aliyun/services/global-infrastructure/availability-zones/cn-shanghai-x6",
     "CreatedDate": "2023-05-17T06:21:15Z",
     "UpdatedDate": "2023-05-17T06:21:15Z",
     "Value": "cn-shanghai-x6"
     }
     ],
     "RequestId": "xxxxxxxxxxxxxx"
    }

擷取阿里雲上線的雲產品

  • 請求命令

    您可以在阿里雲CLI上運行以下命令,調用GetParametersByPath介面並使用公用參數路徑,快速擷取阿里雲的上線雲產品資訊。

    aliyun oos GetParametersByPath --Path aliyun/services/global-infrastructure/products

    其中,Path為指定要擷取的參數路徑。在此情境下,路徑指定為aliyun/services/global-infrastructure/products,表示請求擷取所有上線的雲產品資訊。

  • 返回樣本

    樣本傳回值包括雲產品ID和名稱、建立時間、更新時間等資訊。僅展示部分雲產品,例如上線產品為OOSECS

    樣本:上線的OOSECS雲產品資訊

    {
     "MaxResults": 10,
     "Parameters": [
     {
     "Id": "p-xxxxxx",
     "Name": "aliyun/services/global-infrastructure/products/oos",
     "CreatedDate": "2023-05-17T06:21:15Z",
     "UpdatedDate": "2023-05-17T06:21:15Z",
     "Value": "oos"
     },
     {
     "Id": "p-xxxxxx",
     "Name": "aliyun/services/global-infrastructure/products/ecs",
     "CreatedDate": "2023-05-17T06:21:15Z",
     "UpdatedDate": "2023-05-17T06:21:15Z",
     "Value": "ecs"
     }
     ],
     "RequestId": "xxxxxxxxxxxxxx"
    }

擷取阿里雲某個產品的Endpoint

  • 請求命令

    您可以在阿里雲CLI上運行以下命令,調用GetParametersByPath介面並使用公用參數路徑,快速擷取阿里雲某個產品的Endpoint。

    aliyun oos GetParametersByPath --Path aliyun/services/global-infrastructure/products/oos/endpoints

    Path為指定要擷取的參數路徑。在此情境下,路徑為aliyun/services/global-infrastructure/products/{product_code}/endpoints,其中,{product_code}是特定產品的代碼(例如oos),表示請求OOS產品在特定地區的Endpoint資訊。

  • 返回樣本

    樣本傳回值包括Endpoint的ID和名稱、建立時間、更新時間等資訊。僅展示OOS部分地區下的Endpoint,例如擷取OOS產品在cn-hangzhoucn-shanghai地區下的Endpoint。

    樣本:OOS在部分地區下的Endpoint資訊

    {
     "MaxResults": 10,
     "Parameters": [
     {
     "Id": "p-xxxxxx",
     "Name": "aliyun/services/global-infrastructure/products/oos/endpoints/endpoint-cn-hangzhou",
     "CreatedDate": "2023-05-17T06:21:15Z",
     "UpdatedDate": "2023-05-17T06:21:15Z",
     "Value": "oos.cn-hangzhou.aliyuncs.com"
     },
     {
     "Id": "p-xxxxxx",
     "Name": "aliyun/services/global-infrastructure/products/oos/endpoints/endpoint-cn-shanghai",
     "CreatedDate": "2023-05-17T06:21:15Z",
     "UpdatedDate": "2023-05-17T06:21:15Z",
     "Value": "oos.cn-shanghai.aliyuncs.com"
     }
     ],
     "RequestId": "xxxxxxxxxxxxxx"
    }