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]
Created 04-03-2017 08:19 AM
Hello Guys,
For automatization processes, i want to remove/delete an existing Ambari User using the Ambari API
The Following command creates just the Error Message: 405 not allowed
+ curl -ik -admin:admin -H 'X-Requested-By: ambari' -X DELETE -d '{"Users/user_name":"user1"}' https://node0.mynet:8443/api/v1/users
HTTP/1.1 405 Method Not Allowed
Strict-Transport-Security: max-age=31536000
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Set-Cookie: AMBARISESSIONID=390k4yb9us9z1f2elr2vq8kxg;Path=/;Secure;HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
User: admin
Allow: HEAD,POST,GET,OPTIONS
Content-Length: 0
Server: Jetty(8.1.19.v20160209)
How can i archive that?
At some Point, while experimenting, i was asked for the password of the user i want to delete, but that sounds unclever.
I am the Admin,i cannot be asked for the users Password. Especially in the use case, where the user left the project or company earlier.
Any Ideas?
best Regards,
Normen
Created 04-03-2017 12:12 PM
Jay, works like a charm. Thanks very much!
Created 04-03-2017 08:25 AM
Try this for deleting "user1"
curl -ik -u admin:admin -H 'X-Requested-By: ambari' -X DELETE https://node0.mynet:8443/api/v1/users/user1
.
You were trying to pass a data "-d '{"Users/user_name":"user1"}'" which is a post data ... that is not right combination with DELETE request for the uri "/api/v1/users/"
.
For adding new users or adding privileges please refer to
https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=55152242
Created 04-03-2017 12:12 PM
Jay, works like a charm. Thanks very much!
Created 04-03-2017 01:17 PM
Created 04-03-2017 01:25 PM
Created 04-03-2017 01:33 PM
Then i have no clue how to make this whole thread "Answered or Accepted". The only thing i got here is a wee gear in the right upper corner and there is just "report". Your answer i can only "share" or "Reward user",
not accept or answered. Can you point me to the Field, Link or whatever i need to click?
Thanks,
Normen
Created 10-06-2020 10:46 AM
Following KB can be used to delete users/groups in bulk