Update file¶
This interface preserves the request shape for file updates, but the current implementation does not persist changes to name. Please do not interpret a successful response as indicating that the file name has been updated.
POST $CLOUDSIGMA_API_BASE/catalog/file/update
Before you call this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
First query the file list to obtain the target file ID.
Set the operation-specific values used in the request:
$FILE_ID: File ID used to locate files and perform permission verification.
Request¶
curl -X POST "$CLOUDSIGMA_API_BASE/catalog/file/update" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"file_id": "'"$FILE_ID"'",
"name": "<FILE_NAME>"
}'
Request body
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The file ID used to locate the file and perform permission verification. |
|
string |
No |
The name of the file to be updated; the current implementation does not save this value. |
Successful response¶
Returns 200 on success, data is null. The current implementation returns successfully but does not change the file name or other file attributes.
{
"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 |
|---|---|---|---|
|
|
The request body is not valid JSON. |
Check JSON format. |
|
|
The current identity does not have write permissions on the root volume to which it belongs. |
Use credentials with write access, or contact your administrator for authorization. |
|
|
The server failed to process the request. |
Record the request time and error message and try again; if it continues to fail, contact support. |
Follow-up operations¶
Use the same resource identifier Query file details to confirm the update result.