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.

Using the Ambari API to enable Demo LDAP in Knox

Solved Go to solution

Using the Ambari API to enable Demo LDAP in Knox

New Contributor

In the Ambari GUI, I can enable and disable the Demo LDAP under service actions on the Knox page.

8300-screen-shot-2016-10-05-at-41238-pm.png

I am wonder if it is enable to enable / disable the Demo LDAP using the Ambari API <ambri-ip>:8080/api/v1/clusters/:clustername/

If it is, what is the endpoint?

Changing category as this is more of an Ambari related question

Thanks,

Eric

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Using the Ambari API to enable Demo LDAP in Knox

Contributor

@Eric Krenz

Try this one to start Demo LDAP

curl -i -uadmin:admin -H 'X-Requested-By: ambari' -X POST -d '{"RequestInfo":{"context":"Start Demo LDAP","command":"STARTDEMOLDAP"},"Requests/resource_filters":[{"service_name":"KNOX","component_name":"KNOX_GATEWAY","hosts":"$knox_gateway_hostname"}]}' http://$ambari_server:8080/api/v1/clusters/$cluster_name/requests

To stop Demo LDAP

curl -i -uadmin:admin -H 'X-Requested-By: ambari' -X POST -d '{"RequestInfo":{"context":"Stop Demo LDAP","command":"STOPDEMOLDAP"},"Requests/resource_filters":[{"service_name":"KNOX","component_name":"KNOX_GATEWAY","hosts":"$knox_gateway_hostname"}]}' http://$ambari_server:8080/api/v1/clusters/$cluster_name/requests
1 REPLY 1
Highlighted

Re: Using the Ambari API to enable Demo LDAP in Knox

Contributor

@Eric Krenz

Try this one to start Demo LDAP

curl -i -uadmin:admin -H 'X-Requested-By: ambari' -X POST -d '{"RequestInfo":{"context":"Start Demo LDAP","command":"STARTDEMOLDAP"},"Requests/resource_filters":[{"service_name":"KNOX","component_name":"KNOX_GATEWAY","hosts":"$knox_gateway_hostname"}]}' http://$ambari_server:8080/api/v1/clusters/$cluster_name/requests

To stop Demo LDAP

curl -i -uadmin:admin -H 'X-Requested-By: ambari' -X POST -d '{"RequestInfo":{"context":"Stop Demo LDAP","command":"STOPDEMOLDAP"},"Requests/resource_filters":[{"service_name":"KNOX","component_name":"KNOX_GATEWAY","hosts":"$knox_gateway_hostname"}]}' http://$ambari_server:8080/api/v1/clusters/$cluster_name/requests