'Returns a dict in the format
|   {\'hosts\': [{\'host_name\': \'some.host.name\',
|     \'service\': \'cells\',
|     \'zone\': \'internal\'},
|    {\'host_name\': \'some.other.host.name\',
|     \'service\': \'cells\',
|     \'zone\': \'internal\'},
|    {\'host_name\': \'some.celly.host.name\',
|     \'service\': \'cells\',
|     \'zone\': \'internal\'},
|    {\'host_name\': \'console1.host.com\',
|     \'service\': \'consoleauth\',
|     \'zone\': \'internal\'},
|    {\'host_name\': \'network1.host.com\',
|     \'service\': \'network\',
|     \'zone\': \'internal\'},
|    {\'host_name\': \'network2.host.com\',
|     \'service\': \'network\',
|     \'zone\': \'internal\'},
|    {\'host_name\': \'compute1.host.com\',
|     \'service\': \'compute\',
|     \'zone\': \'nova\'},
|    {\'host_name\': \'compute2.host.com\',
|     \'service\': \'compute\',
|     \'zone\': \'nova\'},
|    {\'host_name\': \'sched1.host.com\',
|     \'service\': \'scheduler\',
|     \'zone\': \'internal\'},
|    {\'host_name\': \'sched2.host.com\',
|     \'service\': \'scheduler\',
|     \'zone\': \'internal\'},
|    {\'host_name\': \'vol1.host.com\',
|     \'service\': \'volume\',
|     \'zone\': \'internal\'}]}'

@wsgi.Controller.api_version('2.1', '2.42')
@extensions.expected_errors(())
def index(self, req):

    context = req.environ['nova.context']
    context.can(hosts_policies.BASE_POLICY_NAME)
    filters = {'disabled': False}
    zone = req.GET.get('zone', None)
    if zone:
        filters['availability_zone'] = zone
    services = self.api.service_get_all(context, filters=filters, set_zones=True, all_cells=True)
    hosts = []
    api_services = ('nova-osapi_compute', 'nova-ec2', 'nova-metadata')
    for service in services:
        if (service.binary not in api_services):
            hosts.append({'host_name': service['host'], 'service': service['topic'], 'zone': service['availability_zone']})
    return {'hosts': hosts}
