Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Using the Ambari API to enable Demo LDAP in Knox

avatar
New Member

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

avatar
Rising Star

@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

avatar
Rising Star

@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