diff --git a/qiniu/auth.py b/qiniu/auth.py index ff1be077..5e49693d 100644 --- a/qiniu/auth.py +++ b/qiniu/auth.py @@ -36,7 +36,7 @@ 'persistentNotifyUrl', # 持久化处理结果通知URL 'persistentPipeline', # 持久化处理独享队列 'deleteAfterDays', # 文件多少天后自动删除 - 'fileType', # 文件的存储类型,0为标准存储,1为低频存储,2为归档存储,3为深度归档存储 + 'fileType', # 文件的存储类型,0为标准存储,1为低频存储,2为归档存储,3为深度归档存储,4为归档直读存储 'isPrefixalScope' # 指定上传文件必须使用的前缀 ]) diff --git a/qiniu/services/storage/bucket.py b/qiniu/services/storage/bucket.py index efb2c9b4..0f1106f5 100644 --- a/qiniu/services/storage/bucket.py +++ b/qiniu/services/storage/bucket.py @@ -60,8 +60,8 @@ def list(self, bucket, prefix=None, marker=None, limit=None, delimiter=None): options['delimiter'] = delimiter ak = self.auth.get_access_key() - rs_host = self.zone.get_rsf_host(ak, bucket) - url = '{0}/list'.format(rs_host) + rsf_host = self.zone.get_rsf_host(ak, bucket) + url = '{0}/list'.format(rsf_host) ret, info = self.__get(url, options) eof = False @@ -243,7 +243,7 @@ def change_type(self, bucket, key, storage_type): Args: bucket: 待操作资源所在空间 key: 待操作资源文件名 - storage_type: 待操作资源存储类型,0为普通存储,1为低频存储,2 为归档存储,3 为深度归档 + storage_type: 待操作资源存储类型,0为普通存储,1为低频存储,2 为归档存储,3 为深度归档,4 为归档直读存储 """ resource = entry(bucket, key) return self.__rs_do(bucket, 'chtype', resource, 'type/{0}'.format(storage_type)) @@ -289,7 +289,8 @@ def set_object_lifecycle( to_archive_after_days=0, to_deep_archive_after_days=0, delete_after_days=0, - cond=None + cond=None, + to_archive_ir_after_days=0 ): """ @@ -303,6 +304,7 @@ def set_object_lifecycle( to_deep_archive_after_days: 多少天后将文件转为深度归档存储,设置为 -1 表示取消已设置的转深度归档存储的生命周期规则, 0 表示不修改转深度归档生命周期规则 delete_after_days: 多少天后将文件删除,设置为 -1 表示取消已设置的删除存储的生命周期规则, 0 表示不修改删除存储的生命周期规则。 cond: 匹配条件,只有条件匹配才会设置成功,当前支持设置 hash、mime、fsize、putTime。 + to_archive_ir_after_days: 多少天后将文件转为归档直读存储,设置为 -1 表示取消已设置的转归档只读存储的生命周期规则, 0 表示不修改转归档只读存储生命周期规则。 Returns: resBody, respInfo @@ -310,6 +312,7 @@ def set_object_lifecycle( """ options = [ 'toIAAfterDays', str(to_line_after_days), + 'toArchiveIRAfterDays', str(to_archive_ir_after_days), 'toArchiveAfterDays', str(to_archive_after_days), 'toDeepArchiveAfterDays', str(to_deep_archive_after_days), 'deleteAfterDays', str(delete_after_days) diff --git a/qiniu/services/storage/uploaders/resume_uploader_v1.py b/qiniu/services/storage/uploaders/resume_uploader_v1.py index 136ef7ab..af184780 100644 --- a/qiniu/services/storage/uploaders/resume_uploader_v1.py +++ b/qiniu/services/storage/uploaders/resume_uploader_v1.py @@ -544,7 +544,7 @@ def __upload_part( Parameters ---------- data: IOBase - chunk_info: IOChunked + chunk_info: ChunkInfo up_hosts: list[str] up_token: str lock: Lock diff --git a/test_qiniu.py b/test_qiniu.py index 86072de5..0b07c9e3 100644 --- a/test_qiniu.py +++ b/test_qiniu.py @@ -592,6 +592,7 @@ def test_set_object_lifecycle(self): bucket=bucket_name, key=key, to_line_after_days=10, + to_archive_ir_after_days=15, to_archive_after_days=20, to_deep_archive_after_days=30, delete_after_days=40 @@ -609,6 +610,7 @@ def test_set_object_lifecycle_with_cond(self): bucket=bucket_name, key=key, to_line_after_days=10, + to_archive_ir_after_days=15, to_archive_after_days=20, to_deep_archive_after_days=30, delete_after_days=40,