Support Questions
Find answers, ask questions, and share your expertise

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

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

View solution in original post

1 REPLY 1

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

View solution in original post