Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Set file extended attribute

PUT /data/{id}/metadata/xattrs

This method allows to set a value of a specified extended file attribute leaving other ones intact.

To lookup file Id using file path, please use this endpoint.

Example cURL requests

Set extended file attribute

curl -X PUT -H "X-Auth-Token: $TOKEN" \
-H 'Content-type: application/json' -d '{ "license": "CC-0" }' \
"https://$HOST/api/v3/oneprovider/data/$FILE_ID/metadata/xattrs"

Path parameters

Parameter Type & Description
id required
string

Id of the file.

Request body

application/json

Extended attribute name and value.

No schema provided.

Request Examples

Shell
oneprovider-rest-cli setXattr id=$FILE_ID license==CC-0

Responses

application/json
204

File extended attributes updated successfuly.

400

Invalid request.

PropertyType & 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.

PropertyType & 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.

PropertyType & 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.

PropertyType & 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."
}