Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Update user's cluster privileges

PATCH /clusters/{id}/users/{uid}/privileges

Updates user's ({uid}) privileges in a cluster ({id}).

This operation requires cluster_set_privileges privilege. For administrators who do not have to be members of this cluster, oz_clusters_set_privileges privilege is required.

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 user's privileges in a cluster

curl -u admin:password -X PATCH -H "Content-type: application/json" \
-d '{"grant": ["cluster_view", "cluster_update"], "revoke": ["cluster_delete"]}' \
https://$HOST/api/v3/onezone/clusters/$CLUSTER_ID/users/$USER_ID/privileges

Path parameters

Parameter Type & Description
id required
string

Cluster Id.

uid required
string

User Id.

Request body

Cluster privileges update request.

PropertyType & Description
grant
array of strings

A list of privileges in the cluster.

revoke
array of strings

A list of privileges in the cluster.

Request Examples

application/json
{
  "grant": [
    "cluster_view",
    "cluster_view_privileges",
    "cluster_add_user",
    "cluster_add_group"
  ],
  "revoke": [
    "cluster_update",
    "cluster_delete",
    "cluster_set_privileges",
    "cluster_remove_user",
    "cluster_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."
  }
}