InfluxDB.Client.Flux 4.8.0-dev.9324

.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.8.0-dev.9324
NuGet\Install-Package InfluxDB.Client.Flux -Version 4.8.0-dev.9324
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.8.0-dev.9324" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add InfluxDB.Client.Flux --version 4.8.0-dev.9324
#r "nuget: InfluxDB.Client.Flux, 4.8.0-dev.9324"
#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.8.0-dev.9324&prerelease

// Install InfluxDB.Client.Flux as a Cake Tool
#tool nuget:?package=InfluxDB.Client.Flux&version=4.8.0-dev.9324&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 net481
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 39 1/26/2023
4.10.0 257 1/26/2023
4.10.0-dev.10033 42 1/25/2023
4.10.0-dev.10032 38 1/25/2023
4.10.0-dev.10031 38 1/25/2023
4.10.0-dev.9936 275 12/26/2022
4.10.0-dev.9935 44 12/26/2022
4.10.0-dev.9881 47 12/21/2022
4.10.0-dev.9880 46 12/21/2022
4.10.0-dev.9818 46 12/16/2022
4.10.0-dev.9773 44 12/12/2022
4.10.0-dev.9756 44 12/12/2022
4.10.0-dev.9693 45 12/6/2022
4.9.0 831 12/6/2022
4.9.0-dev.9684 46 12/6/2022
4.9.0-dev.9666 46 12/6/2022
4.9.0-dev.9617 46 12/6/2022
4.9.0-dev.9478 46 12/5/2022
4.9.0-dev.9469 45 12/5/2022
4.9.0-dev.9444 41 12/5/2022
4.9.0-dev.9411 47 12/5/2022
4.9.0-dev.9350 48 12/1/2022
4.8.0 296 12/1/2022
4.8.0-dev.9324 48 11/30/2022
4.8.0-dev.9232 195 11/28/2022
4.8.0-dev.9223 45 11/28/2022
4.8.0-dev.9222 45 11/28/2022
4.8.0-dev.9117 51 11/21/2022
4.8.0-dev.9108 46 11/21/2022
4.8.0-dev.9099 47 11/21/2022
4.8.0-dev.9029 50 11/16/2022
4.8.0-dev.8971 49 11/15/2022
4.8.0-dev.8961 48 11/14/2022
4.8.0-dev.8928 49 11/14/2022
4.8.0-dev.8899 46 11/14/2022
4.8.0-dev.8898 47 11/14/2022
4.8.0-dev.8839 49 11/14/2022
4.8.0-dev.8740 45 11/7/2022
4.8.0-dev.8725 46 11/7/2022
4.8.0-dev.8648 49 11/3/2022
4.7.0 920 11/3/2022
4.7.0-dev.8625 45 11/2/2022
4.7.0-dev.8594 49 10/31/2022
4.7.0-dev.8579 43 10/31/2022
4.7.0-dev.8557 45 10/31/2022
4.7.0-dev.8540 45 10/31/2022
4.7.0-dev.8518 48 10/31/2022
4.7.0-dev.8517 46 10/31/2022
4.7.0-dev.8509 46 10/31/2022
4.7.0-dev.8377 51 10/26/2022
4.7.0-dev.8360 49 10/25/2022
4.7.0-dev.8350 52 10/24/2022
4.7.0-dev.8335 52 10/24/2022
4.7.0-dev.8334 52 10/24/2022
4.7.0-dev.8223 80 10/19/2022
4.7.0-dev.8178 46 10/17/2022
4.7.0-dev.8170 44 10/17/2022
4.7.0-dev.8148 46 10/17/2022
4.7.0-dev.8133 45 10/17/2022
4.7.0-dev.8097 46 10/17/2022
4.7.0-dev.8034 56 10/11/2022
4.7.0-dev.8025 51 10/11/2022
4.7.0-dev.8009 52 10/10/2022
4.7.0-dev.8001 51 10/10/2022
4.7.0-dev.7959 50 10/4/2022
4.7.0-dev.7905 50 9/30/2022
4.7.0-dev.7875 47 9/29/2022
4.6.0 1,114 9/29/2022
4.6.0-dev.7832 51 9/29/2022
4.6.0-dev.7817 48 9/29/2022
4.6.0-dev.7779 55 9/27/2022
4.6.0-dev.7778 55 9/27/2022
4.6.0-dev.7734 52 9/26/2022
4.6.0-dev.7733 49 9/26/2022
4.6.0-dev.7677 50 9/20/2022
4.6.0-dev.7650 59 9/16/2022
4.6.0-dev.7626 100 9/14/2022
4.6.0-dev.7618 96 9/14/2022
4.6.0-dev.7574 58 9/13/2022
4.6.0-dev.7572 56 9/13/2022
4.6.0-dev.7528 55 9/12/2022
4.6.0-dev.7502 57 9/9/2022
4.6.0-dev.7479 72 9/8/2022
4.6.0-dev.7471 68 9/8/2022
4.6.0-dev.7447 53 9/7/2022
4.6.0-dev.7425 51 9/7/2022
4.6.0-dev.7395 53 9/6/2022
4.6.0-dev.7344 54 8/31/2022
4.6.0-dev.7329 46 8/31/2022
4.6.0-dev.7292 49 8/30/2022
4.6.0-dev.7240 52 8/29/2022
4.5.0 1,315 8/29/2022
4.5.0-dev.7216 55 8/27/2022
4.5.0-dev.7147 57 8/22/2022
4.5.0-dev.7134 62 8/17/2022
4.5.0-dev.7096 64 8/15/2022
4.5.0-dev.7070 65 8/11/2022
4.5.0-dev.7040 77 8/10/2022
4.5.0-dev.7011 66 8/3/2022
4.5.0-dev.6987 64 8/1/2022
4.5.0-dev.6962 70 7/29/2022
4.4.0 1,164 7/29/2022
4.4.0-dev.6901 70 7/25/2022
4.4.0-dev.6843 70 7/19/2022
4.4.0-dev.6804 64 7/19/2022
4.4.0-dev.6789 64 7/19/2022
4.4.0-dev.6760 66 7/19/2022
4.4.0-dev.6705 72 7/14/2022
4.4.0-dev.6663 70 6/24/2022
4.4.0-dev.6655 73 6/24/2022
4.3.0 1,305 6/24/2022
4.3.0-dev.multiple.buckets3 90 6/21/2022
4.3.0-dev.multiple.buckets2 65 6/17/2022
4.3.0-dev.multiple.buckets1 64 6/17/2022
4.3.0-dev.6631 69 6/22/2022
4.3.0-dev.6623 68 6/22/2022
4.3.0-dev.6374 71 6/13/2022
4.3.0-dev.6286 75 5/20/2022
4.2.0 968 5/20/2022
4.2.0-dev.6257 89 5/13/2022
4.2.0-dev.6248 70 5/12/2022
4.2.0-dev.6233 75 5/12/2022
4.2.0-dev.6194 75 5/10/2022
4.2.0-dev.6193 71 5/10/2022
4.2.0-dev.6158 74 5/6/2022
4.2.0-dev.6135 74 5/6/2022
4.2.0-dev.6091 82 4/28/2022
4.2.0-dev.6048 81 4/28/2022
4.2.0-dev.6047 78 4/28/2022
4.2.0-dev.5966 72 4/25/2022
4.2.0-dev.5938 75 4/19/2022
4.1.0 712 4/19/2022
4.1.0-dev.5910 79 4/13/2022
4.1.0-dev.5888 76 4/13/2022
4.1.0-dev.5887 83 4/13/2022
4.1.0-dev.5794 88 4/6/2022
4.1.0-dev.5725 81 3/18/2022
4.0.0 700 3/18/2022
4.0.0-rc3 97 3/4/2022
4.0.0-rc2 83 2/25/2022
4.0.0-rc1 81 2/18/2022
4.0.0-dev.5709 81 3/18/2022
4.0.0-dev.5684 78 3/15/2022
4.0.0-dev.5630 83 3/4/2022
4.0.0-dev.5607 83 3/3/2022
4.0.0-dev.5579 76 2/25/2022
4.0.0-dev.5556 83 2/24/2022
4.0.0-dev.5555 84 2/24/2022
4.0.0-dev.5497 77 2/23/2022
4.0.0-dev.5489 79 2/23/2022
4.0.0-dev.5460 81 2/23/2022
4.0.0-dev.5444 75 2/22/2022
4.0.0-dev.5333 77 2/17/2022
4.0.0-dev.5303 78 2/16/2022
4.0.0-dev.5280 83 2/16/2022
4.0.0-dev.5279 81 2/16/2022
4.0.0-dev.5241 78 2/15/2022
4.0.0-dev.5225 79 2/15/2022
4.0.0-dev.5217 79 2/15/2022
4.0.0-dev.5209 83 2/15/2022
4.0.0-dev.5200 82 2/14/2022
4.0.0-dev.5188 87 2/10/2022
4.0.0-dev.5180 83 2/10/2022
4.0.0-dev.5172 84 2/10/2022
4.0.0-dev.5130 74 2/10/2022
4.0.0-dev.5122 83 2/9/2022
4.0.0-dev.5103 88 2/9/2022
4.0.0-dev.5097 86 2/9/2022
4.0.0-dev.5091 85 2/9/2022
4.0.0-dev.5084 86 2/8/2022
3.4.0-dev.5263 80 2/15/2022
3.4.0-dev.4986 84 2/7/2022
3.4.0-dev.4968 97 2/4/2022
3.3.0 819 2/4/2022
3.3.0-dev.4889 94 2/3/2022
3.3.0-dev.4865 95 2/1/2022
3.3.0-dev.4823 93 1/19/2022
3.3.0-dev.4691 96 1/7/2022
3.3.0-dev.4557 1,387 11/26/2021
3.2.0 6,848 11/26/2021
3.2.0-dev.4533 4,745 11/24/2021
3.2.0-dev.4484 122 11/11/2021
3.2.0-dev.4475 137 11/10/2021
3.2.0-dev.4387 113 10/26/2021
3.2.0-dev.4363 123 10/22/2021
3.2.0-dev.4356 125 10/22/2021
3.1.0 1,407 10/22/2021
3.1.0-dev.4303 132 10/18/2021
3.1.0-dev.4293 125 10/15/2021
3.1.0-dev.4286 106 10/15/2021
3.1.0-dev.4240 143 10/12/2021
3.1.0-dev.4202 110 10/11/2021
3.1.0-dev.4183 145 10/11/2021
3.1.0-dev.4131 114 10/8/2021
3.1.0-dev.3999 119 10/5/2021
3.1.0-dev.3841 139 9/29/2021
3.1.0-dev.3798 120 9/17/2021
3.0.0 1,504 9/17/2021
3.0.0-dev.3726 456 8/31/2021
3.0.0-dev.3719 101 8/31/2021
3.0.0-dev.3671 130 8/20/2021
2.2.0-dev.3652 107 8/20/2021
2.1.0 680 8/20/2021
2.1.0-dev.3605 118 8/17/2021
2.1.0-dev.3584 130 8/16/2021
2.1.0-dev.3558 116 8/16/2021
2.1.0-dev.3527 157 7/29/2021
2.1.0-dev.3519 172 7/29/2021
2.1.0-dev.3490 109 7/20/2021
2.1.0-dev.3445 133 7/12/2021
2.1.0-dev.3434 173 7/9/2021
2.0.0 2,217 7/9/2021
2.0.0-dev.3401 152 6/25/2021
2.0.0-dev.3368 139 6/23/2021
2.0.0-dev.3361 144 6/23/2021
2.0.0-dev.3330 139 6/17/2021
2.0.0-dev.3291 144 6/16/2021
1.20.0-dev.3218 168 6/4/2021
1.19.0 3,571 6/4/2021
1.19.0-dev.3204 136 6/3/2021
1.19.0-dev.3160 123 6/2/2021
1.19.0-dev.3159 124 6/2/2021
1.19.0-dev.3084 163 5/7/2021
1.19.0-dev.3051 135 5/5/2021
1.19.0-dev.3044 143 5/5/2021
1.19.0-dev.3008 138 4/30/2021
1.18.0 3,371 4/30/2021
1.18.0-dev.2973 128 4/27/2021
1.18.0-dev.2930 134 4/16/2021
1.18.0-dev.2919 123 4/13/2021
1.18.0-dev.2893 116 4/12/2021
1.18.0-dev.2880 118 4/12/2021
1.18.0-dev.2856 129 4/7/2021
1.18.0-dev.2830 137 4/1/2021
1.18.0-dev.2816 137 4/1/2021
1.17.0 898 4/1/2021
1.17.0-dev.linq.17 160 3/18/2021
1.17.0-dev.linq.16 127 3/16/2021
1.17.0-dev.linq.15 142 3/15/2021
1.17.0-dev.linq.14 158 3/12/2021
1.17.0-dev.linq.13 161 3/11/2021
1.17.0-dev.linq.12 138 3/10/2021
1.17.0-dev.linq.11 126 3/8/2021
1.17.0-dev.2776 152 3/26/2021
1.17.0-dev.2713 125 3/25/2021
1.17.0-dev.2707 128 3/25/2021
1.17.0-dev.2652 176 3/19/2021
1.17.0-dev.2619 124 3/18/2021
1.17.0-dev.2566 121 3/16/2021
1.17.0-dev.2549 131 3/15/2021
1.17.0-dev.2505 158 3/12/2021
1.17.0-dev.2446 154 3/11/2021
1.17.0-dev.2402 149 3/8/2021
1.17.0-dev.2371 133 3/5/2021
1.16.0 928 3/5/2021
1.16.0-dev.linq.10 162 2/4/2021
1.16.0-dev.linq.9 155 2/4/2021
1.16.0-dev.2359 164 3/4/2021
1.16.0-dev.2273 135 2/12/2021
1.16.0-dev.2255 141 2/11/2021
1.16.0-dev.2228 147 2/5/2021
1.16.0-dev.2147 145 1/29/2021
1.15.0 931 1/29/2021
1.15.0-dev.linq.8 127 1/28/2021
1.15.0-dev.linq.7 147 1/27/2021
1.15.0-dev.linq.6 163 1/20/2021
1.15.0-dev.linq.5 188 1/19/2021
1.15.0-dev.linq.4 155 1/15/2021
1.15.0-dev.linq.3 126 1/14/2021
1.15.0-dev.linq.2 136 1/13/2021
1.15.0-dev.linq.1 157 1/12/2021
1.15.0-dev.2135 132 1/28/2021
1.15.0-dev.2009 146 1/19/2021
1.15.0-dev.1793 143 1/11/2021
1.15.0-dev.1753 176 1/7/2021
1.15.0-dev.1752 185 1/7/2021
1.15.0-dev.1705 233 12/16/2020
1.15.0-dev.1677 220 12/4/2020
1.14.0 1,173 12/4/2020
1.14.0-dev.1665 190 12/3/2020
1.14.0-dev.1648 191 12/2/2020
1.14.0-dev.1632 162 11/27/2020
1.14.0-dev.1577 252 10/30/2020
1.14.0-dev.1571 251 10/30/2020
1.13.0 644 10/30/2020
1.13.0-dev.1545 213 10/15/2020
1.13.0-dev.1516 191 10/8/2020
1.13.0-dev.1489 210 10/2/2020
1.13.0-dev.1478 247 10/2/2020
1.12.0 7,866 10/2/2020
1.12.0-dev.1466 177 10/1/2020
1.12.0-dev.1421 209 9/23/2020
1.12.0-dev.1345 252 9/18/2020
1.12.0-dev.1306 255 9/15/2020
1.12.0-dev.1251 208 9/2/2020
1.12.0-dev.1216 218 8/14/2020
1.11.0 2,252 8/14/2020
1.11.0-dev.1205 229 8/14/2020
1.11.0-dev.1185 226 8/10/2020
1.11.0-dev.1166 263 7/28/2020
1.11.0-dev.1150 234 7/28/2020
1.11.0-dev.1144 247 7/28/2020
1.11.0-dev.1125 209 7/20/2020
1.11.0-dev.1111 233 7/17/2020
1.10.0 1,610 7/17/2020
1.10.0-dev.1098 207 7/15/2020
1.10.0-dev.1077 230 7/10/2020
1.10.0-dev.1049 216 6/29/2020
1.10.0-dev.1022 234 6/23/2020
1.10.0-dev.1021 235 6/23/2020
1.10.0-dev.990 236 6/19/2020
1.9.0 886 6/19/2020
1.9.0-dev.984 252 6/19/2020
1.9.0-dev.971 211 6/17/2020
1.9.0-dev.955 224 6/17/2020
1.9.0-dev.886 230 6/10/2020
1.9.0-dev.848 205 6/8/2020
1.9.0-dev.842 210 6/8/2020
1.9.0-dev.836 211 6/8/2020
1.9.0-dev.786 226 5/27/2020
1.9.0-dev.762 232 5/15/2020
1.8.0 7,249 5/15/2020
1.8.0-dev.748 223 5/12/2020
1.8.0-dev.669 207 4/22/2020
1.8.0-dev.668 207 4/21/2020
1.8.0-dev.661 208 4/20/2020
1.8.0-dev.650 259 4/20/2020
1.8.0-dev.639 215 4/20/2020
1.8.0-dev.620 226 4/17/2020
1.7.0 613 4/17/2020
1.7.0-dev.608 227 4/16/2020
1.7.0-dev.574 210 4/14/2020
1.7.0-dev.563 213 4/14/2020
1.7.0-dev.534 226 4/6/2020
1.7.0-dev.528 229 4/6/2020
1.7.0-dev.512 258 4/3/2020
1.7.0-dev.495 224 3/30/2020
1.7.0-dev.469 243 3/13/2020
1.6.0 572 3/13/2020
1.6.0-dev.458 253 3/13/2020
1.6.0-dev.443 255 3/9/2020
1.6.0-dev.422 250 2/28/2020
1.6.0-dev.410 251 2/27/2020
1.6.0-dev.404 254 2/27/2020
1.6.0-dev.356 245 2/14/2020
1.5.0 569 2/14/2020
1.5.0-dev.349 239 2/14/2020
1.5.0-dev.341 238 2/12/2020
1.5.0-dev.312 240 1/22/2020
1.4.0 532 1/17/2020
1.3.0 546 12/6/2019
1.2.0 5,063 11/8/2019
1.1.0 522 10/11/2019
1.0.0 610 8/23/2019