Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Add group to space

PUT /spaces/{id}/groups/{gid}

Adds group {gid} as member of space {id}. Optional privileges can be passed in the request body, otherwise default privileges will be set for the group in this space.

This operation requires space_add_group privilege in the space and group_add_space privilege in the group. If privileges are specified in the request, space_set_privileges privilege is also required.

For administrator who does not belong to the group / space, oz_groups_add_relationships and oz_spaces_add_relationships privileges are required, and oz_spaces_set_privileges if privileges are specified in the request.

Example cURL requests

Add group to space

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

Path parameters

Parameter Type & Description
id required
string

Space Id.

gid required
string

Group Id.

Request body

application/json
PropertyType & Description
privileges
array of strings

A list of privileges in the space.

Request Examples

Shell
onezone-rest-cli addGroupToSpace id=b752ceafabb662b4e5728b2ded25cdd1 gid=f1c8b1a37aa7447b22eb65a742d40524

Responses

application/json
204

The group was added to 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."
  }
}