Class QueryApi
Inheritance
Implements
Namespace: InfluxDB.Client
Assembly: InfluxDB.Client.dll
Syntax
public class QueryApi : AbstractQueryClient, IQueryApi
Constructors
QueryApi(InfluxDBClientOptions, QueryService, IFluxResultMapper)
Declaration
protected QueryApi(InfluxDBClientOptions options, QueryService service, IFluxResultMapper mapper)
Parameters
| Type | Name | Description |
|---|---|---|
| InfluxDBClientOptions | options | |
| QueryService | service | |
| InfluxDB.Client.Core.Flux.Internal.IFluxResultMapper | mapper |
Fields
Dialect
Declaration
public static readonly Dialect Dialect
Field Value
| Type | Description |
|---|---|
| Dialect |
Methods
AfterIntercept<T>(Int32, Func<IEnumerable<HeaderParameter>>, T)
Declaration
protected override T AfterIntercept<T>(int statusCode, Func<IEnumerable<HeaderParameter>> headers, T body)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | statusCode | |
| Func<IEnumerable<HeaderParameter>> | headers | |
| T | body |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
BeforeIntercept(RestRequest)
Declaration
protected override void BeforeIntercept(RestRequest request)
Parameters
| Type | Name | Description |
|---|---|---|
| RestRequest | request |
QueryAsync(Query, Action<FluxRecord>, Action<Exception>, Action, String, CancellationToken)
Executes the Flux query against the InfluxDB 2.x and asynchronously stream FluxRecord
to
Declaration
public Task QueryAsync(Query query, Action<FluxRecord> onNext, Action<Exception> onError = null, Action onComplete = null, string org = null, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Query | 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 |
| System.String | org | specifies the source organization. If the org is not specified then is used config from Org. |
| CancellationToken | cancellationToken | Token that enables callers to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task | async task |
QueryAsync(Query, String, CancellationToken)
Executes the Flux query against the InfluxDB 2.x and synchronously map whole response to FluxTables.
NOTE: This method is not intended for large query results.
Use
Declaration
public async Task<List<FluxTable>> QueryAsync(Query query, string org = null, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Query | query | the flux query to execute |
| System.String | org | specifies the source organization. If the org is not specified then is used config from Org. |
| CancellationToken | cancellationToken | Token that enables callers to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task<List<FluxTable>> | FluxTables that are matched the query |
QueryAsync(Query, Type, Action<Object>, Action<Exception>, Action, String, CancellationToken)
Executes the Flux query against the InfluxDB 2.x and asynchronously stream Measurements
to a
Declaration
public Task QueryAsync(Query query, Type pocoType, Action<object> onNext, Action<Exception> onError = null, Action onComplete = null, string org = null, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Query | query | the flux query to execute |
| Type | pocoType | the type of measurement |
| Action<System.Object> | onNext | the callback to consume the mapped Measurements |
| Action<Exception> | onError | the callback to consume any error notification |
| Action | onComplete | the callback to consume a notification about successfully end of stream |
| System.String | org | specifies the source organization. If the org is not specified then is used config from Org. |
| CancellationToken | cancellationToken | Token that enables callers to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task | async task |
QueryAsync(Query, Type, String, CancellationToken)
Executes the Flux query against the InfluxDB 2.x and synchronously map whole response to list of object with given type.
NOTE: This method is not intended for large query results.
Use
Declaration
public async Task<List<object>> QueryAsync(Query query, Type pocoType, string org = null, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Query | query | the flux query to execute |
| Type | pocoType | the type of measurement |
| System.String | org | the organization |
| CancellationToken | cancellationToken | Token that enables callers to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task<List<System.Object>> | Measurements which are matched the query |
QueryAsync(String, Action<FluxRecord>, Action<Exception>, Action, String, CancellationToken)
Executes the Flux query against the InfluxDB 2.x and asynchronously stream FluxRecord
to
Declaration
public Task QueryAsync(string query, Action<FluxRecord> onNext, Action<Exception> onError = null, Action onComplete = null, string org = 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 |
| System.String | org | specifies the source organization. If the org is not specified then is used config from Org. |
| CancellationToken | cancellationToken | Token that enables callers to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task | async task |
QueryAsync(String, String, CancellationToken)
Executes the Flux query against the InfluxDB 2.x and synchronously map whole response to FluxTables.
NOTE: This method is not intended for large query results.
Use
Declaration
public Task<List<FluxTable>> QueryAsync(string query, string org = null, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | query | the flux query to execute |
| System.String | org | specifies the source organization. If the org is not specified then is used config from Org. |
| CancellationToken | cancellationToken | Token that enables callers to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task<List<FluxTable>> | FluxTables that are matched the query |
QueryAsync(String, Type, Action<Object>, Action<Exception>, Action, String, CancellationToken)
Executes the Flux query against the InfluxDB 2.x and asynchronously stream Measurements
to a
Declaration
public Task QueryAsync(string query, Type pocoType, Action<object> onNext, Action<Exception> onError = null, Action onComplete = null, string org = null, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | query | the flux query to execute |
| Type | pocoType | the type of measurement |
| Action<System.Object> | onNext | the callback to consume the mapped Measurements |
| Action<Exception> | onError | the callback to consume any error notification |
| Action | onComplete | the callback to consume a notification about successfully end of stream |
| System.String | org | specifies the source organization. If the org is not specified then is used config from Org. |
| CancellationToken | cancellationToken | Token that enables callers to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task | async task |
QueryAsync(String, Type, String, CancellationToken)
Executes the Flux query against the InfluxDB 2.x and synchronously map whole response to list of object with given type.
NOTE: This method is not intended for large query results.
Use
Declaration
public Task<List<object>> QueryAsync(string query, Type pocoType, string org = null, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | query | the flux query to execute |
| Type | pocoType | the type of measurement |
| System.String | org | the organization |
| CancellationToken | cancellationToken | Token that enables callers to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task<List<System.Object>> | Measurements which are matched the query |
QueryAsync<T>(Query, Action<T>, Action<Exception>, Action, String, CancellationToken)
Executes the Flux query against the InfluxDB 2.x and asynchronously stream Measurements
to a
Declaration
public Task QueryAsync<T>(Query query, Action<T> onNext, Action<Exception> onError = null, Action onComplete = null, string org = null, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Query | query | the flux query to execute |
| Action<T> | onNext | the callback to consume the mapped Measurements |
| Action<Exception> | onError | the callback to consume any error notification |
| Action | onComplete | the callback to consume a notification about successfully end of stream |
| System.String | org | specifies the source organization |
| 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>(Query, String, CancellationToken)
Executes the Flux query against the InfluxDB 2.x and synchronously map whole response to list of object with given type.
NOTE: This method is not intended for large query results.
Use
Declaration
public async Task<List<T>> QueryAsync<T>(Query query, string org = null, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Query | query | the flux query to execute |
| System.String | org | specifies the source organization. If the org is not specified then is used config from Org. |
| CancellationToken | cancellationToken | Token that enables callers to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task<List<T>> | Measurements which are matched the query |
Type Parameters
| Name | Description |
|---|---|
| T | the type of measurement |
QueryAsync<T>(String, Action<T>, Action<Exception>, Action, String, CancellationToken)
Executes the Flux query against the InfluxDB 2.x and asynchronously stream Measurements
to a
Declaration
public Task QueryAsync<T>(string query, Action<T> onNext, Action<Exception> onError = null, Action onComplete = null, string org = null, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | query | the flux query to execute |
| Action<T> | onNext | the callback to consume the mapped Measurements |
| Action<Exception> | onError | the callback to consume any error notification |
| Action | onComplete | the callback to consume a notification about successfully end of stream |
| System.String | org | specifies the source organization |
| 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, String, CancellationToken)
Executes the Flux query against the InfluxDB 2.x and synchronously map whole response to list of object with given type.
NOTE: This method is not intended for large query results.
Use
Declaration
public Task<List<T>> QueryAsync<T>(string query, string org = null, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | query | the flux query to execute |
| System.String | org | specifies the source organization. If the org is not specified then is used config from Org. |
| CancellationToken | cancellationToken | Token that enables callers to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task<List<T>> | Measurements which are matched the query |
Type Parameters
| Name | Description |
|---|---|
| T | the type of measurement |
QueryAsyncEnumerable<T>(Query, String, CancellationToken)
Executes the Flux query against the InfluxDB 2.x and asynchronously maps
response to enumerable of objects of type T.
Declaration
public async IAsyncEnumerable<T> QueryAsyncEnumerable<T>(Query query, string org = null, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Query | query | the flux query to execute |
| System.String | org | specifies the source organization. If the org is not specified then is used config from Org. |
| CancellationToken | cancellationToken | cancellation token |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<T> | Measurements which are matched the query |
Type Parameters
| Name | Description |
|---|---|
| T | the type of measurement |
QueryAsyncEnumerable<T>(String, String, CancellationToken)
Executes the Flux query against the InfluxDB 2.x and asynchronously maps
response to enumerable of objects of type T.
Declaration
public async IAsyncEnumerable<T> QueryAsyncEnumerable<T>(string query, string org = null, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | query | the flux query to execute |
| System.String | org | specifies the source organization. If the org is not specified then is used config from Org. |
| CancellationToken | cancellationToken | cancellation token |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<T> | Measurements which are matched the query |
Type Parameters
| Name | Description |
|---|---|
| T | the type of measurement |
QueryRawAsync(Query, Action<String>, Action<Exception>, Action, String, CancellationToken)
Executes the Flux query against the InfluxDB 2.x and asynchronously stream response
(line by line) to
Declaration
public Task QueryRawAsync(Query query, Action<string> onResponse, Action<Exception> onError = null, Action onComplete = null, string org = null, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Query | query | the flux query to execute |
| Action<System.String> | onResponse | the callback to consume the response line by line |
| Action<Exception> | onError | callback to consume any error notification |
| Action | onComplete | callback to consume a notification about successfully end of stream |
| System.String | org | specifies the source organization. If the org is not specified then is used config from Org. |
| CancellationToken | cancellationToken | Token that enables callers to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task |
QueryRawAsync(Query, String, CancellationToken)
Executes the Flux query against the InfluxDB and synchronously map whole response to
NOTE: This method is not intended for large query results.
Use
Declaration
public async Task<string> QueryRawAsync(Query query, string org = null, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Query | query | the flux query to execute |
| System.String | org | specifies the source organization. If the org is not specified then is used config from Org. |
| CancellationToken | cancellationToken | Token that enables callers to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task<System.String> | the raw response that matched the query |
QueryRawAsync(String, Action<String>, Dialect, Action<Exception>, Action, String, CancellationToken)
Executes the Flux query against the InfluxDB 2.x and asynchronously stream response
(line by line) to
Declaration
public Task QueryRawAsync(string query, Action<string> onResponse, Dialect dialect = null, Action<Exception> onError = null, Action onComplete = null, string org = 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 |
| Dialect | dialect | Dialect is an object defining the options to use when encoding the response. See dialect SPEC. |
| Action<Exception> | onError | callback to consume any error notification |
| Action | onComplete | callback to consume a notification about successfully end of stream |
| System.String | org | specifies the source organization. If the org is not specified then is used config from Org. |
| CancellationToken | cancellationToken | Token that enables callers to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task |
QueryRawAsync(String, Dialect, String, CancellationToken)
Executes the Flux query against the InfluxDB and synchronously map whole response to
NOTE: This method is not intended for large query results.
Use
Declaration
public Task<string> QueryRawAsync(string query, Dialect dialect = null, string org = null, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | query | the flux query to execute |
| Dialect | dialect | Dialect is an object defining the options to use when encoding the response. See dialect SPEC. |
| System.String | org | specifies the source organization. If the org is not specified then is used config from Org. |
| CancellationToken | cancellationToken | Token that enables callers to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task<System.String> | the raw response that matched the query |