查詢指定規則詳情。
介面說明
本文將提供一個樣本,查詢規則cr-7f7d626622af0041****的詳情。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
config:GetConfigRule |
get |
*Rule
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| ConfigRuleId |
string |
是 |
規則 ID。 關於如何擷取規則 ID,請參見 ListConfigRules 。 |
cr-7f7d626622af0041**** |
Tag
deprecated
|
array<object> |
否 |
資源的標籤。該入參已棄用,請忽略,傳入不會生效。 最多支援綁定 20 個標籤。 |
|
|
object |
否 |
資源的標籤。 |
||
| Key |
string |
否 |
資源的標籤鍵。 最多支援綁定 20 個標籤鍵。 |
key-1 |
| Value |
string |
否 |
資源的標籤值。 最多支援綁定 20 個標籤值。 |
value-1 |
關於公用請求參數的詳情,請參見公用參數。
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| ConfigRule |
object |
規則詳情。 |
|
| AccountId |
integer |
規則歸屬阿里雲帳號 ID。 |
120886317861**** |
| Compliance |
object |
規則合規統計結果。 |
|
| ComplianceType |
string |
合規統計結果。取值:
|
NON_COMPLIANT |
| Count |
integer |
合規統計結果對應的評估資源數量。 |
3 |
| ConfigRuleArn |
string |
規則模板 ARN。 |
acs:config::100931896542****:rule/cr-7f7d626622af0041**** |
| ConfigRuleEvaluationStatus |
object |
規則執行狀態。 |
|
| FirstActivatedTimestamp |
integer |
規則首次啟用時間戳記。單位:毫秒。 |
1624932221993 |
| FirstEvaluationStarted |
boolean |
規則是否已執行評估。取值:
|
true |
| LastErrorCode |
string |
規則最近一次執行的錯誤碼。 |
TimeOut |
| LastErrorMessage |
string |
規則最近一次執行的錯誤資訊。 |
Time out |
| LastFailedEvaluationTimestamp |
integer |
規則最近一次調用失敗的結束時間戳記。單位:毫秒。 |
1614687022000 |
| LastFailedInvocationTimestamp |
integer |
規則最近一次調用失敗的開始時間戳。單位:毫秒。 |
1614687022000 |
| LastSuccessfulEvaluationTimestamp |
integer |
規則最近一次調用成功的結束時間戳記。單位:毫秒。 |
1624932227486 |
| LastSuccessfulInvocationTimestamp |
integer |
規則最近一次調用成功的開始時間戳。單位:毫秒。 |
1624932227476 |
| ConfigRuleId |
string |
規則 ID。 |
cr-7f7d626622af0041**** |
| ConfigRuleName |
string |
規則名稱。 |
RAM使用者開啟MFA |
| ConfigRuleState |
string |
規則運行狀態。取值:
|
ACTIVE |
| ConfigRuleTriggerTypes |
string |
規則引發機制。取值:
|
ConfigurationItemChangeNotification |
| CreateBy |
object |
建立資訊。 |
|
| CompliancePackId |
string |
合規包 ID。 |
cp-541e626622af008**** |
| CompliancePackName |
string |
合規包名稱。 |
OSS合規基準 |
| CreatorId |
string |
規則建立者的阿里雲帳號 ID。 |
100931896542**** |
| CreatorName |
string |
規則建立者的名稱。 |
Alice |
| CreateTimestamp |
integer |
建立規則的時間戳記。單位:毫秒。 |
1604684022000 |
| Description |
string |
規則模板描述。 |
RAM使用者開啟MFA,視為“合規”。 |
| ExcludeRegionIdsScope |
string |
規則對指定地區內資源無效,即不對該地區內資源執行評估。多個地區 ID 之間用半形逗號(,)分隔。 |
cn-hangzhou |
| ExcludeResourceGroupIdsScope |
string |
規則對指定資源群組 ID 中的資源無效,即不對該資源群組內的資源評估。多個資源群組 ID 之間用半形逗號(,)分隔。 |
rg-aekzdibsjjc**** |
| ExcludeResourceIdsScope |
string |
規則對指定資源 ID 無效,即不對該資源執行評估。 |
23642660635687**** |
| ExcludeTagsScope |
array<object> |
排除的標籤範圍 |
|
|
object |
排除的標籤範圍 |
||
| TagKey |
string |
標籤鍵。 |
key-2 |
| TagValue |
string |
標籤值。 |
value-2 |
| InputParameters |
object |
規則參數資訊。 |
|
| ManagedRule |
object |
規則模板詳情。 |
|
| CompulsoryInputParameterDetails |
object |
規則模板必選參數詳情。 |
{} |
| Description |
string |
規則模板描述。 |
ECS磁碟未因欠費或安全等原因而被鎖定,視為“合規”。 |
| Identifier |
string |
規則模板標識。 |
ram-user-mfa-check |
| Labels |
array |
規則標籤列表。 |
|
|
string |
規則模板標籤。 |
["RAM","User"] |
|
| ManagedRuleName |
string |
規則模板名稱。 |
RAM使用者開啟MFA |
| OptionalInputParameterDetails |
object |
規則模板選擇性參數詳情。 |
{} |
| SourceDetails |
array<object> |
規則模板來源詳情。 |
|
|
object |
託管規則來源詳情。 |
||
| EventSource |
string |
事件來源。 說明
目前僅支援配置審計事件:aliyun.config。 |
aliyun.config |
| MaximumExecutionFrequency |
string |
規則執行循環。
說明
當規則引發機製為周期執行時,返回該參數。 |
One_Hour |
| MessageType |
string |
規則引發機制。取值:
|
ConfigurationItemChangeNotification |
| MaximumExecutionFrequency |
string |
規則執行循環。
說明
當規則引發機製為周期執行時,返回該參數。 |
One_Hour |
| ModifiedTimestamp |
integer |
規則最近一次更新的時間戳記。單位:毫秒。 |
1614687022000 |
| RegionIdsScope |
string |
規則僅對指定地區 ID 中的資源生效。 |
global |
| ResourceGroupIdsScope |
string |
規則僅對指定資源群組 ID 中的資源生效。 |
rg-aekzdibsjjc**** |
| ResourceIdsScope |
string |
規則對指定資源 ID 生效。多個資源 ID 之間用半形逗號(,)分隔。 |
eip-8vbf3x310fn56ijfd**** |
| ResourceTypesScope |
string |
規則評估的資源類型。 |
ACS::RAM::User |
| RiskLevel |
integer |
規則風險等級。取值:
|
1 |
| Scope |
object |
規則生效範圍。 |
|
| ComplianceResourceTypes |
array |
規則評估的資源類型列表。也可使用 ResourceTypesScope 欄位進行查看。 |
|
|
string |
規則評估的資源類型。 |
ACS::RAM::User |
|
| Source |
object |
規則來源資訊。 |
|
| Identifier |
string |
規則標識。
|
acs:fc:cn-hangzhou:100931896542****:services/ConfigService.LATEST/functions/specific-config |
| Owner |
string |
規則來源的歸屬。取值:
|
ALIYUN |
| SourceDetails |
array<object> |
規則來源詳情。 |
|
|
object |
規則來源詳情。 |
||
| EventSource |
string |
事件來源。 說明
目前僅支援配置審計事件:aliyun.config。 |
aliyun.config |
| MaximumExecutionFrequency |
string |
規則執行循環。
說明
當規則引發機製為周期執行時,返回該參數。 |
One_Hour |
| MessageType |
string |
規則引發機制。取值:
|
ConfigurationItemChangeNotification |
| TagKeyLogicScope |
string |
使用參數 用於擷取使用已廢棄欄位 取值:
|
OR |
TagKeyScope
deprecated
|
string |
已廢棄,請使用 規則僅對綁定指定標籤的資源生效。 說明
參數 |
RAM |
TagValueScope
deprecated
|
string |
已廢棄,請使用 規則僅對綁定指定標籤的資源生效。 說明
參數 |
MFA |
| TagsScope |
array<object> |
標籤範圍 |
|
|
object |
標籤範圍 |
||
| TagKey |
string |
標籤鍵。 |
key-1 |
| TagValue |
string |
標籤值。 |
value-1 |
| Tags |
array<object> |
資源標籤。 |
|
|
object |
資源標籤。 |
||
| TagKey |
string |
標籤鍵。 |
key-1 |
| TagValue |
string |
標籤值。 |
value-1 |
| ResourceNameScope |
string |
規則僅對指定資源名稱的資源生效。 |
i-xxx |
| ExtendContent |
string |
擴充內容,暫時僅用於配合 24 小時周期觸發設定觸發時間。 |
{"fixedHour":"12"} |
| RequestId |
string |
請求 ID。 |
811234F4-C3AB-4D15-B90B-F55016D1B5AA |
樣本
正常返回樣本
JSON格式
{
"ConfigRule": {
"AccountId": 0,
"Compliance": {
"ComplianceType": "NON_COMPLIANT",
"Count": 3
},
"ConfigRuleArn": "acs:config::100931896542****:rule/cr-7f7d626622af0041****",
"ConfigRuleEvaluationStatus": {
"FirstActivatedTimestamp": 1624932221993,
"FirstEvaluationStarted": true,
"LastErrorCode": "TimeOut",
"LastErrorMessage": "Time out",
"LastFailedEvaluationTimestamp": 1614687022000,
"LastFailedInvocationTimestamp": 1614687022000,
"LastSuccessfulEvaluationTimestamp": 1624932227486,
"LastSuccessfulInvocationTimestamp": 1624932227476
},
"ConfigRuleId": "cr-7f7d626622af0041****",
"ConfigRuleName": "RAM使用者開啟MFA",
"ConfigRuleState": "ACTIVE",
"ConfigRuleTriggerTypes": "ConfigurationItemChangeNotification",
"CreateBy": {
"CompliancePackId": "cp-541e626622af008****",
"CompliancePackName": "OSS合規基準",
"CreatorId": "100931896542****",
"CreatorName": "Alice"
},
"CreateTimestamp": 1604684022000,
"Description": "RAM使用者開啟MFA,視為“合規”。",
"ExcludeRegionIdsScope": "cn-hangzhou",
"ExcludeResourceGroupIdsScope": "rg-aekzdibsjjc****",
"ExcludeResourceIdsScope": "23642660635687****",
"ExcludeTagsScope": [
{
"TagKey": "key-2",
"TagValue": "value-2"
}
],
"InputParameters": {
"test": "test",
"test2": 1
},
"ManagedRule": {
"CompulsoryInputParameterDetails": {},
"Description": "ECS磁碟未因欠費或安全等原因而被鎖定,視為“合規”。",
"Identifier": "ram-user-mfa-check",
"Labels": [
"[\"RAM\",\"User\"]"
],
"ManagedRuleName": "RAM使用者開啟MFA",
"OptionalInputParameterDetails": {},
"SourceDetails": [
{
"EventSource": "aliyun.config",
"MaximumExecutionFrequency": "One_Hour",
"MessageType": "ConfigurationItemChangeNotification"
}
]
},
"MaximumExecutionFrequency": "One_Hour",
"ModifiedTimestamp": 1614687022000,
"RegionIdsScope": "global",
"ResourceGroupIdsScope": "rg-aekzdibsjjc****",
"ResourceIdsScope": "eip-8vbf3x310fn56ijfd****\n",
"ResourceTypesScope": "ACS::RAM::User",
"RiskLevel": 1,
"Scope": {
"ComplianceResourceTypes": [
"ACS::RAM::User"
]
},
"Source": {
"Identifier": "acs:fc:cn-hangzhou:100931896542****:services/ConfigService.LATEST/functions/specific-config",
"Owner": "ALIYUN",
"SourceDetails": [
{
"EventSource": "aliyun.config",
"MaximumExecutionFrequency": "One_Hour",
"MessageType": "ConfigurationItemChangeNotification"
}
]
},
"TagKeyLogicScope": "OR",
"TagKeyScope": "RAM",
"TagValueScope": "MFA",
"TagsScope": [
{
"TagKey": "key-1",
"TagValue": "value-1"
}
],
"Tags": [
{
"TagKey": "key-1",
"TagValue": "value-1"
}
],
"ResourceNameScope": "i-xxx",
"ExtendContent": "{\"fixedHour\":\"12\"}"
},
"RequestId": "811234F4-C3AB-4D15-B90B-F55016D1B5AA"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | ConfigRuleNotExists | The ConfigRule does not exist. | 此規則不存在。 |
| 400 | NoPermission | You are not authorized to perform this operation. | 您無權執行此操作。 |
| 404 | AccountNotExisted | Your account does not exist. | |
| 503 | ServiceUnavailable | The request has failed due to a temporary failure of the server. | 服務不可用。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。