Beispiel #1
0
    def __init__(self,
                 host,
                 port=443,
                 user='******',
                 password='',
                 verify=False,
                 retries=None,
                 cache_interval=0,
                 connect_timeout=30,
                 application_type=None):
        base_url = 'https://{host}:{port}'.format(host=host, port=port)

        insecure = False
        ca_cert_path = None
        if isinstance(verify, bool):
            insecure = not verify
        else:
            ca_cert_path = verify

        if application_type:
            self.HEADERS['Application-Type'] = application_type

        self.http_client = client.HTTPClient(base_url=base_url,
                                             headers=self.HEADERS,
                                             auth=(user, password),
                                             insecure=insecure,
                                             retries=retries,
                                             ca_cert_path=ca_cert_path,
                                             cache_interval=cache_interval,
                                             timeout=(connect_timeout, None))
Beispiel #2
0
    def __init__(self, host, port=443, user='******', password=''):
        base_url = 'https://{host}:{port}'.format(host=host, port=port)

        self.http_client = client.HTTPClient(base_url=base_url,
                                             headers=self.HEADERS,
                                             auth=(user, password),
                                             insecure=True)
Beispiel #3
0
    def __init__(self, host, port=443, user='******', password='', debug=False):
        base_url = 'https://{host}:{port}'.format(host=host, port=port)

        self.http_client = client.HTTPClient(base_url=base_url,
                                             headers=self.HEADERS,
                                             auth=(user, password),
                                             insecure=True,
                                             http_log_debug=debug)
        self.csrf_token = None
Beispiel #4
0
    def __init__(self, host, user='******', password=''):
        base_url = 'https://{}'.format(host)

        self.http_client = client.HTTPClient(base_url=base_url,
                                             headers=self.HEADERS,
                                             auth=(user, password),
                                             insecure=True)

        self.host = host
        self.user = user
        self.password = password

        self._login(host, user, password)
Beispiel #5
0
    def __init__(self, host, port=443, user='******', password='',
                 verify=False):
        base_url = 'https://{host}:{port}'.format(host=host, port=port)

        insecure = False
        ca_cert_path = None
        if isinstance(verify, bool):
            insecure = not verify
        else:
            ca_cert_path = verify
        self.http_client = client.HTTPClient(base_url=base_url,
                                             headers=self.HEADERS,
                                             auth=(user, password),
                                             insecure=insecure,
                                             ca_cert_path=ca_cert_path)
Beispiel #6
0
 def setUp(self):
     self.client = client.HTTPClient('https://10.10.10.10', {})