InfluxDB.Client.Flux 4.10.0-dev.9693

.NET Standard 2.0
This is a prerelease version of InfluxDB.Client.Flux.
There is a newer version of this package available.
See the version list below for details.
dotnet add package InfluxDB.Client.Flux --version 4.10.0-dev.9693
NuGet\Install-Package InfluxDB.Client.Flux -Version 4.10.0-dev.9693
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="InfluxDB.Client.Flux" Version="4.10.0-dev.9693" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add InfluxDB.Client.Flux --version 4.10.0-dev.9693
#r "nuget: InfluxDB.Client.Flux, 4.10.0-dev.9693"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install InfluxDB.Client.Flux as a Cake Addin
#addin nuget:?package=InfluxDB.Client.Flux&version=4.10.0-dev.9693&prerelease

// Install InfluxDB.Client.Flux as a Cake Tool
#tool nuget:?package=InfluxDB.Client.Flux&version=4.10.0-dev.9693&prerelease

InfluxDB.Client.Flux

Nuget

The reference C# library for the InfluxDB 1.7+ /api/v2/query REST API using the Flux language.

Documentation

This section contains links to the client library documentation.

How To Use

Create client

The FluxClientFactory creates an instance of a FluxClient client that can be customized with FluxConnectionOptions.

FluxConnectionOptions parameters:

  • url - the url to connect to InfluxDB
  • okHttpClient - custom HTTP client to use for communications with InfluxDB (optional)
  • username - name of your InfluxDB user (optional)
  • password - password of your InfluxDB user (optional)
  • authentication - type of authentication (optional). There are two options for authenticating: Basic Authentication and the URL query parameters (default).
// client creation
var options = new FluxConnectionOptions("http://127.0.0.1:8086");

using var client = new FluxClient(options);

client.QueryAsync(...)
...
Authenticate requests
URL query parameters
// client creation
var options = new FluxConnectionOptions("http://127.0.0.1:8086", "my-user", "my-password".ToCharArray());

using var client = new FluxClient(options);

client.QueryAsync(...)
...
Basic authentication
// client creation
var options = new FluxConnectionOptions("http://127.0.0.1:8086", "my-user", "my-password".ToCharArray(),
    FluxConnectionOptions.AuthenticationType.BasicAuthentication);

using var client = new FluxClient(options);

client.QueryAsync(...)
...

Query using the Flux language

The library supports an asynchronous queries.

The asynchronous query API allows streaming of FluxRecords with the possibility of implementing custom error handling and OnComplete callback notification.

A CancellationToken object is used for aborting a query while processing.

A query example:

string fluxQuery = "from(bucket: \"telegraf\")\n" +
    " |> filter(fn: (r) => (r[\"_measurement\"] == \"cpu\" AND r[\"_field\"] == \"usage_system\"))" +
    " |> range(start: -1d)" +
    " |> sample(n: 5, pos: 1)";
    
var source = new CancellationTokenSource();

fluxClient.QueryAsync(fluxQuery, record =>
            {
                // process the flux query records
                Console.WriteLine(record.GetTime() + ": " + record.GetValue());
                
                if (some condition) 
                {
                    // abort processing
                    source.Cancel();
                }
            },
            (error) =>
            {
                // error handling while processing result
                Console.WriteLine($"Error occured: {error}");
            }, 
            () =>
            {
                // on complete
                Console.WriteLine("Query completed");
            }, source.Token).ConfigureAwait(false).GetAwaiter().GetResult();
Raw query response

It is possible to parse a result line-by-line using the QueryRaw method.

void QueryRawAsync(string query, Action<string> onResponse, string dialect = null, Action<Exception> onError = null, Action onComplete = null, CancellationToken cancellationToken = default);

Advanced Usage

Check the server status and version

Server availability can be checked using the FluxClient.PingAsync() endpoint. Server version can be obtained using FluxClient.VersionAsync().

Log HTTP Request and Response

The Requests and Responses can be logged by changing the LogLevel. LogLevel values are None, Basic, Headers, Body. Note that applying the Body LogLevel will disable chunking while streaming and will load the whole response into memory.

client.SetLogLevel(LogLevel.Body)

Version

The latest package for .NET CLI:

dotnet add package InfluxDB.Client.Flux

Or when using with Package Manager:

Install-Package InfluxDB.Client.Flux
Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on InfluxDB.Client.Flux:

Package Downloads
SpmisNet.Data

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
4.11.0-dev.10059 21 1/26/2023
4.10.0 22 1/26/2023
4.10.0-dev.10033 29 1/25/2023
4.10.0-dev.10032 30 1/25/2023
4.10.0-dev.10031 30 1/25/2023
4.10.0-dev.9936 123 12/26/2022
4.10.0-dev.9935 36 12/26/2022
4.10.0-dev.9881 39 12/21/2022
4.10.0-dev.9880 39 12/21/2022
4.10.0-dev.9818 41 12/16/2022
4.10.0-dev.9773 38 12/12/2022
4.10.0-dev.9756 38 12/12/2022
4.10.0-dev.9693 40 12/6/2022
4.9.0 751 12/6/2022
4.9.0-dev.9684 41 12/6/2022
4.9.0-dev.9666 41 12/6/2022
4.9.0-dev.9617 39 12/6/2022
4.9.0-dev.9478 40 12/5/2022
4.9.0-dev.9469 38 12/5/2022
4.9.0-dev.9444 36 12/5/2022
4.9.0-dev.9411 43 12/5/2022
4.9.0-dev.9350 41 12/1/2022
4.8.0 278 12/1/2022
4.8.0-dev.9324 42 11/30/2022
4.8.0-dev.9232 189 11/28/2022
4.8.0-dev.9223 40 11/28/2022
4.8.0-dev.9222 39 11/28/2022
4.8.0-dev.9117 44 11/21/2022
4.8.0-dev.9108 41 11/21/2022
4.8.0-dev.9099 41 11/21/2022
4.8.0-dev.9029 44 11/16/2022
4.8.0-dev.8971 43 11/15/2022
4.8.0-dev.8961 43 11/14/2022
4.8.0-dev.8928 43 11/14/2022
4.8.0-dev.8899 41 11/14/2022
4.8.0-dev.8898 41 11/14/2022
4.8.0-dev.8839 43 11/14/2022
4.8.0-dev.8740 42 11/7/2022
4.8.0-dev.8725 41 11/7/2022
4.8.0-dev.8648 44 11/3/2022
4.7.0 906 11/3/2022
4.7.0-dev.8625 42 11/2/2022
4.7.0-dev.8594 45 10/31/2022
4.7.0-dev.8579 40 10/31/2022
4.7.0-dev.8557 42 10/31/2022
4.7.0-dev.8540 41 10/31/2022
4.7.0-dev.8518 44 10/31/2022
4.7.0-dev.8517 43 10/31/2022
4.7.0-dev.8509 42 10/31/2022
4.7.0-dev.8377 47 10/26/2022
4.7.0-dev.8360 46 10/25/2022
4.7.0-dev.8350 49 10/24/2022
4.7.0-dev.8335 49 10/24/2022
4.7.0-dev.8334 48 10/24/2022
4.7.0-dev.8223 75 10/19/2022
4.7.0-dev.8178 40 10/17/2022
4.7.0-dev.8170 39 10/17/2022
4.7.0-dev.8148 39 10/17/2022
4.7.0-dev.8133 39 10/17/2022
4.7.0-dev.8097 40 10/17/2022
4.7.0-dev.8034 49 10/11/2022
4.7.0-dev.8025 44 10/11/2022
4.7.0-dev.8009 45 10/10/2022
4.7.0-dev.8001 45 10/10/2022
4.7.0-dev.7959 46 10/4/2022
4.7.0-dev.7905 47 9/30/2022
4.7.0-dev.7875 43 9/29/2022
4.6.0 1,096 9/29/2022
4.6.0-dev.7832 47 9/29/2022
4.6.0-dev.7817 44 9/29/2022
4.6.0-dev.7779 51 9/27/2022
4.6.0-dev.7778 50 9/27/2022
4.6.0-dev.7734 48 9/26/2022
4.6.0-dev.7733 46 9/26/2022
4.6.0-dev.7677 47 9/20/2022
4.6.0-dev.7650 55 9/16/2022
4.6.0-dev.7626 95 9/14/2022
4.6.0-dev.7618 91 9/14/2022
4.6.0-dev.7574 55 9/13/2022
4.6.0-dev.7572 53 9/13/2022
4.6.0-dev.7528 51 9/12/2022
4.6.0-dev.7502 53 9/9/2022
4.6.0-dev.7479 69 9/8/2022
4.6.0-dev.7471 64 9/8/2022
4.6.0-dev.7447 49 9/7/2022
4.6.0-dev.7425 46 9/7/2022
4.6.0-dev.7395 49 9/6/2022
4.6.0-dev.7344 50 8/31/2022
4.6.0-dev.7329 42 8/31/2022
4.6.0-dev.7292 45 8/30/2022
4.6.0-dev.7240 47 8/29/2022
4.5.0 1,300 8/29/2022
4.5.0-dev.7216 52 8/27/2022
4.5.0-dev.7147 54 8/22/2022
4.5.0-dev.7134 58 8/17/2022
4.5.0-dev.7096 59 8/15/2022
4.5.0-dev.7070 60 8/11/2022
4.5.0-dev.7040 73 8/10/2022
4.5.0-dev.7011 60 8/3/2022
4.5.0-dev.6987 59 8/1/2022
4.5.0-dev.6962 65 7/29/2022
4.4.0 1,117 7/29/2022
4.4.0-dev.6901 65 7/25/2022
4.4.0-dev.6843 66 7/19/2022
4.4.0-dev.6804 59 7/19/2022
4.4.0-dev.6789 59 7/19/2022
4.4.0-dev.6760 61 7/19/2022
4.4.0-dev.6705 67 7/14/2022
4.4.0-dev.6663 65 6/24/2022
4.4.0-dev.6655 69 6/24/2022
4.3.0 1,287 6/24/2022
4.3.0-dev.multiple.buckets3 86 6/21/2022
4.3.0-dev.multiple.buckets2 60 6/17/2022
4.3.0-dev.multiple.buckets1 59 6/17/2022
4.3.0-dev.6631 65 6/22/2022
4.3.0-dev.6623 64 6/22/2022
4.3.0-dev.6374 67 6/13/2022
4.3.0-dev.6286 71 5/20/2022
4.2.0 951 5/20/2022
4.2.0-dev.6257 84 5/13/2022
4.2.0-dev.6248 65 5/12/2022
4.2.0-dev.6233 70 5/12/2022
4.2.0-dev.6194 69 5/10/2022
4.2.0-dev.6193 65 5/10/2022
4.2.0-dev.6158 70 5/6/2022
4.2.0-dev.6135 69 5/6/2022
4.2.0-dev.6091 79 4/28/2022
4.2.0-dev.6048 78 4/28/2022
4.2.0-dev.6047 75 4/28/2022
4.2.0-dev.5966 69 4/25/2022
4.2.0-dev.5938 72 4/19/2022
4.1.0 697 4/19/2022
4.1.0-dev.5910 76 4/13/2022
4.1.0-dev.5888 73 4/13/2022
4.1.0-dev.5887 78 4/13/2022
4.1.0-dev.5794 85 4/6/2022
4.1.0-dev.5725 77 3/18/2022
4.0.0 686 3/18/2022
4.0.0-rc3 93 3/4/2022
4.0.0-rc2 79 2/25/2022
4.0.0-rc1 78 2/18/2022
4.0.0-dev.5709 78 3/18/2022
4.0.0-dev.5684 75 3/15/2022
4.0.0-dev.5630 79 3/4/2022
4.0.0-dev.5607 79 3/3/2022
4.0.0-dev.5579 73 2/25/2022
4.0.0-dev.5556 80 2/24/2022
4.0.0-dev.5555 80 2/24/2022
4.0.0-dev.5497 74 2/23/2022
4.0.0-dev.5489 75 2/23/2022
4.0.0-dev.5460 78 2/23/2022
4.0.0-dev.5444 72 2/22/2022
4.0.0-dev.5333 74 2/17/2022
4.0.0-dev.5303 75 2/16/2022
4.0.0-dev.5280 80 2/16/2022
4.0.0-dev.5279 78 2/16/2022
4.0.0-dev.5241 74 2/15/2022
4.0.0-dev.5225 76 2/15/2022
4.0.0-dev.5217 76 2/15/2022
4.0.0-dev.5209 79 2/15/2022
4.0.0-dev.5200 79 2/14/2022
4.0.0-dev.5188 83 2/10/2022
4.0.0-dev.5180 80 2/10/2022
4.0.0-dev.5172 81 2/10/2022
4.0.0-dev.5130 71 2/10/2022
4.0.0-dev.5122 80 2/9/2022
4.0.0-dev.5103 83 2/9/2022
4.0.0-dev.5097 82 2/9/2022
4.0.0-dev.5091 81 2/9/2022
4.0.0-dev.5084 83 2/8/2022
3.4.0-dev.5263 77 2/15/2022
3.4.0-dev.4986 81 2/7/2022
3.4.0-dev.4968 93 2/4/2022
3.3.0 804 2/4/2022
3.3.0-dev.4889 91 2/3/2022
3.3.0-dev.4865 92 2/1/2022
3.3.0-dev.4823 90 1/19/2022
3.3.0-dev.4691 93 1/7/2022
3.3.0-dev.4557 1,385 11/26/2021
3.2.0 6,722 11/26/2021
3.2.0-dev.4533 4,743 11/24/2021
3.2.0-dev.4484 120 11/11/2021
3.2.0-dev.4475 135 11/10/2021
3.2.0-dev.4387 111 10/26/2021
3.2.0-dev.4363 122 10/22/2021
3.2.0-dev.4356 122 10/22/2021
3.1.0 1,385 10/22/2021
3.1.0-dev.4303 130 10/18/2021
3.1.0-dev.4293 123 10/15/2021
3.1.0-dev.4286 104 10/15/2021
3.1.0-dev.4240 141 10/12/2021
3.1.0-dev.4202 108 10/11/2021
3.1.0-dev.4183 143 10/11/2021
3.1.0-dev.4131 112 10/8/2021
3.1.0-dev.3999 117 10/5/2021
3.1.0-dev.3841 137 9/29/2021
3.1.0-dev.3798 117 9/17/2021
3.0.0 1,486 9/17/2021
3.0.0-dev.3726 453 8/31/2021
3.0.0-dev.3719 99 8/31/2021
3.0.0-dev.3671 128 8/20/2021
2.2.0-dev.3652 105 8/20/2021
2.1.0 677 8/20/2021
2.1.0-dev.3605 116 8/17/2021
2.1.0-dev.3584 128 8/16/2021
2.1.0-dev.3558 114 8/16/2021
2.1.0-dev.3527 155 7/29/2021
2.1.0-dev.3519 170 7/29/2021
2.1.0-dev.3490 107 7/20/2021
2.1.0-dev.3445 131 7/12/2021
2.1.0-dev.3434 170 7/9/2021
2.0.0 2,209 7/9/2021
2.0.0-dev.3401 150 6/25/2021
2.0.0-dev.3368 136 6/23/2021
2.0.0-dev.3361 141 6/23/2021
2.0.0-dev.3330 137 6/17/2021
2.0.0-dev.3291 141 6/16/2021
1.20.0-dev.3218 165 6/4/2021
1.19.0 3,514 6/4/2021
1.19.0-dev.3204 134 6/3/2021
1.19.0-dev.3160 121 6/2/2021
1.19.0-dev.3159 121 6/2/2021
1.19.0-dev.3084 160 5/7/2021
1.19.0-dev.3051 133 5/5/2021
1.19.0-dev.3044 141 5/5/2021
1.19.0-dev.3008 136 4/30/2021
1.18.0 3,365 4/30/2021
1.18.0-dev.2973 126 4/27/2021
1.18.0-dev.2930 131 4/16/2021
1.18.0-dev.2919 121 4/13/2021
1.18.0-dev.2893 113 4/12/2021
1.18.0-dev.2880 115 4/12/2021
1.18.0-dev.2856 126 4/7/2021
1.18.0-dev.2830 135 4/1/2021
1.18.0-dev.2816 135 4/1/2021
1.17.0 896 4/1/2021
1.17.0-dev.linq.17 158 3/18/2021
1.17.0-dev.linq.16 124 3/16/2021
1.17.0-dev.linq.15 139 3/15/2021
1.17.0-dev.linq.14 155 3/12/2021
1.17.0-dev.linq.13 159 3/11/2021
1.17.0-dev.linq.12 135 3/10/2021
1.17.0-dev.linq.11 123 3/8/2021
1.17.0-dev.2776 150 3/26/2021
1.17.0-dev.2713 123 3/25/2021
1.17.0-dev.2707 126 3/25/2021
1.17.0-dev.2652 174 3/19/2021
1.17.0-dev.2619 122 3/18/2021
1.17.0-dev.2566 119 3/16/2021
1.17.0-dev.2549 129 3/15/2021
1.17.0-dev.2505 155 3/12/2021
1.17.0-dev.2446 152 3/11/2021
1.17.0-dev.2402 146 3/8/2021
1.17.0-dev.2371 131 3/5/2021
1.16.0 926 3/5/2021
1.16.0-dev.linq.10 160 2/4/2021
1.16.0-dev.linq.9 153 2/4/2021
1.16.0-dev.2359 163 3/4/2021
1.16.0-dev.2273 133 2/12/2021
1.16.0-dev.2255 139 2/11/2021
1.16.0-dev.2228 145 2/5/2021
1.16.0-dev.2147 143 1/29/2021
1.15.0 929 1/29/2021
1.15.0-dev.linq.8 125 1/28/2021
1.15.0-dev.linq.7 145 1/27/2021
1.15.0-dev.linq.6 160 1/20/2021
1.15.0-dev.linq.5 185 1/19/2021
1.15.0-dev.linq.4 154 1/15/2021
1.15.0-dev.linq.3 124 1/14/2021
1.15.0-dev.linq.2 135 1/13/2021
1.15.0-dev.linq.1 155 1/12/2021
1.15.0-dev.2135 129 1/28/2021
1.15.0-dev.2009 144 1/19/2021
1.15.0-dev.1793 139 1/11/2021
1.15.0-dev.1753 174 1/7/2021
1.15.0-dev.1752 184 1/7/2021
1.15.0-dev.1705 230 12/16/2020
1.15.0-dev.1677 218 12/4/2020
1.14.0 1,170 12/4/2020
1.14.0-dev.1665 187 12/3/2020
1.14.0-dev.1648 189 12/2/2020
1.14.0-dev.1632 160 11/27/2020
1.14.0-dev.1577 249 10/30/2020
1.14.0-dev.1571 249 10/30/2020
1.13.0 641 10/30/2020
1.13.0-dev.1545 210 10/15/2020
1.13.0-dev.1516 189 10/8/2020
1.13.0-dev.1489 208 10/2/2020
1.13.0-dev.1478 244 10/2/2020
1.12.0 7,864 10/2/2020
1.12.0-dev.1466 175 10/1/2020
1.12.0-dev.1421 207 9/23/2020
1.12.0-dev.1345 250 9/18/2020
1.12.0-dev.1306 253 9/15/2020
1.12.0-dev.1251 206 9/2/2020
1.12.0-dev.1216 216 8/14/2020
1.11.0 2,248 8/14/2020
1.11.0-dev.1205 227 8/14/2020
1.11.0-dev.1185 223 8/10/2020
1.11.0-dev.1166 260 7/28/2020
1.11.0-dev.1150 231 7/28/2020
1.11.0-dev.1144 244 7/28/2020
1.11.0-dev.1125 207 7/20/2020
1.11.0-dev.1111 231 7/17/2020
1.10.0 1,597 7/17/2020
1.10.0-dev.1098 204 7/15/2020
1.10.0-dev.1077 227 7/10/2020
1.10.0-dev.1049 214 6/29/2020
1.10.0-dev.1022 231 6/23/2020
1.10.0-dev.1021 233 6/23/2020
1.10.0-dev.990 234 6/19/2020
1.9.0 881 6/19/2020
1.9.0-dev.984 251 6/19/2020
1.9.0-dev.971 209 6/17/2020
1.9.0-dev.955 222 6/17/2020
1.9.0-dev.886 228 6/10/2020
1.9.0-dev.848 203 6/8/2020
1.9.0-dev.842 208 6/8/2020
1.9.0-dev.836 209 6/8/2020
1.9.0-dev.786 222 5/27/2020
1.9.0-dev.762 230 5/15/2020
1.8.0 7,198 5/15/2020
1.8.0-dev.748 221 5/12/2020
1.8.0-dev.669 204 4/22/2020
1.8.0-dev.668 205 4/21/2020
1.8.0-dev.661 206 4/20/2020
1.8.0-dev.650 257 4/20/2020
1.8.0-dev.639 213 4/20/2020
1.8.0-dev.620 223 4/17/2020
1.7.0 611 4/17/2020
1.7.0-dev.608 226 4/16/2020
1.7.0-dev.574 207 4/14/2020
1.7.0-dev.563 211 4/14/2020
1.7.0-dev.534 223 4/6/2020
1.7.0-dev.528 226 4/6/2020
1.7.0-dev.512 255 4/3/2020
1.7.0-dev.495 222 3/30/2020
1.7.0-dev.469 241 3/13/2020
1.6.0 570 3/13/2020
1.6.0-dev.458 251 3/13/2020
1.6.0-dev.443 253 3/9/2020
1.6.0-dev.422 247 2/28/2020
1.6.0-dev.410 249 2/27/2020
1.6.0-dev.404 251 2/27/2020
1.6.0-dev.356 243 2/14/2020
1.5.0 567 2/14/2020
1.5.0-dev.349 236 2/14/2020
1.5.0-dev.341 236 2/12/2020
1.5.0-dev.312 236 1/22/2020
1.4.0 530 1/17/2020
1.3.0 544 12/6/2019
1.2.0 5,061 11/8/2019
1.1.0 520 10/11/2019
1.0.0 608 8/23/2019