Skip to content

Commit

Permalink
Update InfluxData.Net to the newest version
Browse files Browse the repository at this point in the history
This requires modifying the signature to all of the .Client calls to flip the database and query parameters.
  • Loading branch information
byronwall committed Sep 25, 2017
1 parent 40d7d3d commit 9e76691
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 47 deletions.
10 changes: 7 additions & 3 deletions src/CymaticLabs.InfluxDB.Studio/App.config
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="CymaticLabs.InfluxDB.Studio.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.1" newVersion="4.1.1.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<userSettings>
Expand Down Expand Up @@ -57,4 +61,4 @@
<level value="DEBUG" />
</root>
</log4net>
</configuration>
</configuration>
40 changes: 32 additions & 8 deletions src/CymaticLabs.InfluxDB.Studio/CymaticLabs.InfluxDB.Studio.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CymaticLabs.InfluxDB.Studio</RootNamespace>
<AssemblyName>InfluxDBStudio</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
<AssemblyVersion>0.1.2.0</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -35,16 +37,20 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="InfluxData.Net, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\InfluxData.Net.7.0.3\lib\net461\InfluxData.Net.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="InfluxData.Net.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\InfluxData.Net.6.0.0\lib\InfluxData.Net.Common.dll</HintPath>
<HintPath>..\..\packages\InfluxData.Net.7.0.3\lib\net461\InfluxData.Net.Common.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="InfluxData.Net.InfluxDb, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\InfluxData.Net.6.0.0\lib\InfluxData.Net.InfluxDb.dll</HintPath>
<HintPath>..\..\packages\InfluxData.Net.7.0.3\lib\net461\InfluxData.Net.InfluxDb.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="InfluxData.Net.Kapacitor, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\InfluxData.Net.6.0.0\lib\InfluxData.Net.Kapacitor.dll</HintPath>
<HintPath>..\..\packages\InfluxData.Net.7.0.3\lib\net461\InfluxData.Net.Kapacitor.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
Expand All @@ -63,8 +69,8 @@
<HintPath>..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ScintillaNET, Version=3.5.10.0, Culture=neutral, processorArchitecture=MSIL">
Expand All @@ -74,6 +80,10 @@
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Http, Version=4.1.1.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Net.Http.4.3.2\lib\net46\System.Net.Http.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http.Extensions, Version=2.2.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll</HintPath>
<Private>True</Private>
Expand All @@ -83,13 +93,28 @@
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
Expand Down Expand Up @@ -373,7 +398,6 @@
<EmbeddedResource Include="Dialogs\UserPasswordDialog.resx">
<DependentUpon>UserPasswordDialog.cs</DependentUpon>
</EmbeddedResource>
<None Include="InfluxData.Net.dll.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
Expand Down
12 changes: 6 additions & 6 deletions src/CymaticLabs.InfluxDB.Studio/Data/InfluxDataNetClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public async override Task<InfluxDbApiResponse> CreateRetentionPolicyAsync(strin
// If the default was supplied, run a second query to alter and add the default status since InfluxData.NET doesn't allow for the default argument
if (response != null && response.Success && isDefault)
{
var alterResponse = await influx.Client.QueryAsync(database, string.Format("ALTER RETENTION POLICY \"{0}\" ON \"{1}\" DEFAULT", policyName, database)).ConfigureAwait(false);
var alterResponse = await influx.Client.QueryAsync(string.Format("ALTER RETENTION POLICY \"{0}\" ON \"{1}\" DEFAULT",database, policyName, database)).ConfigureAwait(false);
}

return new InfluxDbApiResponse(response.Body, response.StatusCode, response.Success);
Expand Down Expand Up @@ -157,7 +157,7 @@ public async override Task<InfluxDbApiResponse> AlterRetentionPolicyAsync(string
// If the default was supplied, run a second query to alter and add the default status since InfluxData.NET doesn't allow for the default argument
if (response != null && response.Success && isDefault)
{
var alterResponse = await influx.Client.QueryAsync(database, string.Format("ALTER RETENTION POLICY \"{0}\" ON \"{1}\" DEFAULT", policyName, database)).ConfigureAwait(false);
var alterResponse = await influx.Client.QueryAsync(string.Format("ALTER RETENTION POLICY \"{0}\" ON \"{1}\" DEFAULT",database, policyName, database)).ConfigureAwait(false);
}

return new InfluxDbApiResponse(response.Body, response.StatusCode, response.Success);
Expand Down Expand Up @@ -304,7 +304,7 @@ public async override Task<InfluxDbApiResponse> DropSeriesAsync(string database,
/// <returns>A list of the currently running queries.</returns>
public async override Task<IEnumerable<InfluxDbRunningQuery>> GetRunningQueriesAsync()
{
var response = await influx.Client.QueryAsync("_internal", "SHOW QUERIES").ConfigureAwait(false);
var response = await influx.Client.QueryAsync( "SHOW QUERIES", "_internal").ConfigureAwait(false);
if (response.Count() == 0 || response.First().Values == null) return new InfluxDbRunningQuery[0];
var results = response.First().Values;
var queries = new List<InfluxDbRunningQuery>(results.Count);
Expand Down Expand Up @@ -338,7 +338,7 @@ public async override Task<IEnumerable<InfluxDbSeries>> QueryAsync(string databa
if (string.IsNullOrWhiteSpace(database)) throw new ArgumentNullException("database");
if (string.IsNullOrWhiteSpace(query)) throw new ArgumentNullException("query");

var response = await influx.Client.QueryAsync(database, query).ConfigureAwait(false);
var response = await influx.Client.QueryAsync(query, database).ConfigureAwait(false);
var results = new List<InfluxDbSeries>(response.Count());

foreach (var r in response)
Expand Down Expand Up @@ -519,7 +519,7 @@ public async override Task<InfluxDbApiResponse> WriteAsync(string database, Infl
{
if (string.IsNullOrWhiteSpace(database)) throw new ArgumentNullException("database");
var p = new Point() { Name = point.Measurement, Fields = point.Fields, Tags = point.Tags, Timestamp = point.TimeStamp };
var response = await influx.Client.WriteAsync(database, p, retentionPolicy).ConfigureAwait(false);
var response = await influx.Client.WriteAsync(p, database, retentionPolicy).ConfigureAwait(false);
return new InfluxDbApiResponse(response.Body, response.StatusCode, response.Success);
}

Expand All @@ -543,7 +543,7 @@ public async override Task<InfluxDbApiResponse> WriteAsync(string database, IEnu
list.Add(p);
}

var response = await influx.Client.WriteAsync(database, list, retentionPolicy).ConfigureAwait(false);
var response = await influx.Client.WriteAsync( list, database, retentionPolicy).ConfigureAwait(false);
return new InfluxDbApiResponse(response.Body, response.StatusCode, response.Success);
}

Expand Down
27 changes: 0 additions & 27 deletions src/CymaticLabs.InfluxDB.Studio/InfluxData.Net.dll.config

This file was deleted.

2 changes: 1 addition & 1 deletion src/CymaticLabs.InfluxDB.Studio/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.0.0")]
[assembly: AssemblyVersion("0.1.2.0")]
[assembly: AssemblyFileVersion("0.1.0.0")]

// Enable log4net using app.config
Expand Down
9 changes: 7 additions & 2 deletions src/CymaticLabs.InfluxDB.Studio/packages.config
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="InfluxData.Net" version="6.0.0" targetFramework="net452" />
<package id="InfluxData.Net" version="7.0.3" targetFramework="net461" />
<package id="jacobslusser.ScintillaNET" version="3.5.10" targetFramework="net452" />
<package id="log4net" version="2.0.5" targetFramework="net452" />
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net452" />
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net452" />
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net452" />
<package id="Microsoft.Net.Http" version="2.2.29" targetFramework="net452" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net461" />
<package id="System.Net.Http" version="4.3.2" targetFramework="net461" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net461" />
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net461" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net461" />
<package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net461" />
</packages>

2 comments on commit 9e76691

@tihomir-kit
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a quick update if it matters to you guys - there is a newer version of the InfluxData.Net lib which now officially supports InfluxDB v1.3.x and has some improvements and fixes.

@meverett
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the heads up, I just pushed a new release that references InfluxData.Net 8.0.1 and adds a few new features.

Please sign in to comment.