def __init__(self, url, auth=None, version=None, api_version=None,<EOL>use_cache=True, strict_cache=True, timeout=<NUM_LIT>,<EOL>timeout_post=<NUM_LIT>, timeout_delete=<NUM_LIT>, timeout_put=None,<EOL>verify=False, cache_dir=None):
if api_version is None:<EOL><INDENT>api_version = <NUM_LIT:1><EOL>logger.warning(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>self.url = url<EOL>self._req_params = {}<EOL>self.timeout = {'<STR_LIT>': timeout or None}<EOL>if timeout_post is not None:<EOL><INDENT>self.set_timeout(timeout_post, '<STR_LIT:POST>')<EOL><DEDENT>if timeout_delete is not None:<EOL><INDENT>self.set_timeout(timeout_delete, '<STR_LIT>')<EOL><DEDENT>if timeout_put is not None:<EOL><INDENT>self.set_timeout(timeout_put, '<STR_LIT>')<EOL><DEDENT>self.version = version<EOL>self.api_version = api_version<EOL>self.session = requests.Session()<EOL>self.session.verify = verify<EOL>self._req_params['<STR_LIT>'] = verify<EOL>self.cache_dir = cache_dir oros.path.join(os.path.expanduser('<STR_LIT>'), '<STR_LIT>')<EOL>if auth is not None:<EOL><INDENT>self.session.auth = auth<EOL><DEDENT>self.session.headers.update(<EOL>{<EOL>'<STR_LIT>': '<STR_LIT>' % api_version,<EOL>'<STR_LIT>': '<STR_LIT:application/json>',<EOL>})<EOL>if self.version is None:<EOL><INDENT>self.version = self.get_foreman_version()<EOL><DEDENT>self._generate_api_defs(use_cache, strict_cache)<EOL>self.plugins = self._plugins_resources(self)<EOL>
:param url: Full url to the foreman server
:param auth: Tuple with the user and the pass
:param version: Foreman version (will autodetect by default)
:param api_version: Version of the api to use (1 by default)
:param use_cache: if True, will use local api definitions, if False,
    will try to get them from the remote Foreman instance (it needs
    you to have disabled use_cache in the apipie configuration in your
    foreman instance)
:param strict_cache: If True, will not use a similar version
    definitions file
:param timeout: Timeout in seconds for each http request (default 60)
    If None or 0, then no timeout.
:param timeout_post: Timeout in seconds for POST requests (eg. host
    creation, default 600 as it may take a long time depending on
    compute resource).
    If None, then global timeout is used, 0 means no timeout.
:param timeout_delete: Timeout in seconds for DELETE requests (eg. host
    deletion, default 600 as it may take a long time depending on
    compute resource)
    If None, then global timeout is used, 0 means no timeout.
:param timeout_put: Timeout in seconds for PUT requests
    If None, then global timeout is used, 0 means no timeout.
:param verify: path to certificates bundle for SSL verification. If
    False, SSL will not be validated
:param cache_dir: path to directory used as cache for api definition
    files.