Set file extended attribute
PUT /data/{id}/metadata/xattrs
This method allows to set a value of a given extended file attributes (leaving other ones intact) for a file specified by $FILE_ID.
Example cURL requests
Set extended file attribute
curl -H "X-Auth-Token: $TOKEN" \
-X PUT "https://$HOST/api/v3/oneprovider/data/$FILE_ID/metadata/xattrs" \
-H 'Content-Type: application/json' -d '{ "license": "CC-0" }'
Path parameters
| Parameter | Type & Description |
|---|---|
| id required | string Id of the file. |
Request body
application/json
Extended attribute name and value.
Property
Type & Description
<key>
string
Request Examples
Shell
oneprovider-rest-cli setXattr id=$FILE_ID license==CC-0Responses
application/json
204
File extended 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."
}