GetCollectionPolicy
Retrieves the specified collection policy.
Operation description
This operation is available only at the following endpoints: China (Shanghai), Singapore, and cn-heyuan-acdr-1 (Heyuan Chinese Automotive Compliance Cloud).
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
log:GetCollectionPolicy |
get |
*CollectionPolicy
|
|
None |
Request syntax
GET /collectionpolicy/{policyName} HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| policyName |
string |
Yes |
The name of the policy. |
your_log_policy |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| productCode |
string |
No |
The product code. |
oss |
| dataCode |
string |
No |
The log type code. |
access_log |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response struct. |
||
| collectionPolicy |
object |
The collection policy. |
|
| 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 centralized delivery. |
0 |
| centralizeEnabled |
boolean |
Indicates whether centralized storage is enabled. |
false |
| dataCode |
string |
The log type code. |
access_log |
| dataConfig |
object |
The configuration that 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 |
This parameter is valid 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 configuration that 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-beijing |
| enabled |
boolean |
Indicates whether the policy is enabled. |
true |
| internalPolicy |
boolean |
Indicates whether the policy is a built-in policy. Built-in policies cannot be modified or deleted. |
false |
| policyConfig |
object |
The collection policy 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. Wildcards are supported. |
|
|
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 name of the policy. |
your_log_policy |
| policyUid |
string |
The Alibaba Cloud account ID of the account to which the policy belongs. If the policy is created by a resource directory administrator or a resource directory delegated administrator, 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 resource directory is configured. |
|
| accountGroupType |
string |
The account group type in the resource directory. Valid values:
|
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 |
Examples
Success response
JSON format
{
"collectionPolicy": {
"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-beijing"
},
"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\n",
"productCode": "oss",
"resourceDirectory": {
"accountGroupType": "all,custom",
"members": [
"165***********50"
]
}
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.