Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

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 -X PUT -H "X-Auth-Token: $TOKEN" \
-H 'Content-type: application/json' -d '{ "mode": "0777" }'
"https://$HOST/api/v3/oneprovider/data/$FILE_ID"

Path parameters

Parameter Type & Description
id required
string

File, directory or space Id

Request body

application/json

Attribute name and value.

No schema provided.

Request Examples

Shell
echo '{"mode": "0777"}' | oneprovider-rest-cli setAttr id=$FILE_ID -

Responses

application/json
204

File 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."
}