This topic describes how to use Python SDK V2 to configure the access tracking feature for a bucket.
Notes
The sample code in this topic uses the region ID
cn-hangzhoufor the China (Hangzhou) region as an example. By default, a public endpoint is used. If you want to access OSS from other Alibaba Cloud products in the same region, use an internal endpoint. For more information about the mappings between OSS regions and endpoints, see OSS regions and endpoints.
Method definition
Enable access tracking
put_bucket_access_monitor(request: PutBucketAccessMonitorRequest, **kwargs) → PutBucketAccessMonitorResultQuery the access tracking status
get_bucket_access_monitor(request: GetBucketAccessMonitorRequest, **kwargs) → GetBucketAccessMonitorResultRequest parameters
Parameter | Type | Description |
request | PutBucketAccessMonitorRequest | The request parameters. For more information, see PutBucketAccessMonitorRequest |
GetBucketAccessMonitorRequest | The request parameters. For more information, see GetBucketAccessMonitorRequest |
Return values
Type | Description |
PutBucketAccessMonitorResult | The return value. For more information, see PutBucketAccessMonitorResult |
GetBucketAccessMonitorResult | The return value. For more information, see GetBucketAccessMonitorResult |
For the complete definition of enabling access tracking, see put_bucket_access_monitor.
For the complete definition of querying the access tracking status, see get_bucket_access_monitor.
Sample codes
References
For the complete sample code for enabling access tracking, see put_bucket_access_monitor.py.
For the complete sample code for querying the access tracking status, see get_bucket_access_monitor.py.