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 220 of file uploadConditions.py.
def uploadConditions.HTTP.__init__ | ( | self | ) |
Definition at line 226 of file uploadConditions.py.
References upload_popcon.HTTP.setBaseUrl(), uploadConditions.HTTP.setBaseUrl(), upload_popcon.HTTP.setRetries(), and uploadConditions.HTTP.setRetries().
def uploadConditions.HTTP.discardCookies | ( | self | ) |
Discards cookies.
Definition at line 248 of file uploadConditions.py.
Referenced by uploadConditions.HTTP.query().
def uploadConditions.HTTP.getCookies | ( | self | ) |
def uploadConditions.HTTP.getToken | ( | self, | |
username, | |||
password | |||
) |
Definition at line 288 of file uploadConditions.py.
References upload_popcon.HTTP.baseUrl, uploadConditions.HTTP.baseUrl, edm.decode(), str, upload_popcon.HTTP.token, uploadConditions.HTTP.token, and upload_popcon.ConditionsUploader.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 351 of file uploadConditions.py.
References upload_popcon.HTTP.baseUrl, uploadConditions.HTTP.baseUrl, upload_popcon.HTTP.discardCookies(), uploadConditions.HTTP.discardCookies(), upload_popcon.HTTP.retries, uploadConditions.HTTP.retries, upload_popcon.HTTP.retryCodes, uploadConditions.HTTP.retryCodes, str, upload_popcon.HTTP.token, uploadConditions.HTTP.token, and upload_popcon.ConditionsUploader.token.
Referenced by production_tasks.BaseDataset.run(), and edmIntegrityCheck.IntegrityCheck.test().
def uploadConditions.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 254 of file uploadConditions.py.
References upload_popcon.HTTP.baseUrl, and uploadConditions.HTTP.baseUrl.
Referenced by uploadConditions.HTTP.__init__().
def uploadConditions.HTTP.setProxy | ( | self, | |
proxy = '' |
|||
) |
def uploadConditions.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 273 of file uploadConditions.py.
Referenced by uploadConditions.HTTP.__init__().
def uploadConditions.HTTP.setTimeout | ( | self, | |
timeout = 0 |
|||
) |
uploadConditions.HTTP.baseUrl |
Definition at line 239 of file uploadConditions.py.
Referenced by uploadConditions.HTTP.getToken(), uploadConditions.HTTP.query(), and uploadConditions.HTTP.setBaseUrl().
uploadConditions.HTTP.curl |
Definition at line 230 of file uploadConditions.py.
uploadConditions.HTTP.retries |
Definition at line 286 of file uploadConditions.py.
Referenced by uploadConditions.HTTP.query().
|
static |
Definition at line 224 of file uploadConditions.py.
Referenced by uploadConditions.HTTP.query().
uploadConditions.HTTP.token |
Definition at line 241 of file uploadConditions.py.
Referenced by uploadConditions.HTTP.getToken(), uploadConditions.HTTP.query(), uploadConditions.ConditionsUploader.setHost(), uploadConditions.ConditionsUploader.signIn(), and uploadConditions.ConditionsUploader.signOut().