GetResourceComplianceTimeline

更新时间:
复制 MD 格式

Queries the compliance evaluation timeline for a specified resource.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

config:GetResourceComplianceTimeline

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

ResourceType

string

Yes

The resource type.

ACS::ECS::Instance

ResourceId

string

Yes

The resource ID.

i-uf6072y75i2cevjq****

StartTime

integer

No

The start timestamp. The default value is 30 days before the time of the API call.

1593599340010

EndTime

integer

No

The end timestamp. The default value is the time of the API call.

1593599342230

Limit

integer

No

The number of entries to return on each page for a paged query. Valid values: 1 to 100. Default value: 10.

10

MultiAccount

boolean

No

This parameter is scheduled to be deprecated before 00:00:00 on June 30, 2021. The API for the account group feature that replaces this parameter will be available before 00:00:00 on May 30, 2021. If you use this parameter, switch to the account group API after 00:00:00 on May 30, 2021. For more information about account groups, see Account groups.

true

MemberId

string

No

This parameter is scheduled to be deprecated before 00:00:00 on June 30, 2021. The API for the account group feature that replaces this parameter will be available before 00:00:00 on May 30, 2021. If you use this parameter, switch to the account group API after 00:00:00 on May 30, 2021. For more information about account groups, see Account groups.

123456789

Region

string

Yes

The region ID.

cn-hangzhou

NextToken

string

No

The token that is used to start the next query.

caeba0bbb2be03f84eb48b699f0a****

Response elements

Element

Type

Description

Example

object

None.

RequestId

string

The request ID.

DE9FFFE5-FCAD-4B24-9546-BF49273C562B

ResourceComplianceTimeline

object

The compliance evaluation history of the resource.

ComplianceList

array<object>

A list of compliance evaluation history records for the resource.

object

None.

AccountId

string

The ID of the Alibaba Cloud account.

120390217529****

AvailabilityZone

string

The zone where the resource resides.

cn-hangzhou-f

CaptureTime

integer

The timestamp of the compliance evaluation.

1203902175292305

Configuration

string

The list of rules that are associated with the resource and the compliance details of the rules.

{\"managetest-required-tags\":[{},{\"configRuleId\":\"cr-656d5180a8d1009c****\",\"configRuleArn\":\"acs:config::120390217529****:config-rule/cr-656d5180a8d1009c****\",\"configRuleName\":\"managetest-required-tags\",\"complianceType\":\"NON_COMPLIANT\",\"riskLevel\":1,\"annotation\":\"{\\\"desiredValue\\\":\\\"key1\\\",\\\"reason\\\":\\\"No tag with name key1\\\"}\",\"invokingEventMessageType\":\"ConfigurationItemChangeNotification\"}]}

ConfigurationDiff

string

The details of the rules whose compliance status has changed.

{\"Compliance\":{\"complianceType\":\"NON_COMPLIANT\",\"count\":2},\"ConfigRuleList\":[{\"configRuleId\":\"cr-7b6e5180a8d100cc****\",\"configRuleArn\":\"acs:config::120390217529****:config-rule/cr-7b6e5180a8d100cc****\",\"configRuleName\":\"required-tags\",\"complianceType\":\"COMPLIANT\",\"riskLevel\":1,\"invokingEventMessageType\":\"ConfigurationItemChangeNotification\"}]}

Region

string

The region ID.

cn-hangzhou

ResourceCreateTime

integer

The timestamp when the resource was created.

1203902175293610

ResourceId

string

The resource ID.

i-uf6072y75i2cevjq****

ResourceName

string

The resource name.

test-resource

ResourceStatus

string

The status of the resource. The resource status is defined by the corresponding Alibaba Cloud service. This parameter can be empty. For example:

  • If the resource type is ACS::ECS::Instance, the resource is stateful. In this case, the value of this parameter is Running or Stopped.

  • If the resource type is ACS::OSS::Bucket, the resource is stateless. In this case, the value of this parameter is empty.

Running

ResourceType

string

The resource type.

ACS::ECS::Instance

Tags

string

The resource tags.

{\"project\":[\"efg\"]}

Limit

integer

The number of entries to return on each page for a paged query. Valid values: 1 to 100.

10

NextToken

string

The token that is used to start the next query.

caeba0bbb2be03f84eb48b699f0a****

TotalCount

integer

The total number of historical compliance evaluation results.

100

Examples

Success response

JSON format

{
  "RequestId": "DE9FFFE5-FCAD-4B24-9546-BF49273C562B",
  "ResourceComplianceTimeline": {
    "ComplianceList": [
      {
        "AccountId": "120390217529****",
        "AvailabilityZone": "cn-hangzhou-f",
        "CaptureTime": 1203902175292305,
        "Configuration": "{\\\"managetest-required-tags\\\":[{},{\\\"configRuleId\\\":\\\"cr-656d5180a8d1009c****\\\",\\\"configRuleArn\\\":\\\"acs:config::120390217529****:config-rule/cr-656d5180a8d1009c****\\\",\\\"configRuleName\\\":\\\"managetest-required-tags\\\",\\\"complianceType\\\":\\\"NON_COMPLIANT\\\",\\\"riskLevel\\\":1,\\\"annotation\\\":\\\"{\\\\\\\"desiredValue\\\\\\\":\\\\\\\"key1\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"No tag with name key1\\\\\\\"}\\\",\\\"invokingEventMessageType\\\":\\\"ConfigurationItemChangeNotification\\\"}]}",
        "ConfigurationDiff": "{\\\"Compliance\\\":{\\\"complianceType\\\":\\\"NON_COMPLIANT\\\",\\\"count\\\":2},\\\"ConfigRuleList\\\":[{\\\"configRuleId\\\":\\\"cr-7b6e5180a8d100cc****\\\",\\\"configRuleArn\\\":\\\"acs:config::120390217529****:config-rule/cr-7b6e5180a8d100cc****\\\",\\\"configRuleName\\\":\\\"required-tags\\\",\\\"complianceType\\\":\\\"COMPLIANT\\\",\\\"riskLevel\\\":1,\\\"invokingEventMessageType\\\":\\\"ConfigurationItemChangeNotification\\\"}]}",
        "Region": "cn-hangzhou",
        "ResourceCreateTime": 1203902175293610,
        "ResourceId": "i-uf6072y75i2cevjq****",
        "ResourceName": "test-resource",
        "ResourceStatus": "Running",
        "ResourceType": "ACS::ECS::Instance",
        "Tags": "{\\\"project\\\":[\\\"efg\\\"]}"
      }
    ],
    "Limit": 10,
    "NextToken": "caeba0bbb2be03f84eb48b699f0a****",
    "TotalCount": 100
  }
}

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 for a complete list.

Release notes

See Release Notes for a complete list.