Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Adding user to Cloudera Manager using REST API

SOLVED Go to solution
Highlighted

Adding user to Cloudera Manager using REST API

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

Accepted Solutions

Re: Adding user to Cloudera Manager using REST API

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
4 REPLIES 4

Re: Adding user to Cloudera Manager using REST API

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

Re: Adding user to Cloudera Manager using REST API

Explorer
Thanks ..it worked.

Re: Adding user to Cloudera Manager using REST API

Explorer

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

Re: Adding user to Cloudera Manager using REST API

Super 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