CDNetworks Documentation Object Storage API Set File Retention Period

Set File Retention Period

Last update:2022-10-14 15:24:34

Set file retention period

Description

This interface allows users to set the retention period of files, and files that exceed the set number of days are automatically deleted.

Note: Files cannot be recovered after deletion, please operate with caution.

Request Description

 POST /setdeadline
 Host: <MgrDomain>
 Authorization:<AccessToken>
 
 <requestParam>

Header Description

Parameter Required Description
Host Yes Management domain name , which can be obtained in the user management interface
Authorization Yes Manage Credentials

Parameter Description

Request parameters are organized in the following format and submitted as request content:

bucket=<Urlsafe_Base64_Encoded_Bucket>&key=<Urlsafe_Base64_Encoded_Key>&deadline=<deadline>&relevance=<relevance>
Parameter Required Description
bucket Yes space name.
key Yes file name.
deadline Yes File retention period. Files that have been saved for more than a few days are automatically deleted, unit: days. For example: 1, 2, 3… Note: 0 means delete as soon as possible, -1 means cancel the expiration time and save it permanently.
relevance no Whether to set the storage period of the TS file in association with the operation of the m3u8 file. 0 Does not make a link setting. 1 Association settings. Note: 1. If this parameter is not set, the default is associated operation. If it is a non-m3u8 file, this parameter does not take effect . 2. It only takes effect for the file whose TS access path is a relative path in the m3u8 file format. If the TS address is an absolute path, the TS file will not be associated with settings. Please operate with caution 3. For TS The file is in the m3u8 file format with an absolute path. It is recommended to parse the content of the m3u8 file and operate the TS file separately before processing the m3u8 file.

Response Description

Returns a JSONstring with the following content:

{
    "code":     "<code string>",
    "message":   "<message string>"
}
Field name Required Description
code Yes For HTTP request response codes, see HTTP Response Status Codes .
message Yes Request prompt information. OK means success.

Example

curl -v -X POST -d"bucket=aW1hZ2Vz&key=bGVodS5tcDQ==&deadline=1" -H "Authorization:86622e227a50d49d858c2494a935bc2e4ac543a7:Y2JmMGY0YTNhZmQxZmVlZGM2ZTA0YTdjNTcyOWQ1NjRkNTExYjg0Yg==" --url "http://mgrDomain/setdeadline"
Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!