'Validates that the id is a uuid for microversions that require it.
:param req: The HTTP request object which contains the requested
microversion information.
:param hypervisor_id: The provided hypervisor id.
:raises: webob.exc.HTTPBadRequest if the requested microversion is
greater than or equal to 2.53 and the id is not a uuid.
:raises: webob.exc.HTTPNotFound if the requested microversion is
less than 2.53 and the id is not an integer.'

@staticmethod
def _validate_id(req, hypervisor_id):

    expect_uuid = api_version_request.is_supported(req, min_version=UUID_FOR_ID_MIN_VERSION)
    if expect_uuid:
        if (not uuidutils.is_uuid_like(hypervisor_id)):
            msg = (_('Invalid    uuid    %s') % hypervisor_id)
            raise webob.exc.HTTPBadRequest(explanation=msg)
    else:
        if (cells_utils.CELL_ITEM_SEP in str(hypervisor_id)):
            hypervisor_id = cells_utils.split_cell_and_item(hypervisor_id)[1]
        try:
            utils.validate_integer(hypervisor_id, 'id')
        except exception.InvalidInput:
            msg = (_("Hypervisor    with    ID    '%s'    could    not    be    found.") % hypervisor_id)
            raise webob.exc.HTTPNotFound(explanation=msg)
