@@ -203,14 +203,20 @@ public function listFilesv2(
203
203
* 大于0表示多少天后删除,需大于 to_line_after_days
204
204
* @param int $to_line_after_days 指定文件上传多少天后转低频存储。指定为0表示
205
205
* 不转低频存储,小于0表示上传的文件立即变低频存储
206
+ * @param int $to_archive_after_days 指定文件上传多少天后转归档存储。指定为0表示
207
+ * 不转归档存储,小于0表示上传的文件立即变归档存储
208
+ * @param int $to_deep_archive_after_days 指定文件上传多少天后转深度归档存储。指定为0表示
209
+ * 不转深度归档存储,小于0表示上传的文件立即变深度归档存储
206
210
* @return array
207
211
*/
208
212
public function bucketLifecycleRule (
209
213
$ bucket ,
210
214
$ name ,
211
215
$ prefix ,
212
- $ delete_after_days ,
213
- $ to_line_after_days
216
+ $ delete_after_days = null ,
217
+ $ to_line_after_days = null ,
218
+ $ to_archive_after_days = null ,
219
+ $ to_deep_archive_after_days = null
214
220
) {
215
221
$ path = '/rules/add ' ;
216
222
$ params = array ();
@@ -229,6 +235,12 @@ public function bucketLifecycleRule(
229
235
if ($ to_line_after_days ) {
230
236
$ params ['to_line_after_days ' ] = $ to_line_after_days ;
231
237
}
238
+ if ($ to_archive_after_days ) {
239
+ $ params ['to_archive_after_days ' ] = $ to_archive_after_days ;
240
+ }
241
+ if ($ to_deep_archive_after_days ) {
242
+ $ params ['to_deep_archive_after_days ' ] = $ to_deep_archive_after_days ;
243
+ }
232
244
$ data = http_build_query ($ params );
233
245
$ info = $ this ->ucPost ($ path , $ data );
234
246
return $ info ;
@@ -245,14 +257,20 @@ public function bucketLifecycleRule(
245
257
* 大于0表示多少天后删除,需大于 to_line_after_days
246
258
* @param int $to_line_after_days 指定文件上传多少天后转低频存储。指定为0表示不
247
259
* 转低频存储,小于0表示上传的文件立即变低频存储
260
+ * @param int $to_archive_after_days 指定文件上传多少天后转归档存储。指定为0表示
261
+ * 不转归档存储,小于0表示上传的文件立即变归档存储
262
+ * @param int $to_deep_archive_after_days 指定文件上传多少天后转深度归档存储。指定为0表示
263
+ * 不转深度归档存储,小于0表示上传的文件立即变深度归档存储
248
264
* @return array
249
265
*/
250
266
public function updateBucketLifecycleRule (
251
267
$ bucket ,
252
268
$ name ,
253
269
$ prefix ,
254
- $ delete_after_days ,
255
- $ to_line_after_days
270
+ $ delete_after_days = null ,
271
+ $ to_line_after_days = null ,
272
+ $ to_archive_after_days = null ,
273
+ $ to_deep_archive_after_days = null
256
274
) {
257
275
$ path = '/rules/update ' ;
258
276
$ params = array ();
@@ -271,6 +289,12 @@ public function updateBucketLifecycleRule(
271
289
if ($ to_line_after_days ) {
272
290
$ params ['to_line_after_days ' ] = $ to_line_after_days ;
273
291
}
292
+ if ($ to_archive_after_days ) {
293
+ $ params ['to_archive_after_days ' ] = $ to_archive_after_days ;
294
+ }
295
+ if ($ to_deep_archive_after_days ) {
296
+ $ params ['to_deep_archive_after_days ' ] = $ to_deep_archive_after_days ;
297
+ }
274
298
$ data = http_build_query ($ params );
275
299
return $ this ->ucPost ($ path , $ data );
276
300
}
@@ -675,7 +699,7 @@ public function changeMime($bucket, $key, $mime)
675
699
*
676
700
* @param string $bucket 待操作资源所在空间
677
701
* @param string $key 待操作资源文件名
678
- * @param int $fileType 0 表示标准存储;1 表示低频存储;2 表示归档存储
702
+ * @param int $fileType 0 表示标准存储;1 表示低频存储;2 表示归档存储;3 表示深度归档存储
679
703
*
680
704
* @return array
681
705
* @link https://developer.qiniu.com/kodo/api/3710/chtype
@@ -687,6 +711,23 @@ public function changeType($bucket, $key, $fileType)
687
711
return $ this ->rsPost ($ path );
688
712
}
689
713
714
+ /**
715
+ * 解冻指定资源的存储类型
716
+ *
717
+ * @param string $bucket 待操作资源所在空间
718
+ * @param string $key 待操作资源文件名
719
+ * @param int $freezeAfterDays 解冻有效时长,取值范围 1~7
720
+ *
721
+ * @return array
722
+ * @link https://developer.qiniu.com/kodo/api/6380/restore-archive
723
+ */
724
+ public function restoreAr ($ bucket , $ key , $ freezeAfterDays )
725
+ {
726
+ $ resource = \Qiniu \entry ($ bucket , $ key );
727
+ $ path = '/restoreAr/ ' . $ resource . '/freezeAfterDays/ ' . $ freezeAfterDays ;
728
+ return $ this ->rsPost ($ path );
729
+ }
730
+
690
731
/**
691
732
* 修改文件的存储状态,即禁用状态和启用状态间的的互相转换
692
733
*
@@ -1031,6 +1072,15 @@ public static function buildBatchChangeType($bucket, $key_type_pairs)
1031
1072
return $ data ;
1032
1073
}
1033
1074
1075
+ public static function buildBatchRestoreAr ($ bucket , $ key_restore_days_pairs )
1076
+ {
1077
+ $ data = array ();
1078
+ foreach ($ key_restore_days_pairs as $ key => $ restore_days ) {
1079
+ array_push ($ data , '/restoreAr/ ' . \Qiniu \entry ($ bucket , $ key ) . '/freezeAfterDays/ ' . $ restore_days );
1080
+ }
1081
+ return $ data ;
1082
+ }
1083
+
1034
1084
private static function oneKeyBatch ($ operation , $ bucket , $ keys )
1035
1085
{
1036
1086
$ data = array ();
0 commit comments