List Hosts

Back to Resources

Summary

Returns a collection of all hosts for the cluster identified by “:clusterName”.

GET /clusters/:clusterName/hosts

Response

Example

Get the collection of the hosts for the cluster named “c1”.

GET /clusters/c1/hosts

200 OK
{
	"href" : "http://your.ambari.server/api/v1/clusters/c1/hosts/",
	"items" : [
		{
  			"href" : "http://your.ambari.server/api/v1/clusters/c1/hosts/host1",
  			"Hosts" : {
    			"cluster_name" : "c1",
    			"host_name" : "host1"
  			}
		},
		{
  			"href" : "http://your.ambari.server/api/v1/clusters/c1/hosts/host2",
  			"Hosts" : {
    			"cluster_name" : "c1",
    			"host_name" : "host2"
  			}
		}
	]
}