'Prior to microversion 2.53 you could search for hypervisors by a
hostname pattern on a dedicated route. Starting with 2.53, searching
by a hostname pattern 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 search(self, req, id):

    context = req.environ['nova.context']
    context.can(hv_policies.BASE_POLICY_NAME)
    hypervisors = self._get_compute_nodes_by_name_pattern(context, id)
    try:
        return dict(hypervisors=[self._view_hypervisor(hyp, self.host_api.service_get_by_compute_host(context, hyp.host), False, req) for hyp in hypervisors])
    except exception.HostMappingNotFound:
        msg = (_("No    hypervisor    matching    '%s'    could    be    found.") % id)
        raise webob.exc.HTTPNotFound(explanation=msg)
