Set file attribute
PUT /data/{id}
This method allows to set a value of a regular file attribute for a file specified by $FILE_ID.
Currently only POSIX mode can be changed by sending:
{ "mode": "0777" }
where the POSIX mode is specified in octal notation.
Example cURL requests
Set file POSIX mode
curl -H "X-Auth-Token: $TOKEN" -X PUT "https://$HOST/api/v3/oneprovider/data/$FILE_ID" \
-H 'Content-Type: application/json' -d '{ "mode": "0777" }'
Path parameters
| Parameter | Type & Description |
|---|---|
| id required | string File, directory or space Id |
Request body
application/json
Attribute name and value.
Property
Type & Description
<key>
string
Request Examples
Shell
echo '{"mode": "0777"}' | oneprovider-rest-cli setAttr id=$FILE_ID -Responses
application/json
204
File attributes updated successfuly.
400
Invalid request.
Property
Type & Description
error
string
Identifier representing internal error code.
error_description
string
Detailed error message.
Example
application/json
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
} 403
Forbidden request.
Property
Type & Description
error
string
Identifier representing internal error code.
error_description
string
Detailed error message.
Example
application/json
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
} 404
File not found.
Property
Type & Description
error
string
Identifier representing internal error code.
error_description
string
Detailed error message.
Example
application/json
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
} 500
Internal server error.
Property
Type & Description
error
string
Identifier representing internal error code.
error_description
string
Detailed error message.
Example
application/json
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}