GetResourceComplianceTimeline
Queries the compliance timeline of a specified resource. The compliance timeline is a set of compliance evaluation records for a resource, including the points in time and the details of the compliance timeline.
Operation description
In Cloud Config, each resource has its own compliance timeline. When a rule is triggered to evaluate a resource, a compliance evaluation record is generated. Continuous compliance evaluations form the compliance timeline of the resource. Rules can be triggered by configuration changes, periodic execution, or manual execution. This topic provides an example to query the compliance timeline of the new-bucket (OSS bucket) resource in the cn-hangzhou region. The response shows that the compliance timeline of the resource includes 1625200295276 (UTC+8: 2021-07-02 12:31:35) and 1625200228510 (UTC+8: 2021-07-02 12:30:28).
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
config:GetResourceComplianceTimeline |
list |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ResourceType |
string |
Yes |
The resource type. For more information about how to obtain the resource type, see ListDiscoveredResources. |
ACS::OSS::Bucket |
| ResourceId |
string |
Yes |
The resource ID. For more information about how to obtain the resource ID, see ListDiscoveredResources. |
new-bucket |
| StartTime |
integer |
No |
The start timestamp. Default value: the time 30 days before the call is initiated. Unit: milliseconds. |
1623211156000 |
| EndTime |
integer |
No |
The end timestamp. Default value: the time when the call is initiated. Unit: milliseconds. |
1625821156000 |
| MaxResults |
integer |
No |
The maximum number of entries to return for a single request. Valid values: 1 to 100. |
10 |
| Region |
string |
Yes |
The region ID. |
cn-hangzhou |
| NextToken |
string |
No |
The pagination token that is used to retrieve the next page of results when the response is truncated. |
IWBjqMYSy0is7zSMGu16**** |
For more information about common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
8D53A78F-1EB8-4264-A554-72F07E34FAE6 |
| ResourceComplianceTimeline |
object |
The compliance timeline of the resource. |
|
| NextToken |
string |
The token used to query the next page. |
5OVS5J4I1/UKTkHV5oNs**** |
| MaxResults |
integer |
The maximum number of entries returned for a single request. |
10 |
| ComplianceList |
array<object> |
The list of compliance timeline records for the resource. |
|
|
object |
|||
| Tags |
string |
The tags of the resource. |
{\"\"hc\"\":[\"\"value2\"\"]} |
| AccountId |
string |
The ID of the Alibaba Cloud account to which the resource belongs. |
100931896542**** |
| AvailabilityZone |
string |
The zone of the resource. |
cn-hangzhou-f |
| ResourceType |
string |
The resource type. |
ACS::OSS::Bucket |
| ResourceCreateTime |
integer |
The timestamp when the resource was created. Unit: milliseconds. |
1624961112000 |
| Region |
string |
The region ID. |
cn-hangzhou |
| Configuration |
string |
The list of rules associated with the resource and the compliance details of the rules. |
{\"Compliance\":{\"complianceType\":\"COMPLIANT\",\"count\":1},\"ConfigRuleList\":[{\"accountId\":100931896542****,\"configRuleId\":\"cr-9524626622af003d****\",\"configRuleArn\":\"acs:config::100931896542****:rule/cr-9524626622af003d****\",\"configRuleName\":\"OSS bucket ACL prohibits public read and write access\",\"complianceType\":\"COMPLIANT\",\"riskLevel\":1,\"annotation\":\"\",\"invokingEventMessageType\":\"ScheduledNotification\"}]} |
| CaptureTime |
integer |
The timestamp when the compliance evaluation of the resource was recorded. Unit: milliseconds. |
1625200295276 |
| ConfigurationDiff |
string |
The details of the resource change that triggered this evaluation. |
{\"OSS bucket ACL prohibits public read and write access\":[{\"accountId\":100931896542****,\"configRuleId\":\"cr-965f626622af003d****\",\"configRuleArn\":\"acs:config::100931896542****:rule/cr-965f626622af003d****\",\"configRuleName\":\"OSS bucket ACL prohibits public read and write access\",\"complianceType\":\"COMPLIANT\",\"riskLevel\":1,\"annotation\":\"\",\"invokingEventMessageType\":\"ScheduledNotification\"},{}]} |
| ResourceId |
string |
The resource ID. |
new-bucket |
| ResourceName |
string |
The resource name. |
new-bucket |
| ResourceStatus |
string |
The resource status. The resource status depends on the definition of each cloud service and this parameter may be empty. Examples: - If the resource type is ACS::ECS::Instance, this parameter is Running or Stopped because ECS instances have statuses. - If the resource type is ACS::OSS::Bucket, this parameter is empty because OSS buckets do not have statuses. |
null |
Examples
Success response
JSON format
{
"RequestId": "8D53A78F-1EB8-4264-A554-72F07E34FAE6",
"ResourceComplianceTimeline": {
"NextToken": "5OVS5J4I1/UKTkHV5oNs****",
"MaxResults": 10,
"ComplianceList": [
{
"Tags": "{\\\"\\\"hc\\\"\\\":[\\\"\\\"value2\\\"\\\"]}",
"AccountId": "100931896542****",
"AvailabilityZone": "cn-hangzhou-f",
"ResourceType": "ACS::OSS::Bucket",
"ResourceCreateTime": 1624961112000,
"Region": "cn-hangzhou",
"Configuration": "{\\\"Compliance\\\":{\\\"complianceType\\\":\\\"COMPLIANT\\\",\\\"count\\\":1},\\\"ConfigRuleList\\\":[{\\\"accountId\\\":100931896542****,\\\"configRuleId\\\":\\\"cr-9524626622af003d****\\\",\\\"configRuleArn\\\":\\\"acs:config::100931896542****:rule/cr-9524626622af003d****\\\",\\\"configRuleName\\\":\\\"OSS存储空间ACL禁止公共读写\\\",\\\"complianceType\\\":\\\"COMPLIANT\\\",\\\"riskLevel\\\":1,\\\"annotation\\\":\\\"\\\",\\\"invokingEventMessageType\\\":\\\"ScheduledNotification\\\"}]}",
"CaptureTime": 1625200295276,
"ConfigurationDiff": "{\\\"OSS存储空间ACL禁止公共读写\\\":[{\\\"accountId\\\":100931896542****,\\\"configRuleId\\\":\\\"cr-965f626622af003d****\\\",\\\"configRuleArn\\\":\\\"acs:config::100931896542****:rule/cr-965f626622af003d****\\\",\\\"configRuleName\\\":\\\"OSS存储空间ACL禁止公共读写\\\",\\\"complianceType\\\":\\\"COMPLIANT\\\",\\\"riskLevel\\\":1,\\\"annotation\\\":\\\"\\\",\\\"invokingEventMessageType\\\":\\\"ScheduledNotification\\\"},{}]}",
"ResourceId": "new-bucket",
"ResourceName": "new-bucket",
"ResourceStatus": "null"
}
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 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. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.