Class 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
}
});
Inheritance
Namespace: InfluxDB3.Client.Config
Assembly: InfluxDB3.Client.dll
Syntax
public class ClientConfig : object
Constructors
ClientConfig()
Initializes a new instance of client configuration.
Declaration
public ClientConfig()
Properties
AllowHttpRedirects
Automatically following HTTP 3xx redirects. Default to 'false'.
Declaration
public bool AllowHttpRedirects { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
AuthScheme
Token authentication scheme.
Declaration
public string? AuthScheme { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.String> |
Database
The database to be used for InfluxDB operations.
Declaration
public string? Database { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.String> |
DisableServerCertificateValidation
Disable server SSL certificate validation. Default to 'false'.
Declaration
public bool DisableServerCertificateValidation { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Headers
The custom headers that will be added to requests. This is useful for adding custom headers to requests, such as tracing headers. To add custom headers use 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",
Headers = new Dictionary<string, string>
{
{ "X-Tracing-Id", "123" },
}
});
Declaration
public Dictionary<string, string>? Headers { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<Dictionary<System.String, System.String>> |
Host
The URL of the InfluxDB server.
Declaration
public string Host { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Organization
The organization to be used for operations.
Declaration
public string? Organization { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.String> |
Proxy
The HTTP proxy URL. Default is not set.
Declaration
public WebProxy? Proxy { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<WebProxy> |
Timeout
Timeout to wait before the HTTP request times out. Default to '10 seconds'.
Declaration
public TimeSpan Timeout { get; set; }
Property Value
Type | Description |
---|---|
TimeSpan |
Token
The authentication token for accessing the InfluxDB server.
Declaration
public string? Token { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.String> |
WriteOptions
Write options.
Declaration
public WriteOptions WriteOptions { get; set; }
Property Value
Type | Description |
---|---|
WriteOptions |