DirectorResponse

class requests_pelican.DirectorResponse(federation, namespace, auth=<factory>, token_generation=<factory>, links=<factory>)[source]

Bases: object

Information for a Pelican namespace.

As returned by the director endpoint for a path in the namespace.

Methods Summary

from_response(federation, response)

Build a new DirectorResponse from a requests.Response.

urls(path, *[, random])

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

Methods Documentation

classmethod from_response(federation, response)[source]

Build a new DirectorResponse from a requests.Response.

Parameters

federationstr

The URL of the Pelican federation.

responserequests.Response

The HTTP response to parse.

Returns

dirrespDirectorResponse

The formatter response from the Pelican director.

urls(path, *, random=False)[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.

randombool

If True, shuffle the list of URLs before returning.

Returns

urlslist of str

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