Ctrl + K
DocumentationLog inGet started

tessl/pypi-influxdb-client

tessl install tessl/pypi-influxdb-client@1.49.0

Comprehensive Python client library for InfluxDB 2.x with sync/async APIs for writing, querying, and managing time series data.

Agent Success

Agent success rate when using this tile

82%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.19x

Baseline

Agent success rate without this tile

69%

task.mdevals/scenario-2/

Secure InfluxDB Client Configuration

Build a utility that demonstrates secure connection configuration for an InfluxDB time-series database client. The utility should support multiple SSL/TLS security scenarios commonly encountered in production environments.

Requirements

Create a Python module that implements a secure client connection manager with the following capabilities:

Connection Scenarios

The module should handle three distinct security scenarios:

  1. Production Secure Connection: Connect to an InfluxDB instance using full SSL certificate verification with a custom Certificate Authority (CA) certificate file.

  2. Development Connection: Connect to a development InfluxDB instance where SSL verification is disabled (for local testing environments only).

  3. Standard HTTPS Connection: Connect to an InfluxDB cloud instance using standard HTTPS with default certificate verification enabled.

Implementation Requirements

  • Create a SecureClientManager class that can initialize connections for each of the three scenarios
  • Each connection scenario should accept connection parameters: URL, authentication token, and organization name
  • For the production scenario, accept an additional CA certificate file path parameter
  • Implement a method to verify the connection is properly configured by checking the database health
  • Handle connection errors gracefully and provide meaningful error messages

Test Cases

  • When connecting in production mode with a valid CA certificate path, the client should be initialized with custom certificate verification @test
  • When connecting in development mode, the client should be initialized with SSL verification disabled @test
  • When connecting in standard mode, the client should be initialized with default SSL verification enabled @test
  • The health check method should successfully ping the database when given valid connection parameters @test

Implementation

@generates

API

class SecureClientManager:
    """
    Manages secure InfluxDB client connections with various SSL/TLS configurations.
    """

    def __init__(self):
        """Initialize the secure client manager."""
        pass

    def create_production_client(self, url: str, token: str, org: str, ca_cert_path: str):
        """
        Create a client configured for production use with custom CA certificate.

        Args:
            url: The InfluxDB server URL
            token: Authentication token
            org: Organization name
            ca_cert_path: Path to the CA certificate file

        Returns:
            Configured InfluxDB client instance
        """
        pass

    def create_development_client(self, url: str, token: str, org: str):
        """
        Create a client configured for development with SSL verification disabled.

        Args:
            url: The InfluxDB server URL
            token: Authentication token
            org: Organization name

        Returns:
            Configured InfluxDB client instance
        """
        pass

    def create_standard_client(self, url: str, token: str, org: str):
        """
        Create a client configured with default SSL verification.

        Args:
            url: The InfluxDB server URL
            token: Authentication token
            org: Organization name

        Returns:
            Configured InfluxDB client instance
        """
        pass

    def verify_connection(self, client) -> bool:
        """
        Verify that a client connection is working by performing a health check.

        Args:
            client: An InfluxDB client instance

        Returns:
            True if connection is healthy, False otherwise
        """
        pass

Dependencies { .dependencies }

influxdb-client { .dependency }

Provides Python client library for InfluxDB 2.x with SSL/TLS configuration support.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/influxdb-client@1.49.x
tile.json