查詢規則列表中的所有規則。
介面說明
本文將提供一個樣本,查詢當前帳號內的規則列表。返回結果顯示,規則列表中規則總數為 1 條,評估資源數為 3 條,評估結果為 COMPLIANT(合規)。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
config:ListConfigRules |
list |
*Rule
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| ResourceTypes |
string |
否 |
規則評估的資源類型。 |
ACS::ECS::Instance |
| PageSize |
integer |
否 |
分頁時每頁顯示的資料行數。 取值範圍:1~100。起始值:1。預設值:10。 |
10 |
| CompliancePackId |
string |
否 |
合規包 ID。 |
cp-fe416457e0d90022**** |
| ComplianceType |
string |
否 |
規則合規評估結果。取值:
|
COMPLIANT |
| PageNumber |
integer |
否 |
頁碼。 起始值:1。預設值:1。 |
1 |
| Keyword |
string |
否 |
查詢關鍵字。 支援對規則 ID、規則名稱、規則描述和規則模板標識等進行模糊查詢。 |
ecs |
| ConfigRuleState |
string |
否 |
規則運行狀態。取值:
|
ACTIVE |
| ConfigRuleName |
string |
否 |
規則名稱。 |
The name of the rule. |
| RiskLevel |
integer |
否 |
規則風險等級。取值:
|
1 |
| SortBy |
string |
否 |
預設不傳值。當前支援: |
CreateDate-Desc |
| Tag |
array<object> |
否 |
資源的標籤。 最多支援綁定 20 個標籤。 |
|
|
object |
否 |
資源的標籤。 最多支援綁定 20 個標籤。 |
||
| Key |
string |
否 |
標籤鍵 |
key-1 |
| Value |
string |
否 |
標籤值。 |
value-1 |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| RequestId |
string |
請求 ID。 |
AC3A7E12-72E6-5CC9-A5C1-D8D8919829A7 |
| ConfigRules |
object |
規則列表。 |
|
| ConfigRuleList |
array<object> |
規則列表詳細資料。 |
|
|
array<object> |
規則列表詳細資料。 |
||
| RiskLevel |
integer |
規則風險等級。取值:
|
1 |
| SourceOwner |
string |
規則來源的歸屬。取值:
|
ALIYUN |
| AccountId |
integer |
規則歸屬的帳號 ID。 |
100931896542**** |
| ConfigRuleState |
string |
規則運行狀態。取值:
|
ACTIVE |
| Compliance |
object |
規則的合規彙總結果。 |
|
| ComplianceType |
string |
規則合規評估的摘要結果。取值:
|
COMPLIANT |
| Count |
integer |
規則評估的摘要結果對應的評估數量。 |
2 |
| SourceIdentifier |
string |
規則標識符。
|
eip-bandwidth-limit |
| ConfigRuleArn |
string |
規則 ARN。 |
acs:config::100931896542****:rule/cr-fdc8626622af00f9**** |
| Description |
string |
規則描述。 |
The description of the rule. |
| CreateBy |
object |
建立規則的資訊。 |
|
| CompliancePackId |
string |
合規包 ID。 |
cp-fdc8626622af00f9**** |
| CompliancePackName |
string |
合規包名稱。 |
The name of the compliance package. |
| AutomationType |
string |
修正類型。僅支援 OOS(營運編排)。 |
OOS |
| ConfigRuleName |
string |
規則名稱。 |
The name of the rule. |
| ConfigRuleId |
string |
規則 ID。 |
cr-fdc8626622af00f9**** |
| Tags |
array<object> |
規則的標籤。 |
|
|
object |
規則的標籤。 |
||
| Key |
string |
規則的標籤鍵。 |
env |
| Value |
string |
規則的標籤值。 |
prod |
| ResourceTypesScope |
string |
規則評估的資源類型,多個資源類型用半形逗號(,)分隔。 |
ACS::EIP::EipAddress |
| CreateDate |
string |
規則建立時間(UTC+8) |
2025-09-19T15:51:00 |
| PageSize |
integer |
分頁時每頁顯示的資料行數。 |
10 |
| PageNumber |
integer |
頁碼。 |
1 |
| TotalCount |
integer |
規則總數。 |
1 |
樣本
正常返回樣本
JSON格式
{
"RequestId": "AC3A7E12-72E6-5CC9-A5C1-D8D8919829A7",
"ConfigRules": {
"ConfigRuleList": [
{
"RiskLevel": 1,
"SourceOwner": "ALIYUN",
"AccountId": 0,
"ConfigRuleState": "ACTIVE",
"Compliance": {
"ComplianceType": "COMPLIANT",
"Count": 2
},
"SourceIdentifier": "eip-bandwidth-limit",
"ConfigRuleArn": "acs:config::100931896542****:rule/cr-fdc8626622af00f9****",
"Description": "The description of the rule.",
"CreateBy": {
"CompliancePackId": "cp-fdc8626622af00f9****",
"CompliancePackName": "The name of the compliance package."
},
"AutomationType": "OOS",
"ConfigRuleName": "The name of the rule.",
"ConfigRuleId": "cr-fdc8626622af00f9****",
"Tags": [
{
"Key": "env",
"Value": "prod"
}
],
"ResourceTypesScope": "ACS::EIP::EipAddress",
"CreateDate": "2025-09-19T15:51:00"
}
],
"PageSize": 10,
"PageNumber": 1,
"TotalCount": 1
}
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | NoPermission | You are not authorized to perform this operation. | 您無權執行此操作。 |
| 400 | Invalid.AggregatorId.Value | The specified AggregatorId is invalid. | 帳號組ID不存在或無許可權使用該帳號組。 |
| 404 | AccountNotExisted | Your account does not exist. | |
| 503 | ServiceUnavailable | The request has failed due to a temporary failure of the server. | 服務不可用。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。