'Prior to microversion 2.53 you could search for hypervisors by a
hostname pattern and include servers on those hosts in the response on
a dedicated route. Starting with 2.53, searching by a hostname pattern
and including hosted servers is a query parameter in the
GET /os-hypervisors index and detail methods.'

@wsgi.Controller.api_version('2.1', '2.52')
@extensions.expected_errors(404)
def servers(self, req, id):

    context = req.environ['nova.context']
    context.can(hv_policies.BASE_POLICY_NAME)
    compute_nodes = self._get_compute_nodes_by_name_pattern(context, id)
    hypervisors = []
    for compute_node in compute_nodes:
        try:
            instances = self.host_api.instance_get_all_by_host(context, compute_node.host)
            service = self.host_api.service_get_by_compute_host(context, compute_node.host)
        except exception.HostMappingNotFound as e:
            raise webob.exc.HTTPNotFound(explanation=e.format_message())
        hyp = self._view_hypervisor(compute_node, service, False, req, instances)
        hypervisors.append(hyp)
    return dict(hypervisors=hypervisors)
