REST API User Management
INFO
Add the following command after the username and password to receive more meaningful HTTP errors:
-w"\n%{http_code}\n"
This command can be added to each call.
REST API Users
View All User Management
Request Method | OPTIONS |
Description | Returns an HTTP response in JSON representation with all information on available REST APIs for user management. Use this representation to understand the different commands you can execute for user management. Each REST API listed contains the path, method, and required parameters. You can use the REST APIs in this representation to change what is returned for the other calls in user management. |
URI Syntax | curl -u '<username>:<password>' -X OPTIONS 'http://<Datameer-serverIP>:<port-number>/rest/user-management?pretty' |
Example Response |
Logged In User Account Information
Request Method | GET |
Description | Returns account information about a specific Datameer X user. |
URI Syntax | curl -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/rest/user-management/logged-in-user?pretty' |
Example Response | { "username": "admin", "email": "admin@localhost", "additionalInformation": "", "enabled": true, "expires": "", "groups": [IT-Dept.], "roles": ["ADMIN"], "capabilities": ["HADOOP_CLUSTER_ACCESS","EXPORTJOB_EDIT"], "internal": false, "lastLoginDate": "", "loginCount": 0 } |
Additional Notes |
Create a User
Request Method | POST |
Description | Creates an internal user in Datameer. |
URI Syntax | curl -u '<username>:<password>' -d '{username:"<user name>", email:"<user's email address>", roles : [<role>]}' -X POST 'http://<Datameer-serverIP>:<port-number>/rest/user-management/users' |
Example Response | { "version": "3.1", "username": "Robert", "email": "Robert@email.com", "enabled": true, "expires": "", "groups": [], "roles": [ "ANALYST" ] } |
Additional Notes | Optional parameter:
Mandatory fields:
Optional fields:
|
Send Notification When Creating a User
Request Method | POST |
Description | Creates a Datameer X user and emails the user a notification the account has been made. |
URI Syntax | curl -u '<username>:<password>' -d '{version:"<version number>", username:"<user name>", email:"<user's email>", roles : [<role>]}' -X POST 'http://<Datameer-serverIP>:<port-number>/rest/user-management/users?notifyPerMail=true' |
Example Response | { "version": "3.1", "username": "RobertSmith", "email": "RobertSmith@email.com", "enabled": true, "expires": "", "groups": [], "roles": [ "ANALYST" ] } |
List All Users
Request Method | GET |
Description | Returns a list of all the users and their information including Datameer X version, user name, email address, active/inactive, expiration date, groups and roles. INFO The information you see is configurable as per 'View all user management'. You can also return the information for a specified user. |
URI Syntax | One user: curl -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/rest/user-management/users/<user name>' First page of (ten) users: curl -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/rest/user-management/users/' To see the next page of users: curl -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/rest/user-management/users?firstResult=11' To increase the number of users per page, change the results value: curl -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/rest/user-management/users?maxResults=50' |
Example Response | One user: { "username": "Frank", "email": "Frank@email.com", "additionalInformation": "", "enabled": true, "expires": "", "groups": [], "roles": ["ANALYST"], "lastLoginDate": "", "loginCount": 0, "datameerVersion":"5.11.0" } All users: |
Update a User
Request Method | PUT |
Description | Updates a Datameer X user's account. |
URI Syntax | curl -u '<username>:<password>'-d '{version:"<version number>", email:"<user's email address>", roles : [<role>]}' -X PUT 'http://<Datameer-serverIP>:<port-number>/rest/user-management/users/<user name>' |
Example Response | { "version": "3.1", "username": "Robert", "email": "RobertSmith@email.com", "enabled": true, "expires": "", "groups": [], "roles": [ "ANALYST" ] } |
Additional Notes | Optional fields:
Not supported fields:
|
Import a User from External Authenticator
Request Method | POST |
Description | Adds a user in Datameer X taken from a 3rd party authenticator. |
URI Syntax | curl -u '<username>:<password>' -d '{username:"<user name>", roles:[<role>]}' -X POST 'http://<Datameer-serverIP>:<port-number>/rest/user-management/users' |
Example Response | { "version": "3.1", "username": "Joel", "email": "Joel@email.com", "enabled": true, "expires": "", "groups": [ "datameer" ], "roles": [ "ANALYST" ] } |
Additional Notes | Mandatory fields:
Optional fields:
Not supported fields:
|
Update a User Imported From an External Authenticator
Request Method | PUT |
Description | Updates a Datameer X user's account who authenticates from a 3rd party authenticator. |
URI Syntax | curl -u '<username>:<password>' -d '{roles : [<role>]}' -X PUT 'http://<Datameer-serverIP>:<port-number>/rest/user-management/users/<user name>' |
Example Response | { "version": "3.1", "username": "Joel", "email": "Joel@email.com", "enabled": true, "expires": "", "groups": [ "datameer" ], "roles": [ "ANALYST" ] } |
Additional Notes | Optional fields:
Not supported fields:
|
Set or Update Password to Existing User
Request Method | PUT |
Description | Sets or updates a user password. |
URI Syntax | curl -u '<username>:<password>'-d '<passowrd>' -X PUT 'http://<Datameer-serverIP>:<port-number>/rest/user-management/password/<user name>' |
Example Response | No confirmation/response. |
Send Notification When Setting or Updating a Password
Request Method | PUT |
Description | Sets or updates a user password. Sends a notification email to the user they password had been updated. |
URI Syntax | curl -u '<username>:<password>'-d '<password>' -X PUT 'http://<Datameer-serverIP>:<port-number>/rest/user-management/password/<user name>?notifyPerMail=true' |
Example Response | No confirmation/response. |
Delete a User
Request Method | DELETE |
Description | Deletes a user from Datameer. |
URI Syntax | curl -u '<username>:<password>' -X DELETE 'http://<Datameer-serverIP>:<port-number>/rest/user-management/users/<user name>' |
Example Response | No confirmation/response. |
REST API Roles
Create a Role
Request Method | POST |
Description | Creates an internal role in Datameer. |
URI Syntax | curl -u '<username>:<password>'-X POST -d"{name:"test",capabilities:[list capabilities]}" 'http://<Datameer-serverIP>:<port-number>/rest/user-management/roles/' |
Example Response | {"name":"test", "capabilities":["USERS_ACCESS","USER_MANAGEMENT_ACCESS","ADMINISTRATION_ACCESS"], "datameerVersion":"6.1.0"} |
Additional Notes |
List All Roles
Request Method | GET |
Description | Returns a list of all the created role names in Datameer. |
URI Syntax | curl -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/rest/user-management/roles' |
Example Response | { "name": "ADMIN" }, { "name": "ANALYST" }, { "name": "App Operator" }, { "name": "News" }, { "name": "Illustrator" }, { "name": "ANALYST2" }, { "name": "ANALYST3" }, { "name": "VARIABLES_EDIT" }, { "name": "VARIABLES_READ" } |
Update a Role
Request Method | PUT |
Description | Updates an internal role in Datameer. |
URI Syntax | curl -u '<username>:<password>'-X PUT -d "{name:"name",capabilities:[capabilties]}" 'http://<Datameer-serverIP>:<port-number>/rest/user-management/roles/<role-name>' |
Example Response | {"name":"tests", "capabilities["WORKBOOK_DOWNLOAD","EXPORTJOB_EXECUTE","EXPORTJOB_ACCESS","IMPORTJOB_ACCESS","WORKBOOK_EXECUTE","SHARE_WITH_FOREIGN_GROUPS_ACCESS","CONNECTION_ACCESS","FOLDER_CREATE","ARCHIVE_PROJECT", "FOLDER_CREATE_IN_HOME","IMPORTJOB_EXECUTE","FILEUPLOAD_EDIT","INFOGRAPHICS_SHARE_PUBLIC","FILE_BROWSER_ACCESS","WORKBOOK_ACCESS","FOLDER_BACKUP","DATALINK_ACCESS","FILEUPLOAD_ACCESS","EXPORTJOB_EDIT", "IMPORTJOB_EDIT","INFOGRAPHICS_ACCESS","SHARE_WITH_OTHERS_ACCESS","CONNECTION_EDIT","IMPORTJOB_DOWNLOAD","WORKBOOK_EDIT","USER_CAN_ACCESS_EVERYTHING","USER_CAN_EDIT_EVERYTHING","DATALINK_EDIT", "FOLDER_RESTORE","INFOGRAPHICS_EDIT"] |
Delete a Role
Request Method | DELETE |
Description | Deletes an internal role in Datameer. |
URI Syntax | curl -u '<username>:<password>'-X DELETE 'http://<Datameer-serverIP>:<port-number>/rest/user-management/roles/<role-name>' |
Example Response | No confirmation/response. |
REST API Groups
Create a Group
Request Method | POST |
Description | Creates an internal group in Datameer. INFO This REST API call is only available if you use an internal authenticator or a mixed-mode authenticator. This call doesn't work if you use LDAP or SAML authentication and the internal authenticator is disabled. |
URI Syntax | curl -u '<username>:<password>'-X POST -d '{name:"group"}' 'http://<Datameer-serverIP>:<port-number>/rest/user-management/groups/' |
Example Response | {"name":"testgroup", "datameerVersion":"10.1.0"} |
List All Groups
Request Method | GET |
Description | Returns a list of all the created group names in Datameer. |
URI Syntax | curl -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/rest/user-management/groups' |
Example Response | { "name": "datameer" }, { "name": "group 1" }, { "name": "group 2" }, { "name": "group 3" }, { "name": "Shark Team" }, { "name": "Special Team" } |
Update a Group
Request Method | PUT |
Description | Updates an internal group in Datameer. INFO This REST API call is only available if you use an internal authenticator or a mixed-mode authenticator. This call doesn't work if you use LDAP or SAML authentication and the internal authenticator is disabled. |
URI Syntax | INFO: If your file name includes curl -u '<username>:<password>'-X PUT -d '{name:"group"}' 'http://<Datameer-serverIP>:<port-number>/rest/user-management/groups/<group-name>' |
Example Response | {"name":"group", "datameerVersion":"10.1.0"} |
Delete a Group
Request Method | DELETE |
Description | Deletes an internal group in Datameer. INFO This REST API call is only available if you use an internal authenticator or a mixed-mode authenticator. This call doesn't work if you use LDAP or SAML authentication and the internal authenticator is disabled. |
URI Syntax | curl -u '<username>:<password>'-X DELETE 'http://<Datameer-serverIP>:<port-number>/rest/user-management/groups/<group-name>' |
Example Response | No confirmation/response. |