Get details of authenticated user
GET /user
Returns the details of the user performing the query.
Request Examples
Shell
onepanel-rest-cli getCurrentUser --host https://$PANEL_HOST:9443 -H "x-auth-token: $TOKEN"
Responses
application/json
200
User details.
Property
Type & Description
userId
string
The user Id.
username
string
User's full name (given names + surname).
clusterPrivileges
array of strings
List of cluster privileges held by the user in the current cluster.
Example
application/json
{
"userId": "i3h2bp4TjPVuOyvXulbW",
"username": "admin",
"clusterPrivileges": [
"cluster_update"
]
} 401
Unauthorized request.
403
Forbidden request.
404
Request client is not a Onezone member.
500
Internal server error.
Property
Type & Description
error object (ErrorDetails) Object describing an error.
error
object (ErrorDetails)
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."
}
}