Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Update group privileges to harvester

PATCH /harvesters/{id}/groups/{gid}/privileges

Updates group's ({gid}) privileges in a harvester ({id}).

This operation requires harvester_set_privileges privilege or oz_harvesters_set_privileges admin privilege.

The grant field specifies a list of privileges to be granted. The revoke field specifies a list of privileges to be revoked. At least one of those fields must be given.

Example cURL requests

Update group's privileges in a harvester

curl -u username:password -H "Content-type: application/json" \
-d '{"grant": ["harvester_view", "harvester_update"], "revoke": ["harvester_delete"]}' \
https://$HOST/api/v3/onezone/harvesters/$HARVESTER_ID/groups/$GROUP_ID/privileges

Path parameters

Parameter Type & Description
id required
string

Harvester Id.

gid required
string

Group Id.

Request body

Harvester privileges update request.

PropertyType & Description
grant
array of strings

A list of privileges in the harvester.

revoke
array of strings

A list of privileges in the harvester.

Request Examples

application/json
{
  "grant": [
    "harvester_view",
    "harvester_update",
    "harvester_delete",
    "harvester_view_privileges",
    "harvester_set_privileges"
  ],
  "revoke": [
    "harvester_invite_user",
    "harvester_remove_user",
    "harvester_add_group",
    "harvester_remove_group"
  ]
}

Responses

application/json
204

The privileges have been updated.

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