Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
## 4.2.0 [unreleased]

### Breaking Changes
1. [#316](https://github.com/influxdata/influxdb-client-csharp/pull/316): Rename `InvocableScripts` to `InvokableScripts`

### Bug Fixes
1. [#313](https://github.com/influxdata/influxdb-client-csharp/pull/313): Using default `org` and `bucket` in `WriteApiAsync`

## 4.1.0 [2022-04-19]

### Features
1. [#304](https://github.com/influxdata/influxdb-client-csharp/pull/304): Add `InvocableScriptsApi` to create, update, list, delete and invoke scripts by seamless way
1. [#304](https://github.com/influxdata/influxdb-client-csharp/pull/304): Add `InvokableScriptsApi` to create, update, list, delete and invoke scripts by seamless way
1. [#308](https://github.com/influxdata/influxdb-client-csharp/pull/308): Add support for `TakeLast` expression [LINQ]

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion Client.Core/Flux/Internal/FluxCsvParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ internal enum ResponseMode
// full information about types, default values and groups
Full,

// useful for Invocable scripts
// useful for Invokable scripts
OnlyNames
}

Expand Down
16 changes: 0 additions & 16 deletions Client.Test/ItInvocableScriptsApiTest.cs

This file was deleted.

16 changes: 16 additions & 0 deletions Client.Test/ItInvokableScriptsApiTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using NUnit.Framework;

namespace InfluxDB.Client.Test
{
[TestFixture]
public class ItInvokableScriptsApiTest : AbstractItClientTest
{
[Test]
public void CreateInstance()
{
var invokableScriptsApi = Client.GetInvokableScriptsApi();

Assert.NotNull(invokableScriptsApi);
}
}
}

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions Client/InfluxDBClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -347,18 +347,18 @@ public DeleteApi GetDeleteApi()
}

/// <summary>
/// Create an InvocableScripts API instance.
/// Create an InvokableScripts API instance.
/// </summary>
/// <param name="mapper">the mapper used for mapping invocation results to POCO</param>
/// <returns>New instance of InvocableScriptsApi.</returns>
public InvocableScriptsApi GetInvocableScriptsApi(IDomainObjectMapper mapper = null)
/// <returns>New instance of InvokableScriptsApi.</returns>
public InvokableScriptsApi GetInvokableScriptsApi(IDomainObjectMapper mapper = null)
{
var service = new InvocableScriptsService((Configuration)_apiClient.Configuration)
var service = new InvokableScriptsService((Configuration)_apiClient.Configuration)
{
ExceptionFactory = _exceptionFactory
};

return new InvocableScriptsApi(service, mapper ?? new DefaultDomainObjectMapper());
return new InvokableScriptsApi(service, mapper ?? new DefaultDomainObjectMapper());
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

namespace InfluxDB.Client
{
public class InvocableScriptsApi : AbstractQueryClient
public class InvokableScriptsApi : AbstractQueryClient
{
private readonly InvocableScriptsService _service;
private readonly InvokableScriptsService _service;

protected internal InvocableScriptsApi(InvocableScriptsService service, IFluxResultMapper mapper) : base(mapper,
protected internal InvokableScriptsApi(InvokableScriptsService service, IFluxResultMapper mapper) : base(mapper,
new FluxCsvParser(FluxCsvParser.ResponseMode.OnlyNames))
{
Arguments.CheckNotNull(service, nameof(service));
Expand Down
16 changes: 8 additions & 8 deletions Examples/InvocableScripts.cs → Examples/InvokableScripts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
namespace Examples
{
/// <summary>
/// Warning: Invocable Scripts are supported only in InfluxDB Cloud,
/// Warning: Invokable Scripts are supported only in InfluxDB Cloud,
/// currently there is no support in InfluxDB OSS.
/// </summary>
public static class InvocableScripts
public static class InvokableScripts
{
public static async Task Main(string[] args)
{
Expand Down Expand Up @@ -44,10 +44,10 @@ public static async Task Main(string[] args)

await client.GetWriteApiAsync().WritePointsAsync(new[] { point1, point2 });

var scriptsApi = client.GetInvocableScriptsApi();
var scriptsApi = client.GetInvokableScriptsApi();

//
// Create Invocable Script
// Create Invokable Script
//
Console.WriteLine("------- Create -------\n");
const string scriptQuery = "from(bucket: params.bucket_name) |> range(start: -6h) |> limit(n:2)";
Expand All @@ -61,7 +61,7 @@ public static async Task Main(string[] args)
Console.WriteLine(createdScript);

//
// Update Invocable Script
// Update Invokable Script
//
Console.WriteLine("------- Update -------\n");
var updateRequest = new ScriptUpdateRequest(description: "my updated description");
Expand Down Expand Up @@ -97,13 +97,13 @@ public static async Task Main(string[] args)
// Measurements
Console.WriteLine("\n------- Invoke to Measurements -------\n");
var measurements =
await scriptsApi.InvokeScriptMeasurementsAsync<InvocableScriptPojo>(createdScript.Id, bindParams);
await scriptsApi.InvokeScriptMeasurementsAsync<InvokableScriptPojo>(createdScript.Id, bindParams);
foreach (var measurement in measurements) Console.WriteLine($"{measurement}");

// Invoke to Stream of Measurements
Console.WriteLine("\n------- Invoke to Stream of Measurements -------\n");
var measurementsStream =
scriptsApi.InvokeScriptMeasurementsEnumerableAsync<InvocableScriptPojo>(createdScript.Id, bindParams);
scriptsApi.InvokeScriptMeasurementsEnumerableAsync<InvokableScriptPojo>(createdScript.Id, bindParams);
await foreach (var measurement in measurementsStream) Console.WriteLine($"{measurement}");

//
Expand All @@ -123,7 +123,7 @@ public static async Task Main(string[] args)
Console.WriteLine($"Successfully deleted script: '{createdScript.Name}'");
}

private class InvocableScriptPojo
private class InvokableScriptPojo
{
[Column("location", IsTag = true)] public string Location { get; set; }

Expand Down
2 changes: 1 addition & 1 deletion Examples/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Examples

## Others
- [InvocableScripts.cs](InvocableScripts.cs) - How to use Invocable scripts Cloud API to create custom endpoints that query data
- [InvokableScripts.cs](InvokableScripts.cs) - How to use Invokable scripts Cloud API to create custom endpoints that query data
6 changes: 3 additions & 3 deletions Examples/RunExamples.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public static async Task Main(string[] args)
case "ManagementExample":
await ManagementExample.Main(args);
break;
case "InvocableScripts":
await InvocableScripts.Main(args);
case "InvokableScripts":
await InvokableScripts.Main(args);
break;
}
}
Expand All @@ -71,7 +71,7 @@ public static async Task Main(string[] args)
"FluxExample, FluxClientSimpleExample, FluxRawExample, FluxClientFactoryExample, " +
"FluxClientPocoExample, PlatformExample, WriteApiAsyncExample, CustomDomainMapping" +
"PocoQueryWriteExample, CustomDomainMappingAndLinq, SynchronousQuery, InfluxDB18Example, " +
"QueryLinqCloud, ManagementExample, InvocableScripts");
"QueryLinqCloud, ManagementExample, InvokableScripts");
}
}
}
Expand Down