THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
Note |
---|
This feature is still not available in the trunk as of Sept-5-2013.And will be available soonavailable from 1.4.1. |
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
client = AmbariClient("localhost", 8080, "admin", "admin", version=1) print client.version print client.host_url print"\n" |
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
mycluster = client.get_cluster('test46') print mycluster print mycluster.to_json_dict() print"\n" |
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
host1 = mycluster.get_host('hostname') print host1 s4 = host1.assign_role("ZOOKEEPER_SERVER") print s4 host1 = mycluster.get_host('r01wn02') print host1 s4 = host1.assign_role("ZOOKEEPER_SERVER") print s4 host1 = mycluster.get_host('r01wn03') print host1 s4 = host1.assign_role("ZOOKEEPER_SERVER") print s4 host1 = mycluster.get_host('r01wn03') print host1 s4 = host1.assign_role("ZOOKEEPER_CLIENT") print s4 |
...