'Returns a list of consoles for this instance.'

@extensions.expected_errors(())
def index(self, req, server_id):

    context = req.environ['nova.context']
    context.can((consoles_policies.POLICY_ROOT % 'index'))
    consoles = self.console_api.get_consoles(req.environ['nova.context'], server_id)
    return dict(consoles=[_translate_keys(console) for console in consoles])
