Interface IFluxClient
Namespace: InfluxDB.Client.Flux
Assembly: InfluxDB.Client.Flux.dll
Syntax
public interface IFluxClient : IDisposable
Methods
GetLogLevel()
Set the LogLevel that is used for logging requests and responses.
Declaration
LogLevel GetLogLevel()
Returns
Type | Description |
---|---|
LogLevel | Log Level |
PingAsync(CancellationToken)
Check the status of InfluxDB Server.
Declaration
Task<bool> PingAsync(CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task<System.Boolean> | true if server is healthy otherwise return false |
QueryAsync(String, Action<FluxRecord>, Action<Exception>, Action, CancellationToken)
Executes the Flux query against the InfluxDB and asynchronously stream FluxRecord to
Declaration
Task QueryAsync(string query, Action<FluxRecord> onNext, Action<Exception> onError = null, Action onComplete = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | query | the flux query to execute |
Action<FluxRecord> | onNext | the callback to consume the FluxRecord result |
Action<Exception> | onError | the callback to consume any error notification |
Action | onComplete | the callback to consume a notification about successfully end of stream |
CancellationToken | cancellationToken | Token that enables callers to cancel the request. |
Returns
Type | Description |
---|---|
Task | async task |
QueryAsync(String, CancellationToken)
Executes the Flux query against the InfluxDB and asynchronously map whole response to
Declaration
Task<List<FluxTable>> QueryAsync(string query, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | query | the flux query to execute |
CancellationToken | cancellationToken | Token that enables callers to cancel the request. |
Returns
Type | Description |
---|---|
Task<List<FluxTable>> |
QueryAsync<T>(String, Action<T>, Action<Exception>, Action, CancellationToken)
Executes the Flux query against the InfluxDB and asynchronously stream result as POCO.
Declaration
Task QueryAsync<T>(string query, Action<T> onNext, Action<Exception> onError = null, Action onComplete = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | query | the flux query to execute |
Action<T> | onNext | the callback to consume the FluxRecord result |
Action<Exception> | onError | the callback to consume any error notification |
Action | onComplete | the callback to consume a notification about successfully end of stream |
CancellationToken | cancellationToken | Token that enables callers to cancel the request. |
Returns
Type | Description |
---|---|
Task | async task |
Type Parameters
Name | Description |
---|---|
T | the type of measurement |
QueryAsync<T>(String, CancellationToken)
Executes the Flux query against the InfluxDB and asynchronously map whole response to list of object with given type.
NOTE: This method is not intended for large query results.
Use
Declaration
Task<List<T>> QueryAsync<T>(string query, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | query | the flux query to execute |
CancellationToken | cancellationToken | Token that enables callers to cancel the request. |
Returns
Type | Description |
---|---|
Task<List<T>> |
Type Parameters
Name | Description |
---|---|
T | the type of measurement |
QueryRawAsync(String, Action<String>, String, Action<Exception>, Action, CancellationToken)
Executes the Flux query against the InfluxDB and asynchronously stream response (line by line) to
Declaration
Task QueryRawAsync(string query, Action<string> onResponse, string dialect = null, Action<Exception> onError = null, Action onComplete = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | query | the flux query to execute |
Action<System.String> | onResponse | the callback to consume the response line by line |
System.String | dialect | Dialect is an object defining the options to use when encoding the response. See dialect SPEC. |
Action<Exception> | onError | the callback to consume any error notification |
Action | onComplete | the callback to consume a notification about successfully end of stream |
CancellationToken | cancellationToken | Token that enables callers to cancel the request. |
Returns
Type | Description |
---|---|
Task | async task |
QueryRawAsync(String, String, CancellationToken)
Executes the Flux query against the InfluxDB and synchronously map whole response to
NOTE: This method is not intended for large responses, that do not fit into memory.
Use
Declaration
Task<string> QueryRawAsync(string query, string dialect = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | query | the flux query to execute> |
System.String | dialect | Dialect is an object defining the options to use when encoding the response. See dialect SPEC. |
CancellationToken | cancellationToken | Token that enables callers to cancel the request. |
Returns
Type | Description |
---|---|
Task<System.String> | the raw response that matched the query |
SetLogLevel(LogLevel)
Set the log level for the request and response information.
Declaration
void SetLogLevel(LogLevel logLevel)
Parameters
Type | Name | Description |
---|---|---|
LogLevel | logLevel | the log level to set |
VersionAsync(CancellationToken)
Return the version of the connected InfluxDB Server.
Declaration
Task<string> VersionAsync(CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task<System.String> | the version String, otherwise unknown |
Exceptions
Type | Condition |
---|---|
InfluxException | throws when request did not succesfully ends |