blob: a53d00d77295e8adc057b38865ac05b827dae884 [file] [log] [blame]
Mate Lakat99ee9142012-09-14 12:34:46 +01001from tempest.common.rest_client import RestClient
2import json
3
4
5class HostsClientJSON(RestClient):
6
7 def __init__(self, config, username, password, auth_url, tenant_name=None):
8 super(HostsClientJSON, self).__init__(config, username, password,
9 auth_url, tenant_name)
10 self.service = self.config.compute.catalog_type
11
12 def list_hosts(self):
13 """Lists all hosts"""
14
15 url = 'os-hosts'
16 resp, body = self.get(url)
17 body = json.loads(body)
18 return resp, body['hosts']