Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ziyasal/InfluxDB.Net
Cross-platform .NET library for InfluxDB distributed time-series database.
https://github.com/ziyasal/InfluxDB.Net
c-sharp influxdb time-series
Last synced: 3 months ago
JSON representation
Cross-platform .NET library for InfluxDB distributed time-series database.
- Host: GitHub
- URL: https://github.com/ziyasal/InfluxDB.Net
- Owner: bugthesystem
- License: unlicense
- Created: 2014-09-07T17:38:54.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2022-06-22T15:19:09.000Z (over 2 years ago)
- Last Synced: 2024-05-21T13:43:32.742Z (6 months ago)
- Topics: c-sharp, influxdb, time-series
- Language: C#
- Homepage:
- Size: 3.09 MB
- Stars: 162
- Watchers: 34
- Forks: 62
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-influxdb - InfluxDB.NET - .NET client for InfluxDB (Client libraries / Unofficial)
README
InfluxDB.Net
============>[InfluxDB](http://influxdb.com/) An open-source distributed time series database
with no external dependencies. It is the new home for all of your metrics, events, and analytics.A Portable .NET library to access the REST API of a [InfluxDB](http://influxdb.com/) database.
**Installation**
```sh
Install-Package InfluxDB.Net-Main
```**.NET Core Installation**
```sh
dotnet add package InfluxDB.Net.Core --version 1.1.22-beta
```**Versions of InfluxDB**
The currently supported versions of InfluxDB is 0.9 - 1.1. When creating a connection to the database you can specify the version to use, or the *auto* configuration that starts by determening the version.#### List of supported methods
- [Ping](#ping)
- [Version](#version)
- [CreateDatabase](#create-database)
- [DeleteDatabase](#delete-database)
- [DescribeDatabases](#describe-databases)
- [Write](#write)
- [Query](#query)
- CreateClusterAdmin(User user);
- DeleteClusterAdmin(string name);
- DescribeClusterAdmins();
- UpdateClusterAdmin(User user, string name);
- CreateDatabaseUser(string database, User user);
- DeleteDatabaseUser(string database, string name);
- DescribeDatabaseUsers(String database);
- UpdateDatabaseUser(string database, User user, string name);
- AuthenticateDatabaseUser(string database, string user, string password);
- GetContinuousQueries(String database);
- DeleteContinuousQuery(string database, int id);
- DeleteSeries(string database, string name);
- ForceRaftCompaction();
- Interfaces();
- Sync();
- ListServers();
- RemoveServers(int id);
- CreateShard(Shard shard);
- GetShards();
- DropShard(int id, Shard.Member servers);
- GetShardSpaces();
- DropShardSpace(string database, string name);
- CreateShardSpace(string database, ShardSpace shardSpace);## Ping
```csharp
var _client = new InfluxDb("http://...:8086", "root", "root");
Pong pong =await _client.PingAsync();
```
## Version
```csharp
var _client = new InfluxDb("http://...:8086", "root", "root");
string version =await _client.VersionAsync();
```
## Create Database
```csharp
var _client = new InfluxDb("http://...:8086", "root", "root");
InfluxDbApiCreateResponse response =await _client.CreateDatabaseAsync("MyDb");
//Or
InfluxDbApiCreateResponse response = await _client.CreateDatabaseAsync(new DatabaseConfiguration
{
Name = "MyDb"
});
```
## Delete Database
```csharp
var _client = new InfluxDb("http://...:8086", "root", "root");
InfluxDbApiDeleteResponse deleteResponse = await _client.DeleteDatabaseAsync("MyDb");
```
## Describe Databases
```csharp
var _client = new InfluxDb("http://...:8086", "root", "root");
List databases = await _client.ShowDatabasesAsync();
```
## Write
```csharp
var _client = new InfluxDb("http://...:8086", "root", "root");
Serie serie = new Serie.Builder("testSeries")
.Columns("value1", "value2")
.Values(DateTime.Now.Millisecond, 5)
.Build();
InfluxDbApiResponse writeResponse =await _client.WriteAsync("MyDb", TimeUnit.Milliseconds, serie);
```## Query
```csharp
var _client = new InfluxDb("http://...:8086", "root", "root");
List series = await _client.QueryAsync("MyDb", "select * from testSeries"), TimeUnit.Milliseconds);
```## Bugs
If you encounter a bug, performance issue, or malfunction, please add an [Issue](https://github.com/pootzko/InfluxDB.Net/issues) with steps on how to reproduce the problem.##PowerShell Cmdlet
The *PowerShell Cmdlet* can be tested using the script *TestInfluxDb.ps1*.**Installation**
import-module [PATH]\InfluxDb -force**Open**
```
$db = Open-InfluxDb -Uri:"http://...:8086" -User:"root" -Password:"root"
```**Ping**
```
$pong = Ping-InfluxDb -Connection:$db
```**Add**
Adds a new database.
```
Add-InfluxDb -Connection:$db -Name:"SomeDatabase"
```**Write**
*Not yet implemented*
```
Write-InfluxDb
```