Managing user accounts
Every user of an iHub volume has an account on that volume. The REST API can manage user accounts on a volume using the /users resource to create, modify, and delete accounts. Only members of the Administrators user group can use this resource.
The following sections provide an example of using each users resource as a curl command.
GET users
This example requests the list of users whose names begin with the letter m:
GET /ihub/v1/users?search=m* HTTP/1.1
host: myserver.mycompanyname.com:5000
AuthId: <authId>
This curl example requests the list of users whose names begin with the letter m in the default volume:
curl -i http://%RESTHost%:5000/ihub/v1/users?search=m* ‑H "AuthId:%RESTAuthId%"
GET users/{userId}
This example requests the user details for the user with user ID 200000000100:
GET /ihub/v1/users/200000000100 HTTP/1.1
host: myserver.mycompanyname.com:5000
AuthId: <authId>
This curl example requests the user details for the user with user ID 200000000100 in the default volume:
curl -i http://%RESTHost%:5000/ihub/v1/users/200000000100 ‑H "AuthId:%RESTAuthId%"
POST users
This example creates a new user named user1, with a description of "A user account for testing user requests":
POST /ihub/v1/users HTTP/1.1
Host: myserver.mycompanyname.com:5000
Content-Type: application/x-www-form-urlencoded
AuthId: <authId>
 
name=user1&description=A%20user%20account%20for%20testing%20user
%20requests&email=test@mycompanynamehere.com
This curl example sends a POST request to iHub to create the user user1 in the default volume:
curl -i http://%RESTHost%:5000/ihub/v1/users ‑H "AuthId:%RESTAuthId%" ‑d name="user1" ‑d email="test@mycompanynamehere.com" ‑d description="A user account for testing user requests"
PUT users/{userId}
This example changes the description of the user with user ID 200000000100:
PUT /ihub/v1/users/200000000100 HTTP/1.1
Host: myserver.mycompanyname.com:5000
Content-Type: application/x-www-form-urlencoded
AuthId: <authId>
 
description=Senior%20VP%20of%20Worldwide%20Sales
This curl example sends a PUT request to iHub to modify the home folder and description of the user with the user ID 100100000100 in the default volume:
curl -i http://%RESTHost%:5000/ihub/v1/users/100100000100 ‑X PUT ‑H "AuthId:%RESTAuthId%" ‑d description="Senior VP of Worldwide Sales"
DELETE users/{userId}
This example deletes the user with user ID 200000000100:
DELETE /ihub/v1/users/200000000100 HTTP/1.1
Host: myserver.mycompanyname.com:5000
Content-Type: application/json; charset=utf-8
AuthId: <authId>
This curl example sends a DELETE request to iHub to delete the user with user ID 200100000100 in the default volume:
curl -i http://%RESTHost%:5000/ihub/v1/users/200100000100 ‑X DELETE ‑H "AuthId:%RESTAuthId%"
GET users/{userId}/usergroups
This example requests the user groups to which the user with user ID 200000000100 belongs:
GET /ihub/v1/users/200000000100/usergroups HTTP/1.1
host: myserver.mycompanyname.com:5000
AuthId: <authId>
This curl example requests the list of user groups to which the user with the user ID 200000000100 in the default volume belongs:
curl -i http://%RESTHost%:5000/ihub/v1/users/100100000100
/usergroups ‑H "AuthId:%RESTAuthId%"