全部產品
Search
文件中心

Cloud Control API:GetResources

更新時間:Jun 09, 2026

透過此介面查詢資源。

介面說明

使用者可前往線上偵錯 API 入口查看資源文件並體驗 Cloud Control API。

此 API 包含資源的 Get 和 List 功能,根據不同的請求路徑,使用者可分別呼叫資源 List 和 Get 能力。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

當前API暫無授權資訊透出。

請求文法

GET /api/v1/providers/{provider}/products/{product}/resources/* HTTP/1.1

路徑參數

名稱

類型

必填

描述

樣本值

requestPath

string

請求路徑。

根據不同的請求路徑,使用者可分別呼叫資源的 List 操作或 Get 操作。

  • List:/api/v1/providers/{provider}/products/{product}/resources/{resourceType}

  • Get:/api/v1/providers/{provider}/products/{product}/resources/{resourceType}/{resourceId}

請求路徑中包含以下變數:

  • provider:雲廠商。目前僅支援傳入Aliyun

  • product:產品 Code。

  • resourceType:資源類型。存在父資源時,格式為{父資源類型 code}/父資源 ID/{資源類型 code}

  • resourceId:資源 ID。

/api/v1/providers/Aliyun/products/Redis/resources/DBInstance/r-8vbf5abe31c9****

請求參數

名稱

類型

必填

描述

樣本值

regionId

string

地域 ID。若雲產品為 region 化產品,則此參數為必填。

cn-beijing

filter

object

資源過濾條件。

此參數支援以 JSON 格式傳入多組鍵值對,用於對資源進行過濾。當某個雲產品的資源在執行 List 或 Get 操作時,若對應操作支援根據特定屬性進行過濾,則可將該屬性作為 filter 參數的過濾條件。

說明

不同資源類型支援的過濾欄位可能存在差異,具體支援欄位請參見對應資源的 OpenAPI 文件。

例如,DBInstance 資源支援透過EditionTypePaymentType欄位進行過濾。

{ "EditionType": "Community", "PaymentType": "PostPaid" }

nextToken

string

分頁游標。

  • 首次查詢時可不設定此參數,系統將預設返回第一頁資料。

  • 非首次查詢時,需傳入上一次呼叫此介面返回的 nextToken 值。

說明

若傳入參數中僅包含數字,雲控制 API 會將其視為頁碼PageNumber進行分頁處理。

AAAAAdDWBF2****

maxResults

integer

分頁查詢時每頁的最大記錄條數。最大值:100。

10

返回參數

名稱

類型

描述

樣本值

object

返回結構。

maxResults

integer

本次請求所返回的最大記錄條數。List 操作返回。

10

nextToken

string

表示目前呼叫返回讀取到的位置,空代表資料已經讀取完畢。List 操作返回。

AAAAAdDWBF2****

requestId

string

請求 ID。

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

resource

object

指定資源。Get 操作返回。

resourceAttributes

object

資源屬性(JSON 格式)。

{"Status":"Available","Description":"","AccountPrivilege":"RoleReadWrite","InstanceId":"r-8vbf5abe31c9c4d4","RegionId":"cn-zhangjiakou","AccountType":"Normal","TypeInfo":{},"AccountName":"cctest"}

resourceId

string

資源 ID。

cctest

resources

array<object>

資源列表。List 操作返回。

array<object>

資源。

resourceAttributes

object

資源屬性(JSON 格式)。

{"Status":"Available","Description":"","AccountPrivilege":"RoleReadWrite","InstanceId":"r-8vbf5abe31c9c4d4","RegionId":"cn-zhangjiakou","AccountType":"Normal","TypeInfo":{},"AccountName":"cctest"}

resourceId

string

資源 ID。

cctest

totalCount

integer

本次請求條件下的資料總量。List 操作返回。

20

樣本

正常返回樣本

JSON格式

{
  "maxResults": 10,
  "nextToken": "AAAAAdDWBF2****\n",
  "requestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****\n",
  "resource": {
    "resourceAttributes": {
      "Status": "Available",
      "Description": "",
      "AccountPrivilege": "RoleReadWrite",
      "InstanceId": "r-8vbf5abe31c9c4d4",
      "RegionId": "cn-zhangjiakou",
      "AccountType": "Normal",
      "TypeInfo": {},
      "AccountName": "cctest"
    },
    "resourceId": "cctest\n"
  },
  "resources": [
    {
      "resourceAttributes": {
        "Status": "Available",
        "Description": "",
        "AccountPrivilege": "RoleReadWrite",
        "InstanceId": "r-8vbf5abe31c9c4d4",
        "RegionId": "cn-zhangjiakou",
        "AccountType": "Normal",
        "TypeInfo": {},
        "AccountName": "cctest"
      },
      "resourceId": "cctest"
    }
  ],
  "totalCount": 20
}

錯誤碼

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情