@@ -215,18 +215,23 @@ public function listFilesv2(
215
215
/**
216
216
* 增加bucket生命规则
217
217
*
218
- * @param string $bucket 空间名
219
- * @param string $name 规则名称 bucket 内唯一,长度小于50,不能为空,只能为
220
- * 字母、数字、下划线
221
- * @param string $prefix 同一个 bucket 里面前缀不能重复
222
- * @param int $delete_after_days 指定上传文件多少天后删除,指定为0表示不删除,
223
- * 大于0表示多少天后删除,需大于 to_line_after_days
224
- * @param int $to_line_after_days 指定文件上传多少天后转低频存储。指定为0表示
225
- * 不转低频存储,小于0表示上传的文件立即变低频存储
226
- * @param int $to_archive_after_days 指定文件上传多少天后转归档存储。指定为0表示
227
- * 不转归档存储,小于0表示上传的文件立即变归档存储
228
- * @param int $to_deep_archive_after_days 指定文件上传多少天后转深度归档存储。指定为0表示
229
- * 不转深度归档存储,小于0表示上传的文件立即变深度归档存储
218
+ * @param string $bucket
219
+ * 空间名
220
+ * @param string $name
221
+ * 规则名称 bucket 内唯一,长度小于50,不能为空,只能为字母、数字、下划线
222
+ * @param string $prefix
223
+ * 同一个 bucket 里面前缀不能重复
224
+ * @param int $delete_after_days
225
+ * 指定上传文件多少天后删除,指定为0表示不删除,大于0表示多少天后删除。
226
+ * 需大于 to_line_after_days
227
+ * @param int $to_line_after_days
228
+ * 指定文件上传多少天后转低频存储。指定为0表示不转低频存储
229
+ * @param int $to_archive_ir_after_days
230
+ * 指定文件上传多少天后转归档直读。指定为0表示不转归档直读
231
+ * @param int $to_archive_after_days
232
+ * 指定文件上传多少天后转归档存储。指定为0表示不转归档存储
233
+ * @param int $to_deep_archive_after_days
234
+ * 指定文件上传多少天后转深度归档存储。指定为0表示不转深度归档存储
230
235
* @return array
231
236
*/
232
237
public function bucketLifecycleRule (
@@ -236,7 +241,8 @@ public function bucketLifecycleRule(
236
241
$ delete_after_days = null ,
237
242
$ to_line_after_days = null ,
238
243
$ to_archive_after_days = null ,
239
- $ to_deep_archive_after_days = null
244
+ $ to_deep_archive_after_days = null ,
245
+ $ to_archive_ir_after_days = null
240
246
) {
241
247
$ path = '/rules/add ' ;
242
248
$ params = array ();
@@ -255,6 +261,9 @@ public function bucketLifecycleRule(
255
261
if ($ to_line_after_days ) {
256
262
$ params ['to_line_after_days ' ] = $ to_line_after_days ;
257
263
}
264
+ if ($ to_archive_ir_after_days ) {
265
+ $ params ['to_archive_ir_after_days ' ] = $ to_archive_ir_after_days ;
266
+ }
258
267
if ($ to_archive_after_days ) {
259
268
$ params ['to_archive_after_days ' ] = $ to_archive_after_days ;
260
269
}
@@ -269,18 +278,23 @@ public function bucketLifecycleRule(
269
278
/**
270
279
* 更新bucket生命规则
271
280
*
272
- * @param string $bucket 空间名
273
- * @param string $name 规则名称 bucket 内唯一,长度小于50,不能为空,只能为字母、
274
- * 数字、下划线
275
- * @param string $prefix 同一个 bucket 里面前缀不能重复
276
- * @param int $delete_after_days 指定上传文件多少天后删除,指定为0表示不删除,
277
- * 大于0表示多少天后删除,需大于 to_line_after_days
278
- * @param int $to_line_after_days 指定文件上传多少天后转低频存储。指定为0表示不
279
- * 转低频存储,小于0表示上传的文件立即变低频存储
280
- * @param int $to_archive_after_days 指定文件上传多少天后转归档存储。指定为0表示
281
- * 不转归档存储,小于0表示上传的文件立即变归档存储
282
- * @param int $to_deep_archive_after_days 指定文件上传多少天后转深度归档存储。指定为0表示
283
- * 不转深度归档存储,小于0表示上传的文件立即变深度归档存储
281
+ * @param string $bucket
282
+ * 空间名
283
+ * @param string $name
284
+ * 规则名称 bucket 内唯一,长度小于50,不能为空,只能为字母、数字、下划线
285
+ * @param string $prefix
286
+ * 同一个 bucket 里面前缀不能重复
287
+ * @param int $delete_after_days
288
+ * 指定上传文件多少天后删除,指定为0表示不删除,大于0表示多少天后删除
289
+ * 需大于 to_line_after_days
290
+ * @param int $to_line_after_days
291
+ * 指定文件上传多少天后转低频存储。指定为0表示不转低频存储
292
+ * @param int $to_archive_ir_after_days
293
+ * 指定文件上传多少天后转归档只读。指定为0表示不转归档只读
294
+ * @param int $to_archive_after_days
295
+ * 指定文件上传多少天后转归档存储。指定为0表示不转归档存储
296
+ * @param int $to_deep_archive_after_days
297
+ * 指定文件上传多少天后转深度归档存储。指定为0表示不转深度归档存储
284
298
* @return array
285
299
*/
286
300
public function updateBucketLifecycleRule (
@@ -290,7 +304,8 @@ public function updateBucketLifecycleRule(
290
304
$ delete_after_days = null ,
291
305
$ to_line_after_days = null ,
292
306
$ to_archive_after_days = null ,
293
- $ to_deep_archive_after_days = null
307
+ $ to_deep_archive_after_days = null ,
308
+ $ to_archive_ir_after_days = null
294
309
) {
295
310
$ path = '/rules/update ' ;
296
311
$ params = array ();
@@ -309,6 +324,9 @@ public function updateBucketLifecycleRule(
309
324
if ($ to_line_after_days ) {
310
325
$ params ['to_line_after_days ' ] = $ to_line_after_days ;
311
326
}
327
+ if ($ to_archive_ir_after_days ) {
328
+ $ params ['to_archive_ir_after_days ' ] = $ to_archive_ir_after_days ;
329
+ }
312
330
if ($ to_archive_after_days ) {
313
331
$ params ['to_archive_after_days ' ] = $ to_archive_after_days ;
314
332
}
@@ -724,6 +742,7 @@ public function changeMime($bucket, $key, $mime)
724
742
* 1 表示低频存储;
725
743
* 2 表示归档存储;
726
744
* 3 表示深度归档存储;
745
+ * 4 表示归档直读存储;
727
746
*
728
747
* @return array
729
748
* @link https://developer.qiniu.com/kodo/api/3710/chtype
@@ -811,7 +830,7 @@ public function fetch($url, $bucket, $key = null)
811
830
* @param string $callbackbody 回调Body
812
831
* @param string $callbackbodytype 回调Body内容类型,默认为"application/x-www-form-urlencoded"
813
832
* @param string $callbackhost 回调时使用的Host
814
- * @param int $file_type 存储文件类型 0:标准存储(默认),1:低频存储,2:归档存储
833
+ * @param int $file_type 存储文件类型 0:标准存储(默认),1:低频存储,2:归档存储,3:深度归档存储,4:归档直读存储
815
834
* @param bool $ignore_same_key 如果空间中已经存在同名文件则放弃本次抓取
816
835
* @return array
817
836
* @link https://developer.qiniu.com/kodo/api/4097/asynch-fetch
@@ -952,6 +971,9 @@ public function deleteAfterDays($bucket, $key, $days)
952
971
* @param int $to_line_after_days 多少天后将文件转为低频存储。
953
972
* -1 表示取消已设置的转低频存储的生命周期规则;
954
973
* 0 表示不修改转低频生命周期规则。
974
+ * @param int $to_archive_ir_after_days 多少天后转为归档直读存储。
975
+ * -1 表示取消已设置的转归档直读存储的生命周期规则;
976
+ * 0 表示不修改转归档直读生命周期规则。
955
977
* @param int $to_archive_after_days 多少天后将文件转为归档存储。
956
978
* -1 表示取消已设置的转归档存储的生命周期规则;
957
979
* 0 表示不修改转归档生命周期规则。
@@ -969,7 +991,8 @@ public function setObjectLifecycle(
969
991
$ to_line_after_days = 0 ,
970
992
$ to_archive_after_days = 0 ,
971
993
$ to_deep_archive_after_days = 0 ,
972
- $ delete_after_days = 0
994
+ $ delete_after_days = 0 ,
995
+ $ to_archive_ir_after_days = 0
973
996
) {
974
997
return $ this ->setObjectLifecycleWithCond (
975
998
$ bucket ,
@@ -978,7 +1001,8 @@ public function setObjectLifecycle(
978
1001
$ to_line_after_days ,
979
1002
$ to_archive_after_days ,
980
1003
$ to_deep_archive_after_days ,
981
- $ delete_after_days
1004
+ $ delete_after_days ,
1005
+ $ to_archive_ir_after_days
982
1006
);
983
1007
}
984
1008
@@ -990,6 +1014,9 @@ public function setObjectLifecycle(
990
1014
* @param int $to_line_after_days 多少天后将文件转为低频存储。
991
1015
* 设置为 -1 表示取消已设置的转低频存储的生命周期规则;
992
1016
* 0 表示不修改转低频生命周期规则。
1017
+ * @param int $to_archive_ir_after_days 多少天后将文件转为归档直读存储。
1018
+ * 设置为 -1 表示取消已设置的转归档直读存储的生命周期规则;
1019
+ * 0 表示不修改转归档直读生命周期规则。
993
1020
* @param int $to_archive_after_days 多少天后将文件转为归档存储。
994
1021
* -1 表示取消已设置的转归档存储的生命周期规则;
995
1022
* 0 表示不修改转归档生命周期规则。
@@ -1010,11 +1037,13 @@ public function setObjectLifecycleWithCond(
1010
1037
$ to_line_after_days = 0 ,
1011
1038
$ to_archive_after_days = 0 ,
1012
1039
$ to_deep_archive_after_days = 0 ,
1013
- $ delete_after_days = 0
1040
+ $ delete_after_days = 0 ,
1041
+ $ to_archive_ir_after_days = 0
1014
1042
) {
1015
1043
$ encodedEntry = \Qiniu \entry ($ bucket , $ key );
1016
1044
$ path = '/lifecycle/ ' . $ encodedEntry .
1017
1045
'/toIAAfterDays/ ' . $ to_line_after_days .
1046
+ '/toArchiveIRAfterDays/ ' . $ to_archive_ir_after_days .
1018
1047
'/toArchiveAfterDays/ ' . $ to_archive_after_days .
1019
1048
'/toDeepArchiveAfterDays/ ' . $ to_deep_archive_after_days .
1020
1049
'/deleteAfterDays/ ' . $ delete_after_days ;
@@ -1182,6 +1211,9 @@ public static function buildBatchDeleteAfterDays($bucket, $key_day_pairs)
1182
1211
* @param int $to_line_after_days 多少天后将文件转为低频存储。
1183
1212
* -1 表示取消已设置的转低频存储的生命周期规则;
1184
1213
* 0 表示不修改转低频生命周期规则。
1214
+ * @param int $to_archive_ir_after_days 多少天后将文件转为归档直读。
1215
+ * -1 表示取消已设置的转归档只读的生命周期规则;
1216
+ * 0 表示不修改转归档只读周期规则。
1185
1217
* @param int $to_archive_after_days 多少天后将文件转为归档存储。
1186
1218
* -1 表示取消已设置的转归档存储的生命周期规则;
1187
1219
* 0 表示不修改转归档生命周期规则。
@@ -1200,13 +1232,15 @@ public static function buildBatchSetObjectLifecycle(
1200
1232
$ to_line_after_days ,
1201
1233
$ to_archive_after_days ,
1202
1234
$ to_deep_archive_after_days ,
1203
- $ delete_after_days
1235
+ $ delete_after_days ,
1236
+ $ to_archive_ir_after_days = 0
1204
1237
) {
1205
1238
$ result = array ();
1206
1239
foreach ($ keys as $ key ) {
1207
1240
$ encodedEntry = \Qiniu \entry ($ bucket , $ key );
1208
1241
$ op = '/lifecycle/ ' . $ encodedEntry .
1209
1242
'/toIAAfterDays/ ' . $ to_line_after_days .
1243
+ '/toArchiveIRAfterDays/ ' . $ to_archive_ir_after_days .
1210
1244
'/toArchiveAfterDays/ ' . $ to_archive_after_days .
1211
1245
'/toDeepArchiveAfterDays/ ' . $ to_deep_archive_after_days .
1212
1246
'/deleteAfterDays/ ' . $ delete_after_days ;
0 commit comments