Integrations/Elasticsearch_v2/Elasticsearch_v2.py
def elasticsearch_builder():
    """Builds an Elasticsearch obj with the necessary credentials, proxy settings and secure connection."""
    if API_KEY_ID:
        if PROXY:
            return Elasticsearch(hosts=[SERVER], connection_class=RequestsHttpConnection,
                                 api_key=(API_KEY_ID, PASSWORD), verify_certs=INSECURE, proxies=handle_proxy())

        else:
            return Elasticsearch(hosts=[SERVER], connection_class=RequestsHttpConnection,
                                 api_key=(API_KEY_ID, PASSWORD), verify_certs=INSECURE)

    elif USERNAME:
        if PROXY:
            return Elasticsearch(hosts=[SERVER], connection_class=RequestsHttpConnection,
                                 http_auth=(USERNAME, PASSWORD), verify_certs=INSECURE, proxies=handle_proxy())

        else:
            return Elasticsearch(hosts=[SERVER], connection_class=RequestsHttpConnection,
                                 http_auth=(USERNAME, PASSWORD), verify_certs=INSECURE)
    else:
        if PROXY:
            return Elasticsearch(hosts=[SERVER], connection_class=RequestsHttpConnection,
                                 verify_certs=INSECURE, proxies=handle_proxy())

        else:
            return Elasticsearch(hosts=[SERVER], connection_class=RequestsHttpConnection, verify_certs=INSECURE)
Builds an Elasticsearch obj with the necessary credentials, proxy settings and secure connection.
Builds an Elasticsearch obj with the necessary credentials, proxy settings and secure connection.
Builds an Elasticsearch obj with the necessary credentials proxy settings and secure connection .
def elasticsearch_builder():
    if API_KEY_ID:
        if PROXY:
            return Elasticsearch(hosts=[SERVER], connection_class=RequestsHttpConnection,
                                 api_key=(API_KEY_ID, PASSWORD), verify_certs=INSECURE, proxies=handle_proxy())
        else:
            return Elasticsearch(hosts=[SERVER], connection_class=RequestsHttpConnection,
                                 api_key=(API_KEY_ID, PASSWORD), verify_certs=INSECURE)
    elif USERNAME:
        if PROXY:
            return Elasticsearch(hosts=[SERVER], connection_class=RequestsHttpConnection,
                                 http_auth=(USERNAME, PASSWORD), verify_certs=INSECURE, proxies=handle_proxy())
        else:
            return Elasticsearch(hosts=[SERVER], connection_class=RequestsHttpConnection,
                                 http_auth=(USERNAME, PASSWORD), verify_certs=INSECURE)
    else:
        if PROXY:
            return Elasticsearch(hosts=[SERVER], connection_class=RequestsHttpConnection,
                                 verify_certs=INSECURE, proxies=handle_proxy())
        else:
            return Elasticsearch(hosts=[SERVER], connection_class=RequestsHttpConnection, verify_certs=INSECURE)
def elasticsearch_builder ( ) : if API_KEY_ID : if PROXY : return Elasticsearch ( hosts = [ SERVER ] , connection_class = RequestsHttpConnection , api_key = ( API_KEY_ID , PASSWORD ) , verify_certs = INSECURE , proxies = handle_proxy ( ) ) else : return Elasticsearch ( hosts = [ SERVER ] , connection_class = RequestsHttpConnection , api_key = ( API_KEY_ID , PASSWORD ) , verify_certs = INSECURE ) elif USERNAME : if PROXY : return Elasticsearch ( hosts = [ SERVER ] , connection_class = RequestsHttpConnection , http_auth = ( USERNAME , PASSWORD ) , verify_certs = INSECURE , proxies = handle_proxy ( ) ) else : return Elasticsearch ( hosts = [ SERVER ] , connection_class = RequestsHttpConnection , http_auth = ( USERNAME , PASSWORD ) , verify_certs = INSECURE ) else : if PROXY : return Elasticsearch ( hosts = [ SERVER ] , connection_class = RequestsHttpConnection , verify_certs = INSECURE , proxies = handle_proxy ( ) ) else : return Elasticsearch ( hosts = [ SERVER ] , connection_class = RequestsHttpConnection , verify_certs = INSECURE )
Builds an Elasticsearch obj with the necessary credentials, proxy settings and secure connection.
Builds an Elasticsearch obj with the necessary credentials proxy settings and secure connection .
"""Builds an Elasticsearch obj with the necessary credentials, proxy settings and secure connection."""