@@ -243,6 +243,7 @@ function deleteAfterDaysReq(mac, config, bucket, key, days, callbackFunc) {
243243 * @param { Object } options - 配置项
244244 * @param { number } options.toIaAfterDays - 多少天后将文件转为低频存储,设置为 -1 表示取消已设置的转低频存储的生命周期规则, 0 表示不修改转低频生命周期规则。
245245 * @param { number } options.toArchiveAfterDays - 多少天后将文件转为归档存储,设置为 -1 表示取消已设置的转归档存储的生命周期规则, 0 表示不修改转归档生命周期规则。
246+ * @param { number } options.toArchiveIRAfterDays - 多少天后将文件转为归档直读存储,设置为 -1 表示取消已设置的转归档直读存储的生命周期规则, 0 表示不修改转归档直读生命周期规则。
246247 * @param { number } options.toDeepArchiveAfterDays - 多少天后将文件转为深度归档存储,设置为 -1 表示取消已设置的转深度归档存储的生命周期规则, 0 表示不修改转深度归档生命周期规则。
247248 * @param { number } options.deleteAfterDays - 多少天后将文件删除,设置为 -1 表示取消已设置的删除存储的生命周期规则, 0 表示不修改删除存储的生命周期规则。
248249 * @param { Object } options.cond - 匹配条件,只有条件匹配才会设置成功
@@ -583,6 +584,7 @@ exports.setObjectLifecycleOp = function (bucket, key, options) {
583584 const encodedEntry = util . encodedEntry ( bucket , key ) ;
584585 let result = '/lifecycle/' + encodedEntry +
585586 '/toIAAfterDays/' + ( options . toIaAfterDays || 0 ) +
587+ '/toArchiveIRAfterDays/' + ( options . toArchiveIRAfterDays || 0 ) +
586588 '/toArchiveAfterDays/' + ( options . toArchiveAfterDays || 0 ) +
587589 '/toDeepArchiveAfterDays/' + ( options . toDeepArchiveAfterDays || 0 ) +
588590 '/deleteAfterDays/' + ( options . deleteAfterDays || 0 ) ;
@@ -750,9 +752,10 @@ BucketManager.prototype.getBucketInfo = function (bucket, callbackFunc) {
750752 * @param { Object } options - 配置项
751753 * @param { string } options.name - 规则名称 bucket 内唯一,长度小于50,不能为空,只能为字母、数字、下划线
752754 * @param { string } options.prefix - 同一个 bucket 里面前缀不能重复
753- * @param { number } options.to_line_after_days - 指定文件上传多少天后转低频存储。指定为0表示不转低频存储,小于0表示上传的文件立即变低频存储
754- * @param { number } options.to_archive_after_days - 指定文件上传多少天后转归档存储。指定为0表示不转归档存储,小于0表示上传的文件立即变归档存储
755- * @param { number } options.to_deep_archive_after_days - 指定文件上传多少天后转深度归档存储。指定为0表示不转深度归档存储,小于0表示上传的文件立即变深度归档存储
755+ * @param { number } options.to_line_after_days - 指定文件上传多少天后转低频存储。指定为0表示不转低频存储
756+ * @param { number } options.to_archive_ir_after_days - 指定文件上传多少天后转归档直读存储。指定为0表示不转归档直读
757+ * @param { number } options.to_archive_after_days - 指定文件上传多少天后转归档存储。指定为0表示不转归档存储
758+ * @param { number } options.to_deep_archive_after_days - 指定文件上传多少天后转深度归档存储。指定为0表示不转深度归档存储
756759 * @param { number } options.delete_after_days - 指定上传文件多少天后删除,指定为0表示不删除,大于0表示多少天后删除
757760 * @param { number } options.history_delete_after_days - 指定文件成为历史版本多少天后删除,指定为0表示不删除,大于0表示多少天后删除
758761 * @param { number } options.history_to_line_after_days - 指定文件成为历史版本多少天后转低频存储。指定为0表示不转低频存储
@@ -764,9 +767,9 @@ BucketManager.prototype.putBucketLifecycleRule = function (bucket, options,
764767 PutBucketLifecycleRule ( this . mac , this . config , bucket , options , callbackFunc ) ;
765768} ;
766769
767- function PutBucketLifecycleRule ( mac , config , bucket , options , callbackFunc ) {
770+ function PutBucketLifecycleRule ( mac , config , bucket , options , callbackFunc ) {
768771 options = options || { } ;
769- var reqParams = {
772+ const reqParams = {
770773 bucket : bucket ,
771774 name : options . name
772775 } ;
@@ -783,6 +786,12 @@ function PutBucketLifecycleRule(mac, config, bucket, options, callbackFunc) {
783786 reqParams . to_line_after_days = 0 ;
784787 }
785788
789+ if ( options . to_archive_ir_after_days ) {
790+ reqParams . to_archive_ir_after_days = options . to_archive_ir_after_days ;
791+ } else {
792+ reqParams . to_archive_ir_after_days = 0 ;
793+ }
794+
786795 if ( options . to_archive_after_days ) {
787796 reqParams . to_archive_after_days = options . to_archive_after_days ;
788797 } else {
@@ -813,9 +822,9 @@ function PutBucketLifecycleRule(mac, config, bucket, options, callbackFunc) {
813822 reqParams . history_to_line_after_days = 0 ;
814823 }
815824
816- var scheme = config . useHttpsDomain ? 'https://' : 'http://' ;
817- var reqSpec = querystring . stringify ( reqParams ) ;
818- var requestURI = scheme + conf . UC_HOST + '/rules/add?' + reqSpec ;
825+ const scheme = config . useHttpsDomain ? 'https://' : 'http://' ;
826+ const reqSpec = querystring . stringify ( reqParams ) ;
827+ const requestURI = scheme + conf . UC_HOST + '/rules/add?' + reqSpec ;
819828 rpc . postWithOptions (
820829 requestURI ,
821830 null ,
@@ -827,17 +836,18 @@ function PutBucketLifecycleRule(mac, config, bucket, options, callbackFunc) {
827836}
828837
829838/** rules/delete 删除 bucket 规则
830- * @param { string } bucket 空间名
831- * @param { string } name: 规则名称 bucket 内唯一,长度小于50,不能为空,只能为字母、数字、下划线
839+ * @param { string } bucket - 空间名
840+ * @param { string } name - 规则名称 bucket 内唯一,长度小于50,不能为空,只能为字母、数字、下划线
841+ * @param { function } callbackFunc - 回调函数
832842 */
833843BucketManager . prototype . deleteBucketLifecycleRule = function ( bucket , name , callbackFunc ) {
834- var reqParams = {
844+ const reqParams = {
835845 bucket : bucket ,
836846 name : name
837847 } ;
838- var scheme = this . config . useHttpsDomain ? 'https://' : 'http://' ;
839- var reqSpec = querystring . stringify ( reqParams ) ;
840- var requestURI = scheme + conf . UC_HOST + '/rules/delete?' + reqSpec ;
848+ const scheme = this . config . useHttpsDomain ? 'https://' : 'http://' ;
849+ const reqSpec = querystring . stringify ( reqParams ) ;
850+ const requestURI = scheme + conf . UC_HOST + '/rules/delete?' + reqSpec ;
841851 rpc . postWithOptions (
842852 requestURI ,
843853 null ,
@@ -854,9 +864,10 @@ BucketManager.prototype.deleteBucketLifecycleRule = function (bucket, name, call
854864 * @param { Object } options - 配置项
855865 * @param { string } options.name - 规则名称 bucket 内唯一,长度小于50,不能为空,只能为字母、数字、下划线:
856866 * @param { string } options.prefix - 同一个 bucket 里面前缀不能重复
857- * @param { number } options.to_line_after_days - 指定文件上传多少天后转低频存储。指定为0表示不转低频存储,小于0表示上传的文件立即变低频存储
858- * @param { number } options.to_archive_after_days - 指定文件上传多少天后转归档存储。指定为0表示不转归档存储,小于0表示上传的文件立即变归档存储
859- * @param { number } options.to_deep_archive_after_days - 指定文件上传多少天后转深度归档存储。指定为0表示不转深度归档存储,小于0表示上传的文件立即变深度归档存储
867+ * @param { number } options.to_line_after_days - 指定文件上传多少天后转低频存储。指定为0表示不转低频存储
868+ * @param { number } options.to_archive_ir_after_days - 指定文件上传多少天后转归档直读存储。指定为0表示不转归档直读存储
869+ * @param { number } options.to_archive_after_days - 指定文件上传多少天后转归档存储。指定为0表示不转归档存储
870+ * @param { number } options.to_deep_archive_after_days - 指定文件上传多少天后转深度归档存储。指定为0表示不转深度归档存储
860871 * @param { number } options.delete_after_days - 指定上传文件多少天后删除,指定为0表示不删除,大于0表示多少天后删除
861872 * @param { number } options.history_delete_after_days - 指定文件成为历史版本多少天后删除,指定为0表示不删除,大于0表示多少天后删除
862873 * @param { number } options.history_to_line_after_days - 指定文件成为历史版本多少天后转低频存储。指定为0表示不转低频存储
@@ -865,7 +876,7 @@ BucketManager.prototype.deleteBucketLifecycleRule = function (bucket, name, call
865876 */
866877BucketManager . prototype . updateBucketLifecycleRule = function ( bucket , options , callbackFunc ) {
867878 options = options || { } ;
868- var reqParams = {
879+ const reqParams = {
869880 bucket : bucket ,
870881 name : options . name
871882 } ;
@@ -878,6 +889,10 @@ BucketManager.prototype.updateBucketLifecycleRule = function (bucket, options, c
878889 reqParams . to_line_after_days = options . to_line_after_days ;
879890 }
880891
892+ if ( options . to_archive_ir_after_days ) {
893+ reqParams . to_archive_ir_after_days = options . to_archive_ir_after_days ;
894+ }
895+
881896 if ( options . to_archive_after_days ) {
882897 reqParams . to_archive_after_days = options . to_archive_after_days ;
883898 }
@@ -898,9 +913,9 @@ BucketManager.prototype.updateBucketLifecycleRule = function (bucket, options, c
898913 reqParams . history_to_line_after_days = options . history_to_line_after_days ;
899914 }
900915
901- var scheme = this . config . useHttpsDomain ? 'https://' : 'http://' ;
902- var reqSpec = querystring . stringify ( reqParams ) ;
903- var requestURI = scheme + conf . UC_HOST + '/rules/update?' + reqSpec ;
916+ const scheme = this . config . useHttpsDomain ? 'https://' : 'http://' ;
917+ const reqSpec = querystring . stringify ( reqParams ) ;
918+ const requestURI = scheme + conf . UC_HOST + '/rules/update?' + reqSpec ;
904919 rpc . postWithOptions (
905920 requestURI ,
906921 null ,
0 commit comments