INNER CODE UNIT · Python

cli

braedon/prometheus-es-exporter · prometheus_es_exporter/__init__.py:511

def cli(**options):
    """Export Elasticsearch query results to Prometheus."""
    if options['basic_user'] and options['basic_password'] is None:
        raise click.BadOptionUsage('basic_user', 'Username provided with no password.')
    elif options['basic_user'] is None and options['basic_password']:
        raise click.BadOptionUsage('basic_password', 'Password provided with no username.')
    elif options['basic_user']:
        http_auth = (options['basic_user'], options['basic_password'])
    else:
        http_auth = None

    if not options['ca_certs'] and options['client_cert']:
        raise click.BadOptionUsage('client_cert',
                                   '--client-cert can only be used when --ca-certs is provided.')
    elif not options['ca_certs'] and options['client_key']:
        raise click.BadOptionUsage('client_key',
                                   '--client-key can only be used when --ca-certs is provided.')
    elif options['client_cert'] and not options['client_key']:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…