THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
Amabri python client can be used make use of Ambari APIs.
The first step is to get the Ambari client
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
from ambari_client.ambari_api import AmbariClient |
...
client = AmbariClient("localhost", 8080, "admin", "admin", version=1) |
...
print client.version |
...
print client.host_url |
...
print"\n" |
...
Some useful methods
Code Block language python title s
######################################
- High level
######################################all_clusters = client.get_all_clusters()
print all_clusters.to_json_dict()
print all_clusters
Code Block language python title Show all hosts in Amabri firstline 1 linenumbers true all_hosts = client.get_all_hosts()
...
print all_hosts
...
print all_hosts.to_json_dict()
...
print"\n"
######################################
...