調用GetCollectionPolicy擷取對應的規則。
介面說明
該介面服務地址只能是華東 2(上海)、新加坡、河源專屬雲汽車合規(cn-heyuan-acdr-1)。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
請求文法
GET /collectionpolicy/{policyName} HTTP/1.1
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| policyName |
string |
是 |
規則名稱。 |
your_log_policy |
| productCode |
string |
否 |
產品編碼。 |
oss |
| dataCode |
string |
否 |
日誌類型編碼。 |
access_log |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
| headers |
object |
||
| Content-Length |
string |
||
| Content-Type |
string |
||
| x-log-requestid |
string |
||
| Server |
string |
||
| Date |
string |
||
| Connection |
string |
||
|
object |
返回結構體。 |
||
| collectionPolicy |
object |
返回規則。 |
|
| policyName |
string |
規則名稱。 |
your_log_policy |
| enabled |
boolean |
是否開啟。 |
true |
| productCode |
string |
產品編碼。 |
oss |
| dataCode |
string |
日誌類型編碼。 |
access_log |
| policyConfig |
object |
採集規則配置。 |
|
| resourceMode |
string |
資源採集模式。 |
all |
| regions |
array |
執行個體所屬的地區集合,支援萬用字元。 |
|
|
string |
地區 ID。 |
cn-hangzhou |
|
| instanceIds |
array |
執行個體 ID 集合。 |
|
|
string |
執行個體 ID。 |
your-test-bucket1 |
|
| resourceTags |
object |
資源標籤。 |
{"tag1":"value1","tag2":"value2"} |
| centralizeEnabled |
boolean |
是否開啟中心化儲存。 |
false |
| centralizeConfig |
object |
中心化轉投配置。 |
|
| destRegion |
string |
中心化轉投目的地區。 |
cn-beijing |
| destProject |
string |
中心化轉投目的專案。 |
your-sls-project-in-beijing |
| destLogstore |
string |
中心化轉投目的日誌庫。 |
your-sls-logstore-in-beijing |
| destTTL |
integer |
中心化轉投目的天數。 |
0 |
| resourceDirectory |
object |
資來源目錄配置, 如有配置,否則為空白 |
|
| accountGroupType |
string |
在該資來源目錄下,全選模式 all 或自訂模式 custom |
all,custom |
| members |
array |
當資來源目錄配置為 custom 模式時,對應的成員帳號列表 |
|
|
string |
阿里雲帳號 Uid |
165***********50 |
|
| dataConfig |
object |
若且唯若日誌類型為全域日誌類型時支援的配置,例如 productCode 為 sls 時的情境。否則為空白。 |
|
| dataRegion |
string |
若且唯若日誌類型為全域日誌類型時支援的配置,例如 productCode 為 sls 時的情境,表示首次配置時全域日誌將被採集到對應地區。 |
cn-beijing |
| dataProject |
string |
若且唯若日誌類型為全域日誌類型時有效,例如 productCode 為 sls 時的情境,如果為空白,表示日誌被採集到該帳號在特定 dataRegion 下的預設專屬的 Project 中。 |
"" |
| internalPolicy |
boolean |
是否是內建規則策略,內建規則不允許修改、刪除。 |
false |
| policyUid |
string |
規則所屬的帳號阿里雲帳號 Uid,如果該規則由資來源目錄管理員或者資來源目錄委派管理員建立,則為其阿里雲帳號 Uid。 |
148***********50 |
樣本
正常返回樣本
JSON格式
{
"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"
}
}
錯誤碼
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。