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 222 of file uploadConditions.py.
def uploadConditions.HTTP.__init__ | ( | self | ) |
Definition at line 228 of file uploadConditions.py.
References upload_popcon.HTTP.setBaseUrl(), uploadConditions.HTTP.setBaseUrl(), uploadConditions.HTTP.setRetries(), and upload_popcon.HTTP.setRetries().
def uploadConditions.HTTP.discardCookies | ( | self | ) |
Discards cookies.
Definition at line 250 of file uploadConditions.py.
Referenced by uploadConditions.HTTP.query().
def uploadConditions.HTTP.getCookies | ( | self | ) |
def uploadConditions.HTTP.getToken | ( | self, | |
username, | |||
password | |||
) |
Definition at line 290 of file uploadConditions.py.
References uploadConditions.HTTP.baseUrl, upload_popcon.HTTP.baseUrl, cond::TagInfo_t.token, and uploadConditions.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 333 of file uploadConditions.py.
References uploadConditions.HTTP.baseUrl, upload_popcon.HTTP.baseUrl, upload_popcon.HTTP.discardCookies(), uploadConditions.HTTP.discardCookies(), list(), uploadConditions.HTTP.retries, upload_popcon.HTTP.retries, uploadConditions.HTTP.retryCodes, upload_popcon.HTTP.retryCodes, cond::TagInfo_t.token, and uploadConditions.HTTP.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 256 of file uploadConditions.py.
References uploadConditions.HTTP.baseUrl, and upload_popcon.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 275 of file uploadConditions.py.
Referenced by uploadConditions.HTTP.__init__().
def uploadConditions.HTTP.setTimeout | ( | self, | |
timeout = 0 |
|||
) |
uploadConditions.HTTP.baseUrl |
Definition at line 241 of file uploadConditions.py.
Referenced by uploadConditions.HTTP.getToken(), uploadConditions.HTTP.query(), and uploadConditions.HTTP.setBaseUrl().
uploadConditions.HTTP.curl |
Definition at line 232 of file uploadConditions.py.
uploadConditions.HTTP.retries |
Definition at line 288 of file uploadConditions.py.
Referenced by uploadConditions.HTTP.query().
|
static |
Definition at line 226 of file uploadConditions.py.
Referenced by uploadConditions.HTTP.query().
uploadConditions.HTTP.token |
Definition at line 243 of file uploadConditions.py.
Referenced by uploadConditions.HTTP.getToken(), uploadConditions.HTTP.query(), and uploadConditions.ConditionsUploader.signOut().