Consulta os detalhes de uma regra especificada.
Descrição da operação
Este tópico fornece um exemplo de como consultar os detalhes da regra cr-7f7d626622af0041****.
Experimente agora
Testar
Autorização RAM
|
Ação |
Nível de acesso |
Tipo de recurso |
Chave de condição |
Ação dependente |
|
config:GetConfigRule |
get |
*Rule
|
Nenhuma | Nenhuma |
Parâmetros da solicitação
|
Parâmetro |
Tipo |
Obrigatório |
Descrição |
Exemplo |
| ConfigRuleId |
string |
Sim |
O ID da regra. Para mais informações, consulte ListConfigRules. |
cr-7f7d626622af0041**** |
Tag
deprecated
|
array<object> |
Não |
As tags do recurso. Este parâmetro está obsoleto e não tem efeito. Você pode adicionar no máximo 20 tags a um recurso. |
|
|
object |
Não |
As tags do recurso. |
||
| Key |
string |
Não |
A chave de tag do recurso. Você pode adicionar no máximo 20 chaves de tag a um recurso. |
key-1 |
| Value |
string |
Não |
O valor de tag do recurso. Você pode adicionar no máximo 20 valores de tag a um recurso. |
value-1 |
Para mais informações sobre parâmetros de solicitação comuns, consulte Parâmetros comuns.
Elementos de resposta
|
Elemento |
Tipo |
Descrição |
Exemplo |
|
object |
|||
| ConfigRule |
object |
Os detalhes da regra. |
|
| AccountId |
integer |
O ID da conta Alibaba Cloud à qual a regra pertence. |
120886317861**** |
| Compliance |
object |
As estatísticas de conformidade da regra. |
|
| ComplianceType |
string |
The compliance evaluation result. Valid values:
|
NON_COMPLIANT |
| Count |
integer |
The number of resources that are evaluated based on the compliance result. |
3 |
| ConfigRuleArn |
string |
O Alibaba Cloud Resource Name (ARN) da regra. |
acs:config::100931896542****:rule/cr-7f7d626622af0041**** |
| ConfigRuleEvaluationStatus |
object |
O status de execução da regra. |
|
| FirstActivatedTimestamp |
integer |
The timestamp when the rule was first activated. Unit: milliseconds. |
1624932221993 |
| FirstEvaluationStarted |
boolean |
Indicates whether the rule has been evaluated. Valid values:
|
true |
| LastErrorCode |
string |
The error code returned for the last failed execution of the rule. |
TimeOut |
| LastErrorMessage |
string |
The error message returned for the last failed execution of the rule. |
Time out |
| LastFailedEvaluationTimestamp |
integer |
The timestamp when the last failed evaluation of the rule ended. Unit: milliseconds. |
1614687022000 |
| LastFailedInvocationTimestamp |
integer |
The timestamp when the last failed invocation of the rule started. Unit: milliseconds. |
1614687022000 |
| LastSuccessfulEvaluationTimestamp |
integer |
The timestamp when the last successful evaluation of the rule ended. Unit: milliseconds. |
1624932227486 |
| LastSuccessfulInvocationTimestamp |
integer |
The timestamp when the last successful invocation of the rule started. Unit: milliseconds. |
1624932227476 |
| ConfigRuleId |
string |
O ID da regra. |
cr-7f7d626622af0041**** |
| ConfigRuleName |
string |
O nome da regra. |
RAM用户开启MFA |
| ConfigRuleState |
string |
O status da regra. Valores válidos:
|
ACTIVE |
| ConfigRuleTriggerTypes |
string |
O tipo de acionamento da regra. Valores válidos:
|
ConfigurationItemChangeNotification |
| CreateBy |
object |
As informações sobre o criador da regra. |
|
| CompliancePackId |
string |
The ID of the compliance package. |
cp-541e626622af008**** |
| CompliancePackName |
string |
The name of the compliance package. |
OSS合规基线 |
| CreatorId |
string |
The ID of the Alibaba Cloud account that was used to create the rule. |
100931896542**** |
| CreatorName |
string |
The name of the creator. |
Alice |
| CreateTimestamp |
integer |
O timestamp de quando a regra foi criada. Unidade: milissegundos. |
1604684022000 |
| Description |
string |
A descrição da regra. |
RAM用户开启MFA,视为“合规”。 |
| ExcludeRegionIdsScope |
string |
Os IDs das regiões onde a regra não se aplica. A regra não avalia recursos nessas regiões. Separe múltiplos IDs de região com vírgula (,). |
cn-hangzhou |
| ExcludeResourceGroupIdsScope |
string |
Os IDs dos grupos de recursos onde a regra não se aplica. A regra não avalia recursos nesses grupos de recursos. Separe múltiplos IDs de grupo de recursos com vírgula (,). |
rg-aekzdibsjjc**** |
| ExcludeResourceIdsScope |
string |
Os IDs dos recursos que não são avaliados pela regra. Separe múltiplos IDs de recurso com vírgula (,). |
23642660635687**** |
| ExcludeTagsScope |
array<object> |
As tags dos recursos que não são avaliados pela regra. |
|
|
object |
As tags dos recursos que não são avaliados pela regra. |
||
| TagKey |
string |
The tag key. |
key-2 |
| TagValue |
string |
The tag value. |
value-2 |
| InputParameters |
object |
Os parâmetros de entrada da regra. |
|
| ManagedRule |
object |
Os detalhes da regra gerenciada. |
|
| CompulsoryInputParameterDetails |
object |
The details of the required input parameters of the managed rule. |
{} |
| Description |
string |
The description of the managed rule. |
ECS磁盘未因欠费或安全等原因而被锁定,视为“合规”。 |
| Identifier |
string |
The identifier of the managed rule. |
ram-user-mfa-check |
| Labels |
array |
The list of rule labels. |
|
|
string |
The label of the managed rule. |
["RAM","User"] |
|
| ManagedRuleName |
string |
The name of the managed rule. |
RAM用户开启MFA |
| OptionalInputParameterDetails |
object |
The details of the optional input parameters of the managed rule. |
{} |
| SourceDetails |
array<object> |
The source details of the managed rule. |
|
|
object |
The source details of the managed rule. |
||
| EventSource |
string |
The event source. Nota
Only Cloud Config events are supported. The value is aliyun.config. |
aliyun.config |
| MaximumExecutionFrequency |
string |
The execution frequency of the rule. Valid values:
Nota
This parameter is returned only when the rule is triggered periodically. |
One_Hour |
| MessageType |
string |
The trigger type of the rule. Valid values:
|
ConfigurationItemChangeNotification |
| MaximumExecutionFrequency |
string |
A frequência de execução da regra. Valores válidos:
Nota
Este parâmetro é retornado somente quando a regra é acionada periodicamente. |
One_Hour |
| ModifiedTimestamp |
integer |
O timestamp de quando a regra foi atualizada pela última vez. Unidade: milissegundos. |
1614687022000 |
| RegionIdsScope |
string |
Os IDs das regiões onde a regra se aplica. A regra avalia apenas recursos nessas regiões. |
global |
| ResourceGroupIdsScope |
string |
Os IDs dos grupos de recursos onde a regra se aplica. A regra avalia apenas recursos nesses grupos de recursos. |
rg-aekzdibsjjc**** |
| ResourceIdsScope |
string |
Os IDs dos recursos que são avaliados pela regra. Separe múltiplos IDs de recurso com vírgula (,). |
eip-8vbf3x310fn56ijfd**** |
| ResourceTypesScope |
string |
Os tipos dos recursos que são avaliados pela regra. |
ACS::RAM::User |
| RiskLevel |
integer |
O nível de risco da regra. Valores válidos:
|
1 |
| Scope |
object |
O escopo efetivo da regra. |
|
| ComplianceResourceTypes |
array |
The list of resource types that are evaluated by the rule. You can also view this information in the ResourceTypesScope field. |
|
|
string |
The type of the resource that is evaluated by the rule. |
ACS::RAM::User |
|
| Source |
object |
A origem da regra. |
|
| Identifier |
string |
The identifier of the rule.
|
acs:fc:cn-hangzhou:100931896542****:services/ConfigService.LATEST/functions/specific-config |
| Owner |
string |
The owner of the rule. Valid values:
|
ALIYUN |
| SourceDetails |
array<object> |
The source details. |
|
|
object |
The source details. |
||
| EventSource |
string |
The event source. Nota
Only Cloud Config events are supported. The value is aliyun.config. |
aliyun.config |
| MaximumExecutionFrequency |
string |
The execution frequency of the rule. Valid values:
Nota
This parameter is returned only when the rule is triggered periodically. |
One_Hour |
| MessageType |
string |
The trigger type of the rule. Valid values:
|
ConfigurationItemChangeNotification |
| TagKeyLogicScope |
string |
Este parâmetro não é retornado para regras criadas usando o parâmetro Este parâmetro é retornado para regras criadas usando o parâmetro obsoleto TagKeyScope. Não recomendamos que você use o parâmetro Valores válidos:
|
OR |
TagKeyScope
deprecated
|
string |
Este parâmetro está obsoleto. Use o parâmetro A regra se aplica apenas a recursos com a tag especificada. Nota
Os parâmetros |
RAM |
TagValueScope
deprecated
|
string |
Este parâmetro está obsoleto. Use o parâmetro A regra se aplica apenas a recursos com a tag especificada. Nota
Os parâmetros |
MFA |
| TagsScope |
array<object> |
O escopo baseado em tags. |
|
|
object |
As tags que definem o escopo. |
||
| TagKey |
string |
The tag key. |
key-1 |
| TagValue |
string |
The tag value. |
value-1 |
| Tags |
array<object> |
As tags do recurso. |
|
|
object |
As tags do recurso. |
||
| TagKey |
string |
The tag key. |
key-1 |
| TagValue |
string |
The tag value. |
value-1 |
| ResourceNameScope |
string |
A regra avalia apenas recursos que possuem os nomes especificados. |
i-xxx |
| ExtendContent |
string |
O conteúdo estendido. Este parâmetro é usado apenas para especificar o horário de acionamento para uma regra que é acionada em um ciclo de 24 horas. |
{"fixedHour":"12"} |
| RequestId |
string |
O ID da solicitação. |
811234F4-C3AB-4D15-B90B-F55016D1B5AA |
Exemplos
Resposta de sucesso
JSON formato
{
"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"
}
Códigos de erro
|
Código de status HTTP |
Código de erro |
Mensagem de erro |
Descrição |
|---|---|---|---|
| 400 | ConfigRuleNotExists | The ConfigRule does not exist. | The rule does not exist. |
| 400 | NoPermission | You are not authorized to perform this operation. | 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. | The request has failed due to a temporary failure of the server. |
Consulte Códigos de Erro para uma lista completa.
Notas de versão
Consulte Notas de Versão para uma lista completa.