Skip to content

Commit

Permalink
add funtion of bucket encryption
Browse files Browse the repository at this point in the history
  • Loading branch information
jayzhenghan committed Aug 14, 2020
1 parent 8a93284 commit 2f39767
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions qcloud_cos/cos_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2807,7 +2807,7 @@ def list_buckets(self, **kwargs):
config = CosConfig(Region=region, SecretId=secret_id, SecretKey=secret_key, Token=token) # 获取配置对象
client = CosS3Client(config)
# 获取账户下所有存储桶信息
response = logging_client.list_buckets(
response = client.list_buckets(
Bucket='bucket'
)
"""
Expand Down Expand Up @@ -3429,9 +3429,9 @@ def put_bucket_encryption(self, Bucket, ServerSideEncryptionConfiguration={}, **
"""设置执行存储桶下的默认加密配置
:param Bucket(string): 存储桶名称.
:param SSEAlgorithm(string): 要使用的服务端加密算法
:param kwargs(dict): 设置下载的headers.
:return(dict): 设置成功返回的结果.
:param ServerSideEncryptionConfiguration(dict): 设置Bucket的加密规则
:param kwargs(dict): 设置请求的headers.
:return: None.
"""
# 类型为list的标签
lst = [
Expand Down Expand Up @@ -3460,8 +3460,8 @@ def get_bucket_encryption(self, Bucket, **kwargs):
"""获取存储桶下的默认加密配置
:param Bucket(string): 存储桶名称.
:param kwargs(dict): 设置下载的headers.
:return(string): 服务端的加密算法.
:param kwargs(dict): 设置请求的headers.
:return(dict): 返回bucket的加密规则.
"""
headers = mapped(kwargs)
params = {'encryption': ''}
Expand All @@ -3485,8 +3485,8 @@ def delete_bucket_encryption(self, Bucket, **kwargs):
"""用于删除指定存储桶下的默认加密配置
:param Bucket(string): 存储桶名称.
:param kwargs(dict): 设置下载的headers.
:return(dict): 上传成功返回的结果.
:param kwargs(dict): 设置请求的headers.
:return: None.
"""
headers = mapped(kwargs)
params = {'encryption': ''}
Expand Down

0 comments on commit 2f39767

Please sign in to comment.