全部產品
Search
文件中心

:ListDiscoveredResources

更新時間:Feb 08, 2025

調用ListDiscoveredResources介面查詢資源清單。

調試

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

請求參數

名稱 類型 是否必選 樣本值 描述
Action String ListDiscoveredResources

要執行的操作,取值:ListDiscoveredResources

ResourceId String eni-hp31cqoba96jagtz****

資源ID。

ResourceDeleted Integer 1

資源狀態。取值:

  • 0:已刪除。
  • 1(預設值):保有中。
PageSize Integer 1

分頁查詢時設定的每頁行數。取值範圍:1~100。

PageNumber Integer 10

資源清單的頁碼。起始值:1。

ResourceTypes String ACS::ECS::NetworkInterface

資源類型。多個資源類型用半形逗號(,)分隔。

Regions String cn-huhehaote

地區。多個地區用半形逗號(,)分隔。

MultiAccount Boolean false

該參數計劃於2021年06月30日00時00分00秒前下線,其替代功能帳號組的API將於2021年05月30日00時00分00秒前上線。如果您正在使用該參數,建議您在2021年05月30日00時00分00秒之後切換為帳號組的API。關於帳號組,請參見帳號組

MemberId Long 120886341261****

該參數計劃於2021年06月30日00時00分00秒前下線,其替代功能帳號組的API將於2021年05月30日00時00分00秒前上線。如果您正在使用該參數,建議您在2021年05月30日00時00分00秒之後切換為帳號組的API。關於帳號組,請參見帳號組

返回資料

名稱 類型 樣本值 描述
DiscoveredResourceProfiles Object

資源清單結果。

DiscoveredResourceProfileList Array of DiscoveredResourceProfile

資源清單。

ResourceType String ACS::ECS::NetworkInterface

資源類型。

Region String cn-huhehaote

地區ID。

ResourceCreationTime Long 1618675206000

資源建立時間戳記。

Tags String {\"key1\":[\"value2\"]}

資源標籤。

AccountId Long 120886317861****

阿里雲帳號ID。

ResourceId String eni-hp31cqoba96jagtz****

資源ID。

ResourceName String Cloud Firewall

資源名稱。

ResourceDeleted Integer 1

資源刪除狀態。取值:

  • 1:未刪除。
  • 0:已刪除。
ResourceStatus String InUse

資源狀態。資源的狀態取決於各雲端服務對其的定義,該參數可能為空白。

例如:

  • 當資源類型為ACS::ECS::Instance時,由於ECS執行個體有狀態,因此該參數為Running或Stopped。
  • 當資源類型為ACS::OSS::Bucket時,由於OSS Bucket無狀態,因此該參數為空白。
PageNumber Integer 10

資源清單的頁碼。起始值:1。

PageSize Integer 1

分頁查詢時設定的每頁行數。取值範圍:1~100。

TotalCount Integer 129

資源總數。

RequestId String C7817373-78CB-4F9A-8AFA-E7A88E9D64A2

請求ID。

樣本

請求樣本

http(s)://[Endpoint]/?Action=ListDiscoveredResources
&PageNumber=10
&PageSize=1
&<公用請求參數>

正常返回樣本

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<ListDiscoveredResourcesResponse>
	<DiscoveredResourceProfiles>
		<TotalCount>129</TotalCount>
		<PageSize>1</PageSize>
		<PageNumber>10</PageNumber>
		<DiscoveredResourceProfileList>
			<AccountId>120886317861****</AccountId>
			<ResourceCreationTime>1618675206000</ResourceCreationTime>
			<ResourceId>eni-hp31cqoba96jagtz****</ResourceId>
			<ResourceName>Cloud Firewall</ResourceName>
			<Region>cn-huhehaote</Region>
			<ResourceStatus>InUse</ResourceStatus>
			<ResourceType>ACS::ECS::NetworkInterface</ResourceType>
			<ResourceDeleted>1</ResourceDeleted>
			<Tags>{\"key1\":[\"value2\"]}</Tags>
		</DiscoveredResourceProfileList>
	</DiscoveredResourceProfiles>
	<RequestId>C7817373-78CB-4F9A-8AFA-E7A88E9D64A2</RequestId>
</ListDiscoveredResourcesResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "DiscoveredResourceProfiles" : {
    "TotalCount" : 129,
    "PageSize" : 1,
    "PageNumber" : 10,
    "DiscoveredResourceProfileList" : [ {
      "AccountId" : "120886317861****",
      "ResourceCreationTime" : 1618675206000,
      "ResourceId" : "eni-hp31cqoba96jagtz****",
      "ResourceName" : "Cloud Firewall",
      "Region" : "cn-huhehaote",
      "ResourceStatus" : "InUse",
      "ResourceType" : "ACS::ECS::NetworkInterface",
      "ResourceDeleted" : 1,
      "Tags" : "{\"key1\":[\"value2\"]}"
    } ]
  },
  "RequestId" : "C7817373-78CB-4F9A-8AFA-E7A88E9D64A2"
}

錯誤碼

HttpCode 錯誤碼 錯誤資訊 描述
400 NoPermission You are not authorized to perform this operation. 您無權執行此操作。
400 MemberNotBelongToMaster The specified member does not belong to your organization. 該成員帳號不屬於您所在的資來源目錄。
404 AccountNotExisted Your account does not exist. 您的帳號不存在。
503 ServiceUnavailable The request has failed due to a temporary failure of the server. 服務不可用。

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