This API Documentation is currently a catch-all. We’re going to merge the API docs into the hand created docs as we have time to integrate them.
Deprecate DictContainer in favor of bunch.Bunch
Module author: Ricky Zhou <ricky@fedoraproject.org>
Module author: Luke Macken <lmacken@redhat.com>
Module author: Toshio Kuratomi <tkuratom@redhat.com>
Base Exception for any problem talking with the Service.
When the Client gets an error talking to the server, an exception of this type is raised. This can be anything in the networking layer up to an error returned from the server itself.
Unable to talk to the server properly.
This includes network errors and 500 response codes.
Base Exception for problems which originate within the Clients.
This should be the base class for any exceptions that the Client generates generate. For instance, if the client performs validation before passing the data on to the Fedora Service.
Problems returned while talking to the Services should be returned via a FedoraServiceError instead.
A client for interacting with web services.
Make an HTTP request to a server method.
The given method is called with any parameters set in req_params. If auth is True, then the request is made with an authenticated session cookie.
Parameters: |
|
---|---|
Return type: | Bunch |
Returns: | The data from the server |
Changed in version 0.3.21: * Return data as a Bunch instead of a DictContainer * Add file_params to allow uploading files
Deprecated, use session_id instead.
The session cookie is saved in a file in case it is needed in consecutive runs of BaseClient.
The session_id.
The session id is saved in a file in case it is needed in consecutive runs of BaseClient.
A client to a Fedora Service. This class is optimized to proxy multiple users to a service. ProxyClient is designed to be threadsafe so that code can instantiate one instance of the class and use it for multiple requests for different users from different threads.
If you want something that can manage one user’s connection to a Fedora Service, then look into using BaseClient instead.
This class has several attributes. These may be changed after instantiation however, please note that this class is intended to be threadsafe. Changing these values when another thread may affect more than just the thread that you are making the change in. (For instance, changing the debug option could cause other threads to start logging debug messages in the middle of a method.)
Make an HTTP request to a server method.
The given method is called with any parameters set in req_params. If auth is True, then the request is made with an authenticated session cookie. Note that path parameters should be set by adding onto the method, not via req_params.
Parameters: |
|
||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns: | If ProxyClient is created with session_as_cookie=True (the default), a tuple of session cookie and data from the server. If ProxyClient was created with session_as_cookie=False, a tuple of session_id and data instead. |
||||||||||
Return type: | tuple of session information and data from server |
Changed in version 0.3.17: No longer send tg_format=json parameter. We rely solely on the Accept: application/json header now.
Changed in version 0.3.21: * Return data as a Bunch instead of a DictContainer * Add file_params to allow uploading files
Fetch data for all revisions. This could take a long time. You can start at a specific revision by modifying the ‘start’ keyword argument.
To ignore revisions made by “ImportUser” and “Admin” set ignore_imported_revs to True (this is the default). To ignore edits made by Wikibot set ignore_wikibot to True (False is the default).
Modifying the remainder of the keyword arguments will return less/more data.