CDNetworks Documentation Object Storage API Delete Resource by Prefix

Delete Resource by Prefix

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

Delete Resources by prefix

Description

This interface provides to delete resources matching the specified prefix.

Note: 1. Files cannot be recovered after deletion, please operate with caution. 2. If deleting the m3u8 file will not delete the ts file at the same time, if you need to delete it in association, you can use the delete m3u8 file interface .

Request Description

POST /fmgr/deletePrefix
HOST: <MgrDomain>
Authorization:<accessToken>

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:

fops=bucket/<Urlsafe_Base64_Encoded_bucket>/prefix/<Urlsafe_Base64_Encoded_prefix>/output/<Urlsafe_Base64_Encoded_output>&notifyURL=<Urlsafe_Base64_Encoded_notifyUrl>&separate=<Separate>
Parameter Required Description
fops Yes The processing parameter list, the format is as Descriptiond above, and multiple processing requests are supported at the same time. The parameter lists are separated by ;. Note: When the specified resource does not exist, the returned result is “deletion successful”.
bucket Yes Specify storage space. <Urlsafe_Base64_Encoded_bucket> is the URL-safe Base64-encoded string for the specified bucket name.
prefix Yes The specified prefix, that is, the directory name <Urlsafe_Base64_Encoded_prefix> is a string that is URL-safe Base64-encoded for the specified prefix. Note: Fuzzy matching is not supported. If the specified prefix is test, the resource whose key prefix is test123 will not be deleted.
output no Save the Description information of the task processing result to the specified file, which is not saved by default. The format is: :. <Urlsafe_Base64_Encoded_output> is the URL-safe Base64-encoded string for the specified output. Note: If the output specified by multiple operations is the same, the old output will be overwritten by the new output.
notifyURL no The processing result is notified of the receiving URL. For the format of the notification content, see the returned content of the task query interface .
separate no Whether processing Description are notified separately. Set 1 and 0 as option codes: 1: Indicates that notifyURL is notified after each command is executed. 0: Indicates that notifyURL is notified once after all commands are executed . The default value is 0.

Note: After specifying output, the output file records the following information line by line: (Separate each field with a tab).

<code>  <desc>  <bucket>    <Urlsafe_Base64_Encoded_key>    <Id>
Field name Description
id The task process ID, that is, the persistentId of the interface response.
code Task status code: 0 success, 1 failure.
desc The Description corresponding to the status code.
bucket space name.
Urlsafe_Base64_Encoded_key A URL-safe Base64-encoded string for the resource’s key.

fops parameter example

fops=bucket/bXlidWNrZXQ=/prefix/YWFjLw==;bucket/bXlidWNrZXQ=/prefix/YWFiLw==&notifyURL=aHR0cDovL3Rlc3QuY29tL25vdGlmeVVSbA==&separate=1

Response Description

If the request is successful, a Jsonstring with the following content is returned:

{ "persistentId": <persistentId> }
Field name Required Description
persistentId Yes The task process ID, which can be used to query the task progress.

If the request fails, a Jsonstring with the following content is returned:

{
    "code":     "<code string>",
    "message":  "<ErrMsg string>"
}
field name Required Description
code Yes HTTP request response code, see HTTP response status code
message Yes Request failed message

Example

curl -v -X POST -d "fops=bucket/bXlidWNrZXQ=/prefix/YWFjLw==;bucket/bXlidWNrZXQ=/key/bXlkaXIvYWFi&notifyURL=aHR0cDovL3Rlc3QuY29tL25vdGlmeVVSbA==&separate=1" -H "Authorization:86622e227a50d49d858c2494a935bc2e4ac543a7:Y2JmMGY0YTNhZmQxZmVlZGM2ZTA0YTdjNTcyOWQ1NjRkNTExYjg0Yg==" --url "http://mgrDomain/fmgr/deletePrefix"
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!