blob: dc3c5241e2f3fd536c096aed2e73a44fcfa5bf03 [file] [log] [blame]
Mate Lakat99ee9142012-09-14 12:34:46 +01001import json
2
Matthew Treinisha83a16e2012-12-07 13:44:02 -05003from tempest.common.rest_client import RestClient
4
Mate Lakat99ee9142012-09-14 12:34:46 +01005
6class HostsClientJSON(RestClient):
7
8 def __init__(self, config, username, password, auth_url, tenant_name=None):
9 super(HostsClientJSON, self).__init__(config, username, password,
10 auth_url, tenant_name)
11 self.service = self.config.compute.catalog_type
12
13 def list_hosts(self):
Sean Daguef237ccb2013-01-04 15:19:14 -050014 """Lists all hosts."""
Mate Lakat99ee9142012-09-14 12:34:46 +010015
16 url = 'os-hosts'
17 resp, body = self.get(url)
18 body = json.loads(body)
19 return resp, body['hosts']