You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
669 B
22 lines
669 B
import { checkBucketName } from '../utils/checkBucketName';
|
|
import { obj2xml } from '../utils/obj2xml';
|
|
|
|
export async function extendBucketWorm(this: any, name: string, wormId: string, days: string | number, options) {
|
|
checkBucketName(name);
|
|
const params = this._bucketRequestParams('POST', name, { wormExtend: '', wormId }, options);
|
|
const paramlXMLObJ = {
|
|
ExtendWormConfiguration: {
|
|
RetentionPeriodInDays: days
|
|
}
|
|
};
|
|
|
|
params.mime = 'xml';
|
|
params.content = obj2xml(paramlXMLObJ, { headers: true });
|
|
params.successStatuses = [200];
|
|
const result = await this.request(params);
|
|
return {
|
|
res: result.res,
|
|
status: result.status
|
|
};
|
|
}
|