Public Member Functions | |
def | __init__ |
def | discardCookies |
def | getCookies |
def | getToken |
def | query |
def | setBaseUrl |
def | setProxy |
def | setRetries |
def | setTimeout |
Public Attributes | |
baseUrl | |
curl | |
retries | |
token | |
Static Public Attributes | |
tuple | retryCodes = frozenset([502, 503]) |
Class used for querying URLs using the HTTP protocol.
Definition at line 64 of file upload_popcon.py.
def upload_popcon.HTTP.__init__ | ( | self | ) |
Definition at line 70 of file upload_popcon.py.
References upload_popcon.HTTP.setBaseUrl(), and upload_popcon.HTTP.setRetries().
def upload_popcon.HTTP.discardCookies | ( | self | ) |
Discards cookies.
Definition at line 92 of file upload_popcon.py.
Referenced by upload_popcon.HTTP.query(), and uploadConditions.HTTP.query().
def upload_popcon.HTTP.getCookies | ( | self | ) |
def upload_popcon.HTTP.getToken | ( | self, | |
username, | |||
password | |||
) |
Definition at line 132 of file upload_popcon.py.
References upload_popcon.HTTP.baseUrl, cond::TagInfo_t.token, and upload_popcon.HTTP.token.
Queries a URL, optionally with some data (dictionary). If no data is specified, a GET request will be used. If some data is specified, a POST request will be used. If files is specified, it must be a dictionary like data but the values are filenames. By default, cookies are kept in-between requests. A HTTPError exception is raised if the response's HTTP code is not 200.
Definition at line 175 of file upload_popcon.py.
References upload_popcon.HTTP.baseUrl, upload_popcon.HTTP.discardCookies(), list(), upload_popcon.HTTP.retries, upload_popcon.HTTP.retryCodes, cond::TagInfo_t.token, and upload_popcon.HTTP.token.
Referenced by production_tasks.BaseDataset.run(), and edmIntegrityCheck.IntegrityCheck.test().
def upload_popcon.HTTP.setBaseUrl | ( | self, | |
baseUrl = '' |
|||
) |
Allows to set a base URL which will be prefixed to all the URLs that will be queried later.
Definition at line 98 of file upload_popcon.py.
References upload_popcon.HTTP.baseUrl.
Referenced by upload_popcon.HTTP.__init__(), and uploadConditions.HTTP.__init__().
def upload_popcon.HTTP.setProxy | ( | self, | |
proxy = '' |
|||
) |
def upload_popcon.HTTP.setRetries | ( | self, | |
retries = () |
|||
) |
Allows to set retries. The retries are a sequence of the seconds to wait per retry. The retries are done on: * PyCurl errors (includes network problems, e.g. not being able to connect to the host). * 502 Bad Gateway (for the moment, to avoid temporary Apache-CherryPy issues). * 503 Service Temporarily Unavailable (for when we update the frontends).
Definition at line 117 of file upload_popcon.py.
Referenced by upload_popcon.HTTP.__init__(), and uploadConditions.HTTP.__init__().
def upload_popcon.HTTP.setTimeout | ( | self, | |
timeout = 0 |
|||
) |
upload_popcon.HTTP.baseUrl |
Definition at line 83 of file upload_popcon.py.
Referenced by upload_popcon.HTTP.getToken(), uploadConditions.HTTP.getToken(), upload_popcon.HTTP.query(), uploadConditions.HTTP.query(), upload_popcon.HTTP.setBaseUrl(), and uploadConditions.HTTP.setBaseUrl().
upload_popcon.HTTP.curl |
Definition at line 74 of file upload_popcon.py.
upload_popcon.HTTP.retries |
Definition at line 130 of file upload_popcon.py.
Referenced by upload_popcon.HTTP.query(), and uploadConditions.HTTP.query().
|
static |
Definition at line 68 of file upload_popcon.py.
Referenced by upload_popcon.HTTP.query(), and uploadConditions.HTTP.query().
upload_popcon.HTTP.token |
Definition at line 85 of file upload_popcon.py.
Referenced by upload_popcon.HTTP.getToken(), uploadConditions.HTTP.getToken(), upload_popcon.HTTP.query(), uploadConditions.HTTP.query(), upload_popcon.ConditionsUploader.signOut(), and uploadConditions.ConditionsUploader.signOut().