Menampilkan daftar aturan pengumpulan log dari layanan Alibaba Cloud.
Deskripsi operasi
This API operation is available only at the endpoints in the following regions: China (Shanghai), Singapore, and Heyuan Automotive Compliance Cloud (cn-heyuan-acdr-1).
Coba sekarang
Test
RAM authorization
Sintaks permintaan
GET /collectionpolicy HTTP/1.1
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| productCode |
string |
No |
Kode layanan Alibaba Cloud. |
oss |
| dataCode |
string |
No |
Kode tipe log. |
access_log |
| policyName |
string |
No |
Nama aturan pengumpulan. |
your_log_policy |
| size |
integer |
No |
Jumlah aturan pengumpulan yang dikembalikan pada setiap halaman. Nilai default: 50. Nilai maksimum: 100. |
50 |
| offset |
integer |
No |
Baris tempat kueri dimulai. Nilai default: 0. |
0 |
| instanceId |
string |
No |
ID instans. Tentukan parameter ini untuk mengkueri aturan yang cocok dengan instans tertentu. Jika Anda menggunakan parameter ini, Anda juga harus menentukan productCode dan dataCode. |
your-test-bucket1 |
| centralProject |
string |
No |
Proyek tujuan untuk pengiriman data terpusat. Tentukan parameter ini untuk mengkueri jumlah aturan yang dikonfigurasi untuk mengirim data ke proyek ini. |
your-central-project1 |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
The response body. |
||
| totalCount |
integer |
The total number of collection rules. |
1 |
| currentCount |
integer |
The number of collection rules returned on the current page. |
1 |
| data |
array<object> |
The collection rules that are returned on the current page. |
|
|
array<object> |
The details of the collection rule. |
||
| productCode |
string |
The code of the Alibaba Cloud service. |
oss |
| dataCode |
string |
The code of the log type. |
access_log |
| policyName |
string |
The name of the collection rule. |
your_log_policy |
| enabled |
boolean |
Indicates whether the collection rule is enabled. |
true |
| policyConfig |
object |
The configuration of the collection rule. |
|
| resourceMode |
string |
The resource collection mode. |
all |
| regions |
array |
The regions to which the instances belong. |
|
|
string |
The region ID. |
cn-hangzhou |
|
| instanceIds |
array |
The IDs of the instances. |
|
|
string |
The instance ID. |
your-test-bucket1 |
|
| resourceTags |
object |
The resource tags. |
{"tag1":"value1","tag2":"value2"} |
| centralizeEnabled |
boolean |
Indicates whether centralized data shipping is enabled. |
false |
| centralizeConfig |
object |
The configuration for centralized data shipping. |
|
| destRegion |
string |
The destination region for centralized data shipping. |
cn-beijing |
| destProject |
string |
The destination project for centralized data shipping. |
your-sls-project-in-beijing |
| destLogstore |
string |
The destination Logstore for centralized data shipping. |
your-sls-logstore-in-beijing |
| destTTL |
integer |
The data retention period of the destination Logstore for centralized data shipping. Unit: days. |
0 |
| resourceDirectory |
object |
The configuration of the resource directory. This parameter is empty if no configuration is available. |
|
| accountGroupType |
string |
The mode for selecting accounts in the resource directory. Valid values: all and custom. |
all,custom |
| members |
array |
The list of member accounts. This parameter is returned only if accountGroupType is set to custom. |
|
|
string |
The ID of the Alibaba Cloud account. |
165***********50 |
|
| dataConfig |
object |
Configurations for global log types, such as sls. This parameter is empty for other log types. |
|
| dataRegion |
string |
The region where global logs are first collected. This parameter is used only for global log types, such as sls. |
cn-hangzhou |
| dataProject |
string |
The project for global logs. This parameter is used only for global log types, such as sls. If this parameter is empty, logs are collected to the default project of the account in the region specified by dataRegion. |
"" |
| internalPolicy |
boolean |
Indicates whether the policy is a built-in policy. Built-in policies cannot be modified or deleted. |
false |
| policyUid |
string |
The ID of the Alibaba Cloud account that owns the collection rule. If a resource directory administrator or delegated administrator creates the rule, this is the ID of that administrator's account. |
148***********50 |
| statistics |
array<object> |
Statistics returned based on the query conditions. |
|
|
array<object> |
Statistics for collection rules, grouped by productCode. |
||
| productCode |
string |
The code of the Alibaba Cloud service. |
oss |
| policySourceList |
array<object> |
The list of collection rule sources. |
|
|
object |
The source of the collection rule. |
||
| policyUid |
string |
The ID of the Alibaba Cloud account that owns the collection rule. If a resource directory administrator or delegated administrator creates the rule, this is the ID of that administrator's account. |
148***********50 |
| policyName |
string |
The name of the collection rule. |
policy_name1_from148 |
Contoh
Respons sukses
JSONformat
{
"totalCount": 1,
"currentCount": 1,
"data": [
{
"productCode": "oss",
"dataCode": "access_log",
"policyName": "your_log_policy",
"enabled": true,
"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-hangzhou",
"dataProject": "\"\""
},
"internalPolicy": false,
"policyUid": "148***********50"
}
],
"statistics": [
{
"productCode": "oss",
"policySourceList": [
{
"policyUid": "148***********50",
"policyName": "policy_name1_from148"
}
]
}
]
}
Kode kesalahan
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.