Namespace InfluxDB3.Client.Config
Classes
ClientConfig
The ClientConfig class holds the configuration for the InfluxDB client.
You can configure following options:
- Host: The URL of the InfluxDB server.
- Token: The authentication token for accessing the InfluxDB server.
- AuthScheme: Token authentication scheme. Default is 'null' for Cloud access. Set to 'Bearer' for Edge access.
- Organization: The organization to be used for operations.
- Database: The database to be used for InfluxDB operations.
- Headers: The set of HTTP headers to be included in requests.
- Timeout: Timeout to wait before the HTTP request times out. Default to '10 seconds'.
- AllowHttpRedirects: Automatically following HTTP 3xx redirects. Default to 'false'.
- DisableServerCertificateValidation: Disable server SSL certificate validation. Default to 'false'.
- Proxy: The HTTP proxy URL. Default is not set.
- WriteOptions: Write options.
If you want create client with custom options, you can use the following code:
using var client = new InfluxDBClient(new ClientConfig{
Host = "https://us-east-1-1.aws.cloud2.influxdata.com",
Token = "my-token",
Organization = "my-org",
Database = "my-database",
AllowHttpRedirects = true,
DisableServerCertificateValidation = true,
WriteOptions = new WriteOptions
{
Precision = WritePrecision.S,
GzipThreshold = 4096
}
});
WriteOptions
The WriteOptions class holds the configuration for writing data to InfluxDB.
You can configure following options:
- Precision: The default precision to use for the timestamp of points if no precision is specified in the write API call.
- GzipThreshold: The threshold in bytes for gzipping the body. The default value is 1000.
If you want create client with custom options, you can use the following code:
using var client = new InfluxDBClient(new ClientConfig
{
Host = "https://us-east-1-1.aws.cloud2.influxdata.com",
Token = "my-token",
Organization = "my-org",
Database = "my-database",
WriteOptions = new WriteOptions
{
Precision = WritePrecision.S,
GzipThreshold = 4096
}
});