TornadoBaseClient

TornadoBaseClient contains all the low-levels functionalities and initilization methods It must be instantiated from TornadoClient

Requests library manage itself retry when connection failed, so the __nbOfRetry attribute is removed from DIRAC (For each URL requests manage retries himself, if it still fail, we try next url) KeepAlive lapse is also removed because managed by request, see https://requests.readthedocs.io/en/latest/user/advanced/#keep-alive

If necessary this class can be modified to define number of retry in requests, documentation does not give lot of informations but you can see this simple solution from StackOverflow. After some tests request seems to retry 3 times by default. https://stackoverflow.com/questions/15431044/can-i-set-max-retries-for-requests-request

Warning

If you use your own certificates, it’s like in dips, please take a look at Using your own CA

Warning

Lots of method are copy-paste from BaseClient. And some methods are copy-paste AND modifications, for now it permit to fully separate DISET and HTTPS.

class DIRAC.Core.Tornado.Client.private.TornadoBaseClient.TornadoBaseClient(serviceName, **kwargs)

Bases: object

This class contain initialization method and all utilities method used for RPC

KW_DELEGATED_DN = 'delegatedDN'
KW_DELEGATED_GROUP = 'delegatedGroup'
KW_EXTRA_CREDENTIALS = 'extraCredentials'
KW_IGNORE_GATEWAYS = 'ignoreGateways'
KW_KEEP_ALIVE_LAPSE = 'keepAliveLapse'
KW_PROXY_CHAIN = 'proxyChain'
KW_PROXY_LOCATION = 'proxyLocation'
KW_PROXY_STRING = 'proxyString'
KW_SETUP = 'setup'
KW_SKIP_CA_CHECK = 'skipCACheck'
KW_TIMEOUT = 'timeout'
KW_USE_ACCESS_TOKEN = 'useAccessToken'
KW_USE_CERTIFICATES = 'useCertificates'
KW_VO = 'VO'
VAL_EXTRA_CREDENTIALS_HOST = 'hosts'
__init__(serviceName, **kwargs)
Parameters:
  • serviceName – URL of the service (proper uri or just System/Component)

  • useCertificates – If set to True, use the server certificate

  • extraCredentials

  • timeout – Timeout of the call (default 600 s)

  • setup – Specify the Setup

  • VO – Specify the VO

  • delegatedDN – Not clear what it can be used for.

  • delegatedGroup – Not clear what it can be used for.

  • ignoreGateways – Ignore the DIRAC Gatways settings

  • proxyLocation – Specify the location of the proxy

  • proxyString – Specify the proxy string

  • proxyChain – Specify the proxy chain

  • skipCACheck – Do not check the CA

  • keepAliveLapse – Duration for keepAliveLapse (heartbeat like) (now managed by requests)

getDestinationService()

Returns the url the service.

getServiceName()

Returns the name of the service, if you had given a url at init, returns the URL.