You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

This feature is still not available in the trunk as of Sept-5-2013.And will be available soon.

1. get the client object
client = AmbariClient("localhost", 8080, "admin", "admin", version=1)
print client.version
print client.host_url
print"\n"
2. get the clusterModel object of cluster
mycluster = client.get_cluster('test46')
print mycluster
print mycluster.to_json_dict()
print"\n"
3. create service
s2 = mycluster.create_service(services_name)
print s2
4. add config
TODO
5. add service components
s2 = mycluster.create_service_components("1.3.0", "HDFS")
6. add host components
host1 = mycluster.get_host('hostname1')
print host1
s4 = host1.assign_role("NAMENODE")
print s4
7. Install & Start the service
s2.stop()
s2.start()

TODO....needs to be updated

  • No labels