Support Questions

Find answers, ask questions, and share your expertise

How to delete Ambari User by using the Ambari API

Contributor

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

3 REPLIES 3

Explorer

you can try the following command as root user

curl -i -v -L -u admin:admin -H 'X-Requested-By:ambari' -X DELETE 'http://<ambari-server-host>:8080/api/v1/users'

Super Mentor

Contributor
Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.