Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Adding user to Cloudera Manager using REST API

avatar
Explorer

Hi,

 

Please help me if any one tried adding new user to cloudera Manager using REST API calls ?

 

I heard the option  /api/v10/users/userList has some option , please let me know if anyone tried this option ?

 

Regards,

Sijeesh

1 ACCEPTED SOLUTION

avatar
Champion
I just tried it. It is just a POST to the /api/v10/users endpoint.

curl -u uname:passw -H "Content-Type: application/json" -X POST -d '{ "items" : [ { "name" : "matt", "password" : "test" } ] }' http://cm_host:7180/api/v15/users

View solution in original post

4 REPLIES 4

avatar
Champion
I just tried it. It is just a POST to the /api/v10/users endpoint.

curl -u uname:passw -H "Content-Type: application/json" -X POST -d '{ "items" : [ { "name" : "matt", "password" : "test" } ] }' http://cm_host:7180/api/v15/users

avatar
Explorer
Thanks ..it worked.

avatar
Explorer

what is the parameter to give full admin access to specific user using this API

avatar
Master Guru

@VuSand3259,

 

 

You can use this endpoint:

 

https://cloudera.github.io/cm_api/apidocs/v19/path__users_-userName-.html

 

using the PUT method via REST API allows you to update the user object defined here:

 

https://cloudera.github.io/cm_api/apidocs/v19/ns0_apiUser.html

 

For example, the following would make an existing user "mytestuser" a full administrator in CM 5.15 (you would need to use the api version that is right for your CM version):

 

curl -u cm_user:cm_pass -H "Content-Type: application/json" -X PUT -d '{"roles" : [ "ROLE_ADMIN"]}' http://cm_host:7180/api/v19/users/mytestuser