擷取當前帳號下跨地區彙總的資源清單資訊。
介面說明
使用限制
因為配置審計僅支援部分阿里雲服務和資源類型,所以資源清單中只展示部分資源。關於配置審計支援的雲端服務及資源類型,請參見配置審計支援的資源類型和資源關係。
使用說明
本文將提供一個樣本,查詢當前帳號下的資源清單。返回結果顯示,資源清單中的所有資源共 8 個。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
config:ListDiscoveredResources |
list |
*全部資源
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| ResourceId |
string |
否 |
資源 ID。 |
eni-hp31cqoba96jagtz**** |
| ResourceName |
string |
否 |
資源名稱 |
test-resource-name |
| ResourceDeleted |
integer |
否 |
資源狀態。取值:
|
1 |
| MaxResults |
integer |
是 |
單次請求返回結果的最大條數。取值範圍:1~100。 |
10 |
| ResourceTypes |
string |
否 |
資源類型。多個資源類型之間用半形逗號(,)分隔。 |
ACS::ECS::NetworkInterface |
| Regions |
string |
否 |
資源歸屬的地區 ID。多個地區 ID 之間用半形逗號(,)分隔。 |
cn-hangzhou |
| NextToken |
string |
否 |
當請求的返回結果被截斷時,您可以使用 |
IWBjqMYSy0is7zSMGu16**** |
| StartUpdateTimestamp |
integer |
否 |
資源時間範圍查詢的開始時間,採用標準 UTC 時間戳記。取值限制:
|
1722441600000 |
| EndUpdateTimestamp |
integer |
否 |
資源時間範圍查詢的截止時間,採用標準 UTC 時間戳記。取值限制:
|
1724947200000 |
| ExcludeResourceTypes |
string |
否 |
排除的資源類型,多資源類型用逗號分隔,與 ResourceTypes 欄位衝突時,該欄位具有更高優先順序。 |
ACS::ECS::Instance,ACS::ECS::NetworkInterface |
關於公用請求參數的詳情,請參見公用參數。
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
無。 |
||
| DiscoveredResourceProfiles |
object |
資源清單。 |
|
| DiscoveredResourceProfileList |
array<object> |
資源清單詳情。 |
|
|
object |
無。 |
||
| AccountId |
integer |
資源擁有者的阿里雲帳號 ID。 |
161259599160**** |
| AvailabilityZone |
string |
可用性區域。 |
cn-hangzhou-h |
| Region |
string |
地區 ID。 |
cn-hangzhou |
| ResourceCreationTime |
integer |
資源建立時間戳記。單位:毫秒。 |
1618675206000 |
| ResourceDeleted |
integer |
資源狀態。取值:
|
1 |
| ResourceId |
string |
資源 ID。 |
eni-hp31cqoba96jagtz**** |
| ResourceName |
string |
資源名稱。 |
Cloud Firewall |
| ResourceStatus |
string |
資源狀態。資源的狀態取決於各雲端服務對其的定義,該參數可能為空白。例如:
|
InUse |
| ResourceType |
string |
資源類型。 |
ACS::ECS::NetworkInterface |
| Tags |
string |
資源標籤。 |
{\"key1\":[\"value2\"]} |
| UpdateTime |
integer |
資源的最近一次更新時間,毫秒級時間戳記。 |
1722441600000 |
| Version |
integer |
資源變更的版本。 |
1 |
| VpcId |
string |
所屬的 vpc ID,格式:vpc-t4nhheyvay74fp7n0hxxx,無所屬 VPC 時返回Null 字元串: "" |
vpc-t4nhheyvay74fp7n0hxxx |
| VSwitchId |
string |
所屬的 vSwitch ID,格式:vsw-t4n7pokxxxxxxxxxxxxxx,多值時逗號分隔,如 vsw-t4n7pokxxxxxxxxxxxxxx,vsw-t4n7pokxxxxxxxxxxxxxx,無所屬 VSWITCH 時返回為空白字串:"" |
vsw-t4n7pokxxxxxxxxxxxxxx |
| ResourceGroupId |
string |
資源所屬的資源群組 ID,例如:rg-acfmvoh45rhxxxx |
rg-acfmvoh45rhxxxx |
| MaxResults |
integer |
每頁的最大記錄數。 |
10 |
| NextToken |
string |
查詢下一頁使用的 Token。 |
IWBjqMYSy0is7zSMGu16**** |
| TotalCount |
integer |
資源總數。 |
8 |
| RequestId |
string |
請求 ID。 |
C7817373-78CB-4F9A-8AFA-E7A88E9D64A2 |
樣本
正常返回樣本
JSON格式
{
"DiscoveredResourceProfiles": {
"DiscoveredResourceProfileList": [
{
"AccountId": 0,
"AvailabilityZone": "cn-hangzhou-h",
"Region": "cn-hangzhou",
"ResourceCreationTime": 1618675206000,
"ResourceDeleted": 1,
"ResourceId": "eni-hp31cqoba96jagtz****",
"ResourceName": "Cloud Firewall",
"ResourceStatus": "InUse",
"ResourceType": "ACS::ECS::NetworkInterface",
"Tags": "{\\\"key1\\\":[\\\"value2\\\"]}",
"UpdateTime": 1722441600000,
"Version": 1,
"VpcId": "vpc-t4nhheyvay74fp7n0hxxx",
"VSwitchId": "vsw-t4n7pokxxxxxxxxxxxxxx",
"ResourceGroupId": "rg-acfmvoh45rhxxxx"
}
],
"MaxResults": 10,
"NextToken": "IWBjqMYSy0is7zSMGu16****",
"TotalCount": 8
},
"RequestId": "C7817373-78CB-4F9A-8AFA-E7A88E9D64A2"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 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. | 服務不可用。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。