Dereference file¶
Dereference a set of files. All files must belong to the same root volume.
POST https://moi.matrixorigin.cn/newmoi/catalog/file/delete_ref
Preparation before calling¶
First query the file list to obtain the file ID to be dereferenced. Prepare the personal access token, target workspace ID, and file ID that have access to the target workspace.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed throughX-Workspace-IDHeader.$FILE_ID: The file ID to be dereferenced.
All files must belong to the same root volume.
Request example¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/catalog/file/delete_ref" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"file_ids": ["'"$FILE_ID"'"]
}'
Request body¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
array[string] |
Yes |
One or more file IDs to dereference. |
|
integer |
No |
The declaration must be consistent with the resolved root volume. |
Successful response¶
Returns 200 on success, data is null. This operation disassociates the file from the volume and does not mean deleting the file itself.
{
"code": "OK",
"msg": "OK",
"data": null
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
null |
Fixed to |
Error response¶
{
"code": "ErrParamInvalid",
"msg": "文件必须属于同一根卷",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
|
Pass in a valid file ID from the same root volume. |
|
|
The current identity does not have write permissions to the root volume. |
Use credentials with write access, or contact your administrator for authorization. |
|
|
A file does not exist. |
Check all file IDs. |
|
|
The destination volume is not writable. |
Select a writable volume. |
|
|
The service cannot disassociate the file. |
Record the request time and error message and try again; if it continues to fail, contact support. |
Follow-up operations¶
After completion, Query Catalog details confirms the result.