Delete files¶
Delete the specified file.
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¶
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 |
|---|---|---|---|
|
string |
Yes |
File ID. |
|
string |
Yes |
Volume ID to which the file belongs. |
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": null
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
null |
When the deletion is successful, it is fixed to |
Error response¶
{
"code": "ErrNotFound",
"msg": "对象不存在"
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
error message. |