'Set API version request based on the request header information.'

def set_api_version_request(self):

    hdr_string = microversion_parse.get_version(self.headers, service_type='compute', legacy_headers=[LEGACY_API_VERSION_REQUEST_HEADER])
    if (hdr_string is None):
        self.api_version_request = api_version.APIVersionRequest(api_version.DEFAULT_API_VERSION)
    elif (hdr_string == 'latest'):
        self.api_version_request = api_version.max_api_version()
    else:
        self.api_version_request = api_version.APIVersionRequest(hdr_string)
        if (not self.api_version_request.matches(api_version.min_api_version(), api_version.max_api_version())):
            raise exception.InvalidGlobalAPIVersion(req_ver=self.api_version_request.get_string(), min_ver=api_version.min_api_version().get_string(), max_ver=api_version.max_api_version().get_string())
