Mate Lakat | 99ee914 | 2012-09-14 12:34:46 +0100 | [diff] [blame] | 1 | from tempest.common.rest_client import RestClient |
| 2 | import json |
| 3 | |
| 4 | |
| 5 | class 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'] |