@@ -3534,6 +3534,36 @@ def get_bucket_intelligenttiering(self, Bucket, **kwargs):
35343534 params = params )
35353535 data = xml_to_dict (rt .content )
35363536 return data
3537+
3538+ def get_bucket_intelligenttiering_v2 (self , Bucket , Id , ** kwargs ):
3539+ """获取存储桶智能分层配置
3540+
3541+ :param Bucket(string): 存储桶名称.
3542+ :param Id(string) 智能分层规则Id.
3543+ :param kwargs(dict): 设置请求headers.
3544+ :return(dict): 智能分层配置.
3545+
3546+ .. code-block:: python
3547+ config = CosConfig(Region=region, SecretId=secret_id, SecretKey=secret_key, Token=token) # 获取配置对象
3548+ client = CosS3Client(config)
3549+ client.get_bucket_intelligenttiering_v2(Bucket='bucket', Id='id')
3550+ """
3551+
3552+ headers = mapped (kwargs )
3553+ params = {'id' : Id }
3554+ url = self ._conf .uri (bucket = Bucket ) + '?intelligent-tiering'
3555+ logger .info ("get bucket intelligenttiering, url=:{url} ,headers=:{headers}" .format (
3556+ url = url ,
3557+ headers = headers ))
3558+ rt = self .send_request (
3559+ method = 'GET' ,
3560+ url = url ,
3561+ bucket = Bucket ,
3562+ auth = CosS3Auth (self ._conf , params = params ),
3563+ headers = headers ,
3564+ params = params )
3565+ data = xml_to_dict (rt .content )
3566+ return data
35373567
35383568 def put_bucket_object_lock (self , Bucket , ObjectLockConfiguration = {}, ** kwargs ):
35393569 """设置存储桶对象锁定配置
@@ -3706,7 +3736,7 @@ def _get_bucket_replication_wrapper(Bucket, **kwargs):
37063736 logger .debug ("get_bucket_meta failed to get replication conf:{}" .format (e ))
37073737 pool .add_task (_get_bucket_replication_wrapper , Bucket , ** kwargs )
37083738
3709- # Replication
3739+ # Encryption
37103740 def _get_bucket_encryption_wrapper (Bucket , ** kwargs ):
37113741 try :
37123742 resp = self .get_bucket_encryption (Bucket , ** kwargs )
@@ -3734,13 +3764,13 @@ def _get_bucket_versioning_wrapper(Bucket, **kwargs):
37343764 pool .add_task (_get_bucket_versioning_wrapper , Bucket , ** kwargs )
37353765
37363766 # IntelligentTiering
3737- def _get_bucket_intelligenttiering_wrapper (Bucket , ** kwargs ):
3767+ def _get_bucket_intelligenttiering_v2_wrapper (Bucket , Id , ** kwargs ):
37383768 try :
3739- resp = self .get_bucket_intelligenttiering (Bucket , ** kwargs )
3769+ resp = self .get_bucket_intelligenttiering_v2 (Bucket , Id , ** kwargs )
37403770 data .update ({'IntelligentTiering' : resp })
37413771 except CosServiceError as e :
37423772 logger .debug ("get_bucket_meta failed to get intelligenttiering conf:{}" .format (e ))
3743- pool .add_task (_get_bucket_intelligenttiering_wrapper , Bucket , ** kwargs )
3773+ pool .add_task (_get_bucket_intelligenttiering_v2_wrapper , Bucket , "default" , ** kwargs )
37443774
37453775 # Tagging
37463776 def _get_bucket_tagging_wrapper (Bucket , ** kwargs ):
0 commit comments