Part of lp.services.librarian.interfaces.client View In Hierarchy
Known subclasses: lp.services.librarian.interfaces.client.ILibrarianClient
Method | getURLForAlias | Returns the URL to the given file. |
Method | getURLForAliasObject | Returns the URL to a given LibraryFileAlias object. |
Method | getFileByAlias | Returns a file-like object to read the file contents from. |
Parameters | aliasID | The LibraryFileAlias for the file to get. A DB lookup will be done for this - if many are to be calculated, eagar loading is recommended. |
secure | If False, generate an http url on the main librarian domain. If True, generate an https url on a subdomain i$aliasID.restricted.$main_librarian_domain. Note that when a secure URL is generated, a TimeLimitedToken must separately be obtained and combined with the URL to use it. |
LibraryFileAlias
object.
Use this with care. Do not pass the LibraryFileAlias
object
across process or thread boundaries. If you need to pass a
LibraryFileAlias
across a boundary, pass alias.id and use
getURLForAlias
instead.
Parameters | aliasID | The alias ID identifying the file. |
timeout | The number of seconds the method retries to open a connection to the Librarian server. If the connection cannot be established in the given time, a LibrarianServerError is raised. | |
Returns | A file-like object to read the file contents from. | |
Raises | DownloadFailed | If the alias is not found. |
LibrarianServerError | If the librarian server is unreachable or returns an 5xx HTTPError. |