Part of lp.services.librarianserver.libraryprotocol View In Hierarchy
A client sends an upload with a request like:
STORE 10000 foo.txt Optional-Header: value Optional-Header: value <....10000 bytes....>
And this server will respond with:
200 1234/5678
Where "1234" is the file id in our system, and "5678" is file alias id.
The File-Content-ID and File-Alias-ID headers are also described in <https://launchpad.canonical.com/LibrarianTransactions>.
Unrecognised headers will be ignored.
If something goes wrong, the server will reply with a 400 (bad request, i.e. client error) or 500 (internal server error) response codes instead, and an appropriate message.
Once the server has replied, the client may re-use the connection as if it were just established to start a new upload.
Unknown Field: content-type | a mime-type to associate with the file | |
Unknown Field: file-content-id | if specified, the integer file id for this file. If not specified, the server will generate one. | |
Unknown Field: file-alias-id | if specified, the integer file alias id for this file. If not specified, the server will generate one. | |
Unknown Field: file-expires | if specified, the expiry time of this alias in ISO 8601 format. As per LibrarianGarbageCollection. | |
Unknown Field: database-name | if specified, the name of the database the client is connected to. The server will check that this matches, and reject the request if it doesn't. |
Method | lineReceived | Undocumented |
Method | sendError | Sends a correctly formatted error to the client, and closes the |
Method | unknownError | Undocumented |
Method | translateErrors | Errback to translate storage errors to protocol errors. |
Method | protocolErrors | Undocumented |
Method | badLine | Undocumented |
Method | line_command | Undocumented |
Method | line_header | Undocumented |
Method | badCommand | Undocumented |
Method | command_STORE | Undocumented |
Method | header_content_type | Undocumented |
Method | header_sha1_digest | Undocumented |
Method | header_file_content_id | Undocumented |
Method | header_file_alias_id | Undocumented |
Method | header_file_expires | Undocumented |
Method | header_database_name | Undocumented |
Method | header_debug_id | Undocumented |
Method | rawDataReceived | Undocumented |
Method | logDebugging | Undocumented |
Method | _storeFile | Undocumented |