Skip to content

Commit

Permalink
Fixes to integrations API (#417)
Browse files Browse the repository at this point in the history
Rename extractorinfo to startup, add the resource to the Alpha resource.
  • Loading branch information
einarmo authored Feb 4, 2025
1 parent 995cb07 commit 524da3c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CogniteSdk.Types/Alpha/Integrations/CheckIn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public class CheckInResponse
/// Report changes to general information about the extractor.
/// This is typically used on extractor startup and when loading a new config file.
/// </summary>
public class ExtractorInfo
public class StartupRequest
{
/// <summary>
/// ID of the running extractor.
Expand Down
6 changes: 6 additions & 0 deletions CogniteSdk/src/Resources/Alpha.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ public class AlphaResource : Resource
/// </summary>
public SimulatorsResource Simulators { get; }

/// <summary>
/// Integrations API extension methods.
/// </summary>
public IntegrationsResource Integrations { get; }

/// <summary>
/// Will only be instantiated by the client.
/// </summary>
Expand All @@ -28,6 +33,7 @@ public class AlphaResource : Resource
internal AlphaResource(Func<CancellationToken, Task<string>> authHandler, FSharpFunc<IHttpNext<Unit>, Task<Unit>> ctx) : base(authHandler, ctx)
{
Simulators = new SimulatorsResource(authHandler, ctx);
Integrations = new IntegrationsResource(authHandler, ctx);
}
}
}
4 changes: 2 additions & 2 deletions CogniteSdk/src/Resources/Alpha/Integrations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public async Task<CheckInResponse> CheckInAsync(CheckInRequest request, Cancella
/// <param name="request">Changes to extractor info.</param>
/// <param name="token">Optional cancellation token</param>
/// <returns>Response with changes and notifications the extractor should be aware of.</returns>
public async Task<CheckInResponse> ExtractorInfoAsync(ExtractorInfo request, CancellationToken token = default)
public async Task<CheckInResponse> StartupAsync(StartupRequest request, CancellationToken token = default)
{
var req = Integrations.extractorInfo(request, GetContext(token));
var req = Integrations.startup(request, GetContext(token));
return await RunAsync(req).ConfigureAwait(false);
}

Expand Down
6 changes: 3 additions & 3 deletions Oryx.Cognite/src/Alpha/Integrations.fs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ module Integrations =
|> withAlphaHeader
|> postV10 request (Url +/ "checkin")

let extractorInfo (request: ExtractorInfo) (source: HttpHandler<unit>) : HttpHandler<CheckInResponse> =
let startup (request: StartupRequest) (source: HttpHandler<unit>) : HttpHandler<CheckInResponse> =
source
|> withLogMessage "integrations:extractorinfo"
|> withLogMessage "integrations:startup"
|> withAlphaHeader
|> postV10 request (Url +/ "extractorinfo")
|> postV10 request (Url +/ "startup")

let createConfigRevision
(revision: CreateConfigRevision)
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.13.0
4.13.1

0 comments on commit 524da3c

Please sign in to comment.