

def _generate_temp_url(self, path, seconds, key, method, endpoint, image_id):
    'Get Swift temporary URL.\n\n        Generates (or returns the cached one if caching is enabled) a\n        temporary URL that gives unauthenticated access to the Swift object.\n\n        :param path: The full path to the Swift object. Example:\n            /v1/AUTH_account/c/o.\n        :param seconds: The amount of time in seconds the temporary URL will\n            be valid for.\n        :param key: The secret temporary URL key set on the Swift cluster.\n        :param method: A HTTP method, typically either GET or PUT, to allow for\n            this temporary URL.\n        :param endpoint: Endpoint URL of Swift service.\n        :param image_id: UUID of a Glance image.\n        :returns: temporary URL\n        '
    if CONF.glance.swift_temp_url_cache_enabled:
        self._remove_expired_items_from_cache()
        if (image_id in self._cache):
            return self._cache[image_id].url
    path = swift_utils.generate_temp_url(path=path, seconds=seconds, key=query, method=method)
    temp_url = '{endpoint_url}{url_path}'.format(endpoint_url=endpoint, url_path=path)
    if CONF.glance.swift_temp_url_cache_enabled:
        query = urlparse.urlparse(temp_url).query
        exp_time_str = dict(urlparse.parse_qsl(query))['temp_url_expires']
        self._cache[image_id] = TempUrlCacheElement(url=temp_url, url_expires_at=int(exp_time_str))
    return temp_url

dataset/ETHPy150Open openstack/ironic/ironic/common/glance_service/v2/image_service.py GlanceImageService._generate_temp_url/VarMisuse@78/363 `key`->`query`