Clear the folder

Clear the contents of the specified folder and its subfolders. This operation will delete files and subfolders. Please confirm the target folder before executing.

HTTP
POST $CLOUDSIGMA_API_BASE/catalog/folder/clean

Before you call

Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. First query the file list to obtain the target folder ID. Prepare the personal access token, target workspace ID, and folder ID that can access the target workspace. The caller needs write access to the root volume.

Request body

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/catalog/folder/clean" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "id": '"$FOLDER_ID"'
  }'

Field

Type

Required

Description

id

integer

Yes

Folder ID.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": null
}

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data

null

When cleared successfully, it is fixed to null.

Error response

JSON
{
  "code": "ErrReadonly",
  "msg": "对象不可写"
}

Field

Type

Description

code

string

error code.

msg

string

error message.

Last updated on