'Return a list of available DNS domains.'

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

    context = req.environ['nova.context']
    context.can(fid_policies.BASE_POLICY_NAME)
    try:
        domains = self.network_api.get_dns_domains(context)
    except NotImplementedError:
        common.raise_feature_not_supported()
    domainlist = [_create_domain_entry(domain['domain'], domain.get('scope'), domain.get('project'), domain.get('availability_zone')) for domain in domains]
    return _translate_domain_entries_view(domainlist)
