Delete files

Delete the specified file.

HTTP
POST $CLOUDSIGMA_API_BASE/catalog/file/delete

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 file ID and the volume ID to which it belongs. Prepare the personal access token, target workspace ID, file ID, and volume ID that can access the target workspace. This action removes the file association and deletes the file irreversibly.

Request body

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/catalog/file/delete" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "'"$FILE_ID"'",
    "volume_id": "'"$VOLUME_ID"'"
  }'

Field

Type

Required

Description

id

string

Yes

File ID.

volume_id

string

Yes

Volume ID to which the file belongs.

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 the deletion is successful, it is fixed to null.

Error response

JSON
{
  "code": "ErrNotFound",
  "msg": "对象不存在"
}

Field

Type

Description

code

string

error code.

msg

string

error message.

Last updated on