Created 05-22-2018 02:24 PM
we want to know if service exist in ambari cluster by API
is any way to know that? by API
for example - we want to know if KAFKA service exsist in ambari cluster
Created 05-22-2018 07:25 PM
@Michael Bronson Perhaps you can use services rest api to check like this:
curl -iv -u admin -X GET http://AMBARI_HOST:8080/api/v1/clusters/CLUSTER_NAME/services/KAFKA
If service is not installed you will received a response indicating resource does not exist.
HTH
*** If you found this answer addressed your question, please take a moment to login and click the "accept" link on the answer.
Created 05-22-2018 06:02 PM
Following call we do, if kafka does not exist you will get status 404.
curl --user admin -sS -G "http://ambari_server_here/api/v1/clusters/CLUSTERNAME_HERE/services/KAFKA"
API resource:
https://github.com/apache/ambari/blob/trunk/ambari-server/docs/api/v1/index.md
Created 05-22-2018 06:10 PM
this API withpout passord ?
Created 05-22-2018 06:17 PM
how to add the password - admin in the API?
Created 05-22-2018 07:25 PM
@Michael Bronson Perhaps you can use services rest api to check like this:
curl -iv -u admin -X GET http://AMBARI_HOST:8080/api/v1/clusters/CLUSTER_NAME/services/KAFKA
If service is not installed you will received a response indicating resource does not exist.
HTH
*** If you found this answer addressed your question, please take a moment to login and click the "accept" link on the answer.
Created 05-22-2018 07:31 PM
@Michael Bronson For the password you need to send the basic authorization header like this
-H 'Authorization: Basic XXXXXXX'
Following link shows how to create the header using most popular languages:
https://gist.github.com/brandonmwest/a2632d0a65088a20c00a
HTH