get_urls

requests_pelican.get_urls(path, federation=None, *, cache=True, timeout=60, random=False, **kwargs)[source]

Return the list of fully-qualified URLs that serve the given path.

Parameters

pathstr

The Pelican data path, must be a sub-path of the right namespace for this DirectorResponse.

federationstr

The name or URL of the Pelican Federation that contains the path. This is required if path isn’t a valid Pelican URI from which the federation URL can be parsed.

cachebool, str

Whether to use a cached copy of the DirectorResponse for the federation (True or False). If cache="update" is given, query the director again and update the cache with the new response.

timeoutint, optional

The timeout (seconds) after which to abort requests to the Pelican director.

randombool

If True, shuffle the list of URLs before returning.

kwargs

Other keyword arguments are passed to get_director_response.

Returns

urlslist of str

The list of fully-qualified HTTP URLs that should serve the given path.

See Also

DirectorResponse.urls

For details of the URL formatting.