All Products
Search
Document Center

Simple Log Service:GetCollectionPolicy

Last Updated:Jun 11, 2026

Mengambil detail aturan tertentu.

Deskripsi operasi

The endpoint for this operation is available only in the China (Shanghai), Singapore, and China (Heyuan) Automotive Compliance Cloud (cn-heyuan-acdr-1) regions.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tidak ada otorisasi untuk operasi ini. Jika Anda mengalami masalah saat menjalankan operasi ini, hubungi dukungan teknis.

Sintaks permintaan

GET /collectionpolicy/{policyName} HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

policyName

string

Yes

Nama aturan.

your_log_policy

Parameter permintaan

Parameter

Type

Required

Description

Example

productCode

string

No

Kode produk.

oss

dataCode

string

No

Kode tipe log.

access_log

Elemen respons

Element

Type

Description

Example

object

The response body.

collectionPolicy

object

The details of the rule.

policyName

string

The name of the rule.

your_log_policy

enabled

boolean

Indicates whether the rule is enabled.

true

productCode

string

The code of the product.

oss

dataCode

string

The code for the log type.

access_log

policyConfig

object

The configuration of the collection rule.

resourceMode

string

The collection pattern for resources.

all

regions

array

The regions where the instances reside. Wildcard characters are supported.

string

The region ID.

cn-hangzhou

instanceIds

array

The instance IDs.

string

The instance ID.

your-test-bucket1

resourceTags

object

The resource tags.

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

centralizeEnabled

boolean

Indicates whether centralized storage is enabled.

false

centralizeConfig

object

The configuration for centralized shipping.

destRegion

string

The destination region for centralized shipping.

cn-beijing

destProject

string

The destination project for centralized shipping.

your-sls-project-in-beijing

destLogstore

string

The destination Logstore for centralized shipping.

your-sls-logstore-in-beijing

destTTL

integer

The retention period of the destination Logstore. Unit: days.

0

resourceDirectory

object

The configuration of the resource directory. This parameter is empty if no configuration is specified.

accountGroupType

string

The mode for selecting accounts in the resource directory. Valid values: `all` and `custom`.

all,custom

members

array

The member accounts. This parameter is returned only when `accountGroupType` is set to `custom`.

string

The ID of the Alibaba Cloud account.

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

dataConfig

object

The configuration that is supported only for global log types, such as when `productCode` is `sls`. Otherwise, this parameter is empty.

dataRegion

string

This parameter is supported only for global log types, such as when `productCode` is `sls`. This parameter specifies the region to which global logs are collected during the initial configuration.

cn-beijing

dataProject

string

This parameter is valid only for global log types, such as when `productCode` is `sls`. If this parameter is left empty, logs are collected to the default project of the account in the specified `dataRegion`.

""

internalPolicy

boolean

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

false

policyUid

string

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

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

Contoh

Respons sukses

JSONformat

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

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.