Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Add space owner

PUT /spaces/{id}/owners/{uid}

Adds user {uid} as an owner of space {id}. Ownership can only be granted to effective members of the space - if the desired user is not a member, they have to be added to the space first. If the new owner is only an indirect member (via a group), he is automatically added as a direct member when granted ownership.

Space owners are members of the space (users) that have absolute power regarding the space API and files (analogical to "root", but in the scope of one space). Being an owner means that user privileges are essentially ignored and all API operations are allowed.

This operation requires any of the following authentication:

  • as user who is currently an owner of the space ({id}),
  • as user who has oz_spaces_set_privileges admin privilege.

Example cURL requests

Add space space owner

curl -u username:password -H "Content-type: application/json" -X PUT \
https://$HOST/api/v3/onezone/spaces/$SPACE_ID/owners/$USER_ID

Path parameters

Parameter Type & Description
id required
string

Space Id.

uid required
string

User Id.

Request Examples

Shell
onezone-rest-cli addSpaceOwner id=b752ceafabb662b4e5728b2ded25cdd1 uid=a5b469a2b0516b662a49da74d6d7d7bc

Responses

application/json
204

The user was added as an owner of the space.

400

Invalid request.

PropertyType & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
401

Authentication error.

PropertyType & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
403

Authorization error.

PropertyType & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
404

Resource not found.

PropertyType & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
500

Internal server Error.

PropertyType & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}