Queries the statistics of compliance evaluations based on compliance types.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DescribeCompliance | The operation that you want to perform. Set the value to DescribeCompliance. |
ResourceType | String | No | ACS::ECS::Instance | The resource type. If you query compliance evaluation results by resource, you must specify the ResourceType and ResourceId parameters. |
ResourceId | String | No | i-bp151g9tpto890zr**** | The resource ID. If you query compliance evaluation results by resource, you must specify the ResourceType and ResourceId parameters. |
ComplianceType | String | No | COMPLIANT | The compliance evaluation result of the resource. Valid values:
|
ConfigRuleId | String | No | cr-12b398b633820012**** | The rule ID. If you query compliance evaluation results by resource, you must specify the ConfigRuleId, ResourceType, and ResourceId parameters. Otherwise, the ConfigRuleId parameter becomes invalid. |
MultiAccount | Boolean | No | false | This parameter is unavailable since 00:00:00 on June 30, 2021. Account group-related operations are provided as an alternative after 00:00:00 on May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related operations after 00:00:00 on May 30, 2021. For information about account groups, see Overview. |
MemberId | Long | No | 100931896542**** | This parameter is unavailable since 00:00:00 on June 30, 2021. Account group-related operations are provided as an alternative after 00:00:00 on May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related operations after 00:00:00 on May 30, 2021. For information about account groups, see Overview. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
ComplianceResult | Object | The statistics of compliance evaluations. | |
TotalCount | Long | 12 | The total number of compliance evaluations.
|
Compliances | Array of Compliances | The compliance evaluation results based on compliance types. | |
ComplianceType | String | COMPLIANT | The compliance evaluation result of the resource. Valid values:
|
Count | Integer | 12 | The number of compliance evaluations with the corresponding result.
|
RequestId | String | 17306AB1-34E0-468F-BD7B-68D8AEAB754F | The request ID. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=DescribeCompliance
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeComplianceResponse>
<ComplianceResult>
<TotalCount>1</TotalCount>
<Compliances>
<ComplianceType>COMPLIANT</ComplianceType>
<Count>1</Count>
</Compliances>
</ComplianceResult>
<RequestId>17306AB1-34E0-468F-BD7B-68D8AEAB754F</RequestId>
</DescribeComplianceResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"ComplianceResult" : {
"TotalCount" : 1,
"Compliances" : [ {
"ComplianceType" : "COMPLIANT",
"Count" : 1
} ]
},
"RequestId" : "17306AB1-34E0-468F-BD7B-68D8AEAB754F"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
404 | AccountNotExisted | Your account does not exist. | Your account does not exist. |
503 | ServiceUnavailable | The request has failed due to a temporary failure of the server. | The service is unavailable. |
For a list of error codes, see Service error codes.