Mate Lakat | 99ee914 | 2012-09-14 12:34:46 +0100 | [diff] [blame] | 1 | import json |
| 2 | |
Matthew Treinish | a83a16e | 2012-12-07 13:44:02 -0500 | [diff] [blame] | 3 | from tempest.common.rest_client import RestClient |
| 4 | |
Mate Lakat | 99ee914 | 2012-09-14 12:34:46 +0100 | [diff] [blame] | 5 | |
| 6 | class 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 Dague | f237ccb | 2013-01-04 15:19:14 -0500 | [diff] [blame] | 14 | """Lists all hosts.""" |
Mate Lakat | 99ee914 | 2012-09-14 12:34:46 +0100 | [diff] [blame] | 15 | |
| 16 | url = 'os-hosts' |
| 17 | resp, body = self.get(url) |
| 18 | body = json.loads(body) |
| 19 | return resp, body['hosts'] |