Add user to cluster
Adds user {uid} as member of cluster {id}. Optionally, privileges can be passed in the request body, otherwise default privileges will be set for the user in this cluster.
This operation can only be invoked by the user {uid} to add himself to the
cluster (if he is not a member already) and requires cluster_add_user
privilege in the cluster. If privileges are specified in the request,
cluster_set_privileges privilege is also required.
Administrators having the oz_clusters_add_relationships and
oz_users_add_relationships admin privileges can add any user to any cluster,
though oz_clusters_set_privileges privilege is required if privileges are
specified in the request.
Example cURL requests
Add user to cluster
curl -u username:password -H "Content-type: application/json" -X PUT \
https://$ZONE_HOST/api/v3/onezone/clusters/$CLUSTER_ID/users/$USER_ID
Path parameters
| Parameter | Type & Description |
|---|---|
| id required | string Cluster Id. |
| uid required | string User Id. |
Request body
A list of privileges in the cluster.
Request Examples
onezone-rest-cli addClusterUser id=b752ceafabb662b4e5728b2ded25cdd1 uid=a5b469a2b0516b662a49da74d6d7d7bcResponses
The user was added to the cluster.
Invalid request.
error object Object describing an error.
Object describing an error.
String identifying the error type. Does not change between error instances.
Human readable error description. May contain information specific to given error instance.
Details about the error instance. The object schema is specific to each error type.
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Authentication error.
error object Object describing an error.
Object describing an error.
String identifying the error type. Does not change between error instances.
Human readable error description. May contain information specific to given error instance.
Details about the error instance. The object schema is specific to each error type.
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Authorization error.
error object Object describing an error.
Object describing an error.
String identifying the error type. Does not change between error instances.
Human readable error description. May contain information specific to given error instance.
Details about the error instance. The object schema is specific to each error type.
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Resource not found.
error object Object describing an error.
Object describing an error.
String identifying the error type. Does not change between error instances.
Human readable error description. May contain information specific to given error instance.
Details about the error instance. The object schema is specific to each error type.
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Internal server Error.
error object Object describing an error.
Object describing an error.
String identifying the error type. Does not change between error instances.
Human readable error description. May contain information specific to given error instance.
Details about the error instance. The object schema is specific to each error type.
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}