ambari-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian de la Motte <bdelamo...@zdatainc.com>
Subject Access Ambari API through Service Install Script
Date Sun, 23 Nov 2014 00:48:02 GMT
Hi everyone,

I'm trying to integrate a custom service into Ambari. The problem is the
service's master during installation needs to know about the hosts that are
to be the service's slaves. The only way I was able to find that info was
by using the API.

Is it a good idea to have the master's install script call the API to get
that info or is there an easier way? I think it would work but the script
would need to know the username and password for Ambari's API call.

Is there a way to get the service's slave's hosts without the API or for a
Python script to get the admin username and password from a config in order
to call the API?

The call I would possibly use is something like this:

curl  --user admin:admin
http://127.0.0.1:8080/api/v1/clusters/abc/services/CUST_SERVICE/components/CUST_SERVICE_SLAVE?fields=host_components/HostRoles/host_name


I could parse out the hostnames from this but how do I make this call
without knowing what username and password to use.

Any ideas or alternative methods?

Thank you!

Brian

Mime
View raw message