Repository URL to install this package:
| 
      
        
        
        Version: 
        
         
          
          2.0.0-beta3-2-armbian20.08.0-trunk1  ▾
        
         | 
| 
    
    wiperf
  
    /
        
    usr
  
        /
        
    local
  
        /
        
    lib
  
        /
        
    python3.7
  
        /
        
    dist-packages
  
        /
        
    influxdb
  
        /
        
    __pycache__
  
        /
        client.cpython-37.pyc
   | 
|---|
B
    X5
ónã               @   s  d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlmZmZ ddlZddlZddlZddlmZ dd	lmZmZmZ dd
lmZ ddlmZ dd
lmZ G dd deZ dd Z!dd Z"dd Z#dS )zPython client for InfluxDB.é    )Úabsolute_import)Údivision)Úprint_function)Úunicode_literalsN)ÚchainÚislice)Úurlparse)Ú
make_linesÚquote_identÚ
quote_literal)Ú	ResultSeté   )ÚInfluxDBClientError)ÚInfluxDBServerErrorc               @   s¾  e Zd ZdZdlddZd
d Zdd Zedd Zedd Z	edd Z
edd Zedd Zedd Z
edd Zdd  Zd!d" Zdmd%d&Zdnd)d*Zedod,d-Zdpd/d0Zdqd1d2Zd3d4 Zed5d6 Zdrd7d8Zd9d: Zdsd;d<Zd=d> Zd?d@ ZdAdB ZdCdD Z dtdFdGZ!dudHdIZ"dvdJdKZ#dwdLdMZ$dNdO Z%dxdPdQZ&dRdS Z'dTdU Z(dydVdWZ)dXdY Z*dZd[ Z+d\d] Z,d^d_ Z-d`da Z.dbdc Z/dzdddeZ0d{dfdgZ1d|dhdiZ2djdk Z3dS )}ÚInfluxDBClientug	  InfluxDBClient primary client object to connect InfluxDB.
    The :class:`~.InfluxDBClient` object holds information necessary to
    connect to InfluxDB. Requests can be made to InfluxDB directly through
    the client.
    The client supports the use as a `context manager
    <https://docs.python.org/3/reference/datamodel.html#context-managers>`_.
    :param host: hostname to connect to InfluxDB, defaults to 'localhost'
    :type host: str
    :param port: port to connect to InfluxDB, defaults to 8086
    :type port: int
    :param username: user to connect, defaults to 'root'
    :type username: str
    :param password: password of the user, defaults to 'root'
    :type password: str
    :param pool_size: urllib3 connection pool size, defaults to 10.
    :type pool_size: int
    :param database: database name to connect to, defaults to None
    :type database: str
    :param ssl: use https instead of http to connect to InfluxDB, defaults to
        False
    :type ssl: bool
    :param verify_ssl: verify SSL certificates for HTTPS requests, defaults to
        False
    :type verify_ssl: bool
    :param timeout: number of seconds Requests will wait for your client to
        establish a connection, defaults to None
    :type timeout: int
    :param retries: number of retries your client will try before aborting,
        defaults to 3. 0 indicates try until success
    :type retries: int
    :param use_udp: use UDP to connect to InfluxDB, defaults to False
    :type use_udp: bool
    :param udp_port: UDP port to connect to InfluxDB, defaults to 4444
    :type udp_port: int
    :param proxies: HTTP(S) proxy to use for Requests, defaults to {}
    :type proxies: dict
    :param path: path of InfluxDB on the server to connect, defaults to ''
    :type path: str
    :param cert: Path to client certificate information to use for mutual TLS
        authentication. You can specify a local cert to use
        as a single file containing the private key and the certificate, or as
        a tuple of both files’ paths, defaults to None
    :type cert: str
    :param gzip: use gzip content encoding to compress requests
    :type gzip: bool
    :param session: allow for the new client request to use an existing
        requests Session, defaults to None
    :type session: requests.Session
    :raises ValueError: if cert is provided but ssl is disabled (set to False)
    Ú	localhosté  ÚrootNFé   é\  é
   Ú c             C   s:  || _ t|| _|| _|| _|| _|| _|	| _|| _|
| _	t|| _
|sPt ¡ }|| _
tjjt|
t|
d}|
rt tjtj¡| _|sd| _n|d dkr¤|| _n
d| | _d| _|dkrÂd| _| j
 | jd |¡ |d	kræi | _n|| _|r
|std
n|| j
_d | j| j| j| j¡| _dd
d| _|| _ d	S )z&Construct a new InfluxDBClient object.)Úpool_connectionsÚpool_maxsizer   r   ú/ÚhttpTÚhttpsz://Nz0Client certificate provided but ssl is disabled.z{0}://{1}:{2}{3}zapplication/jsonzapplication/x-msgpack)zContent-TypeÚAccept)!Ú_InfluxDBClient__hostÚintÚ_InfluxDBClient__portÚ	_usernameÚ	_passwordÚ	_databaseÚ_timeoutÚ_retriesÚ_verify_sslÚ_InfluxDBClient__use_udpÚ_InfluxDBClient__udp_portÚrequestsÚSessionÚ_sessionÚadaptersÚHTTPAdapterÚsocketÚAF_INETÚ
SOCK_DGRAMÚ
udp_socketÚ_InfluxDBClient__pathÚ_schemeÚmountÚ_proxiesÚ
ValueErrorÚcertÚformatÚ_hostÚ_portÚ_pathÚ_InfluxDBClient__baseurlÚ_headersÚ_gzip)ÚselfÚhostÚportÚusernameÚpasswordÚdatabaseÚsslZ
verify_sslÚtimeoutÚretriesÚuse_udpZudp_portÚproxiesZ	pool_sizeÚpathr7   ÚgzipÚsessionÚadapter© rN   ú5/tmp/pip-install-4lg_ekbd/influxdb/influxdb/client.pyÚ__init__W   sV    
zInfluxDBClient.__init__c             C   s   dS )z*Enter function as used by context manager.NrN   )r?   rN   rN   rO   Ú	__enter__¬   s    zInfluxDBClient.__enter__c             C   s   |   ¡  dS )z)Exit function as used by context manager.N)Úclose)r?   Z	_exc_typeZ
_exc_valueZ
_tracebackrN   rN   rO   Ú__exit__°   s    zInfluxDBClient.__exit__c             C   s   | j S )N)r<