blob: 517e230918563f784609394b427cfa4346b4c35f [file] [log] [blame]
import json
from tempest.common.rest_client import RestClient
class HostsClientJSON(RestClient):
def __init__(self, config, username, password, auth_url, tenant_name=None):
super(HostsClientJSON, self).__init__(config, username, password,
auth_url, tenant_name)
self.service = self.config.compute.catalog_type
def list_hosts(self):
"""Lists all hosts"""
url = 'os-hosts'
resp, body = self.get(url)
body = json.loads(body)
return resp, body['hosts']