ListReportTemplates

Updated at:

Retrieves the details of compliance report templates in batches.

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:ListReportTemplates

list

*ReportTemplate

acs:config::{#accountId}:reporttemplate/*

None None

Request parameters

Parameter

Type

Required

Description

Example

NextToken

string

No

The next token. If the response is truncated, you can use this token to send another request and retrieve the remaining results.

IWBjqMYSy0is7zSMGu16****

MaxResults

integer

No

The number of entries to return per page. Default value: 20.

20

Keyword

string

No

The search keyword. Fuzzy match is supported for template IDs, template names, and template descriptions.

test-description

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

8195B664-9565-4685-89AC-8B5F04B44B92

TotalCount

integer

The total number of templates.

7

MaxResults

integer

The number of entries per page. Valid values: 1 to 50. Default value: 20.

20

NextToken

string

The next token. If the response is truncated, you can use this token to send another request and retrieve the remaining results.

aVCjqNaSy0Ps7zSMGu25****

ReportTemplateList

array<object>

The list of report templates.

array<object>

ReportTemplateId

string

The ID of the report template.

crt-xxx

ReportTemplateName

string

The name of the report template.

test-name

ReportTemplateDescription

string

The description of the report template.

test-description

ReportGranularity

string

The aggregation granularity of the report.

For a management account, the following values are supported:

  • AllInOne: Aggregates all accounts within the template scope to generate a single report.

  • GroupByAggregator: Aggregates accounts by account group to generate reports and packages them into a compressed file.

  • GroupByAccount: Generates a separate report for each account (default) and packages them into a compressed file.

For member accounts, only GroupByAccount is supported.

AllInOne

ReportFileFormats

string

The format of the report. Currently, only Excel is supported.

excel

ReportLanguage

string

The language of the report. Valid values: zh-CN and en-US. Default value: en-US.

en-US

SubscriptionFrequency

string

The subscription frequency of the report. If this field is not empty, it is a Quartz cron expression that triggers subscription notifications.

The format is: Seconds Minutes Hours Day-of-month Month Day-of-week. The following are common cron expression examples:

  • Execute at 00:00 every day: 0 0 0 * * ?

  • Execute at 15:30 every Monday: 0 30 15 ? * MON

  • Execute at 02:00 on the 1st day of every month: 0 0 2 1 * ?

Where:

  • "*" indicates any value.

  • "?" is used in the day-of-month and day-of-week fields to indicate no specific value.

  • "MON" indicates Monday.

Note

The trigger time is in UTC+8. You can convert the cron expression settings based on your time zone.

Note

The system tries to trigger notifications according to the cron expression, but delays may occur due to the report generation status. The cron expression limits notifications for the same template to a maximum of once per day.

Note

In addition to using "MON" for Monday, you can also use numbers. Note that in the Quartz framework: 1 represents Sunday. 2 represents Monday. 3 represents Tuesday. 4 represents Wednesday. 5 represents Thursday. 6 represents Friday. 7 represents Saturday.

0 0 13 * * ?

ReportScope

array<object>

The array of report scopes, which is used to specify the scope of rules included in the audit report. The logical OR operation is applied between each ReportScope in the array.

Note

For example, if the array size is 2, the first ReportScope specifies the rule In cr-1, and the second ReportScope specifies the rule In cr-2, the rule scope defined for this report includes cr-1 and cr-2.

object

The report scope.

Key

string

The key of the report scope. Valid values:

  • AggregatorId

  • CompliancePackId

  • RuleId

RuleId

Value

string

The value of the report scope. Multiple values of the same type, such as multiple rule IDs, can be separated by commas (,).

cr-1,cr-2

MatchType

string

The matching logic. Currently, only In is supported.

In

Examples

Success response

JSON format

{
  "RequestId": "8195B664-9565-4685-89AC-8B5F04B44B92",
  "TotalCount": 7,
  "MaxResults": 20,
  "NextToken": "aVCjqNaSy0Ps7zSMGu25****",
  "ReportTemplateList": [
    {
      "ReportTemplateId": "crt-xxx",
      "ReportTemplateName": "test-name",
      "ReportTemplateDescription": "test-description",
      "ReportGranularity": "AllInOne",
      "ReportFileFormats": "excel",
      "ReportLanguage": "en-US",
      "SubscriptionFrequency": "0 0 13 * * ?",
      "ReportScope": [
        {
          "Key": "RuleId",
          "Value": "cr-1,cr-2",
          "MatchType": "In"
        }
      ]
    }
  ]
}

Error codes

HTTP status code

Error code

Error message

Description

400 ReportTemplateNotExist Report template does not exist or invalid. Report template does not exist, please check the input ReportTemplateId
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.