ListCollectionPolicies

Updated at:

Lists the collection rules for cloud service log collection.

Operation description

This operation is available only at the following service endpoints: China (Shanghai), Singapore, and cn-heyuan-acdr-1 (Heyuan Chinese Automotive Compliance Cloud).

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

log:ListCollectionPolicies

list

*CollectionPolicy

acs:log::{#accountId}:collectionpolicy/*

  • log:TLSVersion
None

Request syntax

GET /collectionpolicy HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

productCode

string

No

The product code.

oss

dataCode

string

No

The log type code.

access_log

policyName

string

No

The rule name.

your_log_policy

size

integer

No

The number of entries per page in a paged query. Default value: 50. Maximum value: 100.

50

offset

integer

No

The start row of the query. Default value: 0.

0

instanceId

string

No

The instance ID. If you specify an instance ID, you can perform a reverse query to find the rules that match the instance. This parameter must be used together with productCode and dataCode.

your-test-bucket1

centralProject

string

No

The destination project for centralized delivery. If you specify this parameter, you can perform a reverse query to find how many rules are configured with centralized delivery to the specified centralProject.

your-central-project1

Response elements

Element

Type

Description

Example

object

The response struct.

currentCount

integer

The number of entries on the current page.

1

data

array<object>

The rule data returned based on the pagination settings for the current query conditions.

array<object>

The rule details.

centralizeConfig

object

The centralized delivery configuration.

destLogstore

string

The destination Logstore for centralized delivery.

your-sls-logstore-in-beijing

destProject

string

The destination project for centralized delivery.

your-sls-project-in-beijing

destRegion

string

The destination region for centralized delivery.

cn-beijing

destTTL

integer

The data retention period in days for the centralized delivery destination.

0

centralizeEnabled

boolean

Indicates whether centralized delivery is enabled.

false

dataCode

string

The log type code.

access_log

dataConfig

object

The data configuration. This parameter is supported only when the log type is a global log type, such as when productCode is set to sls. Otherwise, this parameter is empty.

dataProject

string

The data project. This parameter takes effect only when the log type is a global log type, such as when productCode is set to sls. If this parameter is empty, logs are collected to the default dedicated project of the account in the specified dataRegion.

""

dataRegion

string

The data region. This parameter is supported only when the log type is a global log type, such as when productCode is set to sls. This parameter specifies the region to which global logs are collected during initial configuration.

cn-hangzhou

enabled

boolean

Indicates whether the rule is enabled.

true

internalPolicy

boolean

Indicates whether the rule is a built-in policy. Built-in rules cannot be modified or deleted.

false

policyConfig

object

The collection rule configuration.

instanceIds

array

The list of instance IDs.

string

The instance ID.

your-test-bucket1

regions

array

The list of regions to which the instances belong.

string

The region ID.

cn-hangzhou

resourceMode

string

The resource collection mode.

all

resourceTags

object

The resource tags.

{"tag1":"value1","tag2":"value2"}

policyName

string

The rule name.

your_log_policy

policyUid

string

The Alibaba Cloud account ID of the account to which the rule belongs. If the rule is created by a resource directory administrator or a delegated administrator of the resource directory, this parameter is set to the Alibaba Cloud account ID of that administrator.

148***********50

productCode

string

The product code.

oss

resourceDirectory

object

The resource directory configuration. This parameter is empty if no configuration exists.

accountGroupType

string

The account group type in the resource directory. Valid values: all and custom.

all,custom

members

array

The list of member accounts when the resource directory configuration is set to custom mode.

string

The Alibaba Cloud account ID.

165***********50

statistics

array<object>

The statistics returned for the current query conditions.

array<object>

The rule statistics grouped by productCode.

policySourceList

array<object>

The list of rule sources.

object

The rule source object.

policyName

string

The rule name.

policy_name1_from148

policyUid

string

The Alibaba Cloud account ID of the account to which the rule belongs. If the rule is created by a resource directory administrator or a delegated administrator of the resource directory, this parameter is set to the Alibaba Cloud account ID of that administrator.

148***********50

productCode

string

The product code.

oss

totalCount

integer

The total number of entries.

1

Examples

Success response

JSON format

{
  "currentCount": 1,
  "data": [
    {
      "centralizeConfig": {
        "destLogstore": "your-sls-logstore-in-beijing\n",
        "destProject": "your-sls-project-in-beijing\n",
        "destRegion": "cn-beijing\n",
        "destTTL": 0
      },
      "centralizeEnabled": false,
      "dataCode": "access_log",
      "dataConfig": {
        "dataProject": "\"\"",
        "dataRegion": "cn-hangzhou"
      },
      "enabled": true,
      "internalPolicy": false,
      "policyConfig": {
        "instanceIds": [
          "your-test-bucket1\n"
        ],
        "regions": [
          "cn-hangzhou"
        ],
        "resourceMode": "all",
        "resourceTags": {
          "tag1": "value1",
          "tag2": "value2"
        }
      },
      "policyName": "your_log_policy",
      "policyUid": "148***********50",
      "productCode": "oss",
      "resourceDirectory": {
        "accountGroupType": "all,custom",
        "members": [
          "165***********50"
        ]
      }
    }
  ],
  "statistics": [
    {
      "policySourceList": [
        {
          "policyName": "policy_name1_from148",
          "policyUid": "148***********50"
        }
      ],
      "productCode": "oss"
    }
  ],
  "totalCount": 1
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.