Class InfluxDBClientOptions
InfluxDBClientOptions are used to configure the InfluxDB 2.x connections.
Inheritance
Namespace: InfluxDB.Client
Assembly: InfluxDB.Client.dll
Syntax
public class InfluxDBClientOptions : object
Constructors
InfluxDBClientOptions(String)
Create an instance of InfluxDBClientOptions. The url could be a connection string with various configurations.
e.g.: "http://localhost:8086?timeout=5000&logLevel=BASIC The following options are supported:
Declaration
public InfluxDBClientOptions(string url)
Parameters
Type | Name | Description |
---|---|---|
System.String | url | url to connect the InfluxDB |
Properties
AllowHttpRedirects
Configure automatically following HTTP 3xx redirects.
Declaration
public bool AllowHttpRedirects { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
AuthScheme
The scheme uses to Authentication.
Declaration
public InfluxDBClientOptions.AuthenticationScheme AuthScheme { get; }
Property Value
Type | Description |
---|---|
InfluxDBClientOptions.AuthenticationScheme |
Bucket
Specify the default destination bucket for writes.
Declaration
public string Bucket { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ClientCertificates
Set X509CertificateCollection to be sent with HTTP requests
Declaration
public X509CertificateCollection ClientCertificates { get; set; }
Property Value
Type | Description |
---|---|
X509CertificateCollection |
DefaultTags
Default tags that will be use for writes by Point and POJO.
Declaration
public Dictionary<string, string> DefaultTags { get; set; }
Property Value
Type | Description |
---|---|
Dictionary<System.String, System.String> |
HttpClient
Add a HttpClient as a part of InfluxDBClientOptions
Declaration
public HttpClient HttpClient { get; set; }
Property Value
Type | Description |
---|---|
HttpClient |
LogLevel
Set the log level for the request and response information.
Declaration
public LogLevel LogLevel { get; set; }
Property Value
Type | Description |
---|---|
LogLevel |
Org
Specify the default destination organization for writes and queries.
Declaration
public string Org { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Password
Setup authorization by Session.
Declaration
public string Password { get; set; }
Property Value
Type | Description |
---|---|
System.String |
PointSettings
The setting for store data point: default values, threshold, ...
Declaration
public PointSettings PointSettings { get; }
Property Value
Type | Description |
---|---|
PointSettings |
Timeout
Set the timespan to wait before the HTTP request times out.
Declaration
public TimeSpan Timeout { get; set; }
Property Value
Type | Description |
---|---|
TimeSpan |
Token
Setup authorization by Token.
Declaration
public string Token { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Url
Set the url to connect the InfluxDB.
Declaration
public string Url { get; }
Property Value
Type | Description |
---|---|
System.String |
Username
Setup authorization by Session.
Declaration
public string Username { get; set; }
Property Value
Type | Description |
---|---|
System.String |
VerifySsl
Ignore Certificate Validation Errors when false
.
Declaration
public bool VerifySsl { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
VerifySslCallback
Callback function for handling the remote SSL Certificate Validation.
The callback takes precedence over VerifySsl
.
Declaration
public RemoteCertificateValidationCallback VerifySslCallback { get; set; }
Property Value
Type | Description |
---|---|
RemoteCertificateValidationCallback |
WebProxy
Specify the WebProxy instance to use by the WebRequest to connect to external InfluxDB.
Declaration
public IWebProxy WebProxy { get; set; }
Property Value
Type | Description |
---|---|
IWebProxy |
Methods
AddDefaultTag(String, String)
Add default tag that will be use for writes by Point and POJO.
The expressions can be:
Declaration
public void AddDefaultTag(string tagName, string expression)
Parameters
Type | Name | Description |
---|---|---|
System.String | tagName | the tag name |
System.String | expression | the tag value expression |
AddDefaultTags(Dictionary<String, String>)
Add default tags that will be use for writes by Point and POJO. AddDefaultTag(String, String)
Declaration
public void AddDefaultTags(Dictionary<string, string> tags)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<System.String, System.String> | tags | tags dictionary |
LoadConfig(String)
Configure InfluxDBClientOptions via App.config.
Declaration
public static InfluxDBClientOptions LoadConfig(string sectionName = "influx2")
Parameters
Type | Name | Description |
---|---|---|
System.String | sectionName | Name of configuration section. Useful for tests. |
Returns
Type | Description |
---|---|
InfluxDBClientOptions |