From 83dae67471b6e31c78a290d58c0f7f87712d344b Mon Sep 17 00:00:00 2001 From: jankaspar <2270833+jankaspar@users.noreply.github.com> Date: Thu, 19 Dec 2019 11:15:33 +0000 Subject: [PATCH] Add interface for .Net generated client. (#284) --- client/DotNet/Armada.Client.Test/Tests.cs | 2 +- client/DotNet/Armada.Client/Client.cs | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/client/DotNet/Armada.Client.Test/Tests.cs b/client/DotNet/Armada.Client.Test/Tests.cs index 316b4a42a39..3a0c2f557be 100644 --- a/client/DotNet/Armada.Client.Test/Tests.cs +++ b/client/DotNet/Armada.Client.Test/Tests.cs @@ -15,7 +15,7 @@ public async Task TestSimpleJobSubmitFlow() { var jobSet = $"set-{Guid.NewGuid()}"; - var client = new ArmadaClient("http://localhost:8080", new HttpClient()); + IArmadaClient client = new ArmadaClient("http://localhost:8080", new HttpClient()); await client.CreateQueueAsync("test", new ApiQueue {PriorityFactor = 200}); var pod = new V1PodSpec diff --git a/client/DotNet/Armada.Client/Client.cs b/client/DotNet/Armada.Client/Client.cs index e4ce85f3354..8e211a1ada0 100644 --- a/client/DotNet/Armada.Client/Client.cs +++ b/client/DotNet/Armada.Client/Client.cs @@ -12,6 +12,14 @@ public interface IEvent string Queue { get; } System.DateTimeOffset? Created { get; } } + + public interface IArmadaClient + { + Task CancelJobsAsync(ApiJobCancelRequest body); + Task SubmitJobsAsync(ApiJobSubmitRequest body); + Task CreateQueueAsync(string name, ApiQueue body); + Task>> GetJobEventsStream(string jobSetId, string fromMessage = null, bool watch = false); + } public partial class ApiEventMessage { @@ -41,7 +49,7 @@ public class StreamResponse public string Error { get; set; } } - public partial class ArmadaClient + public partial class ArmadaClient : IArmadaClient { public async Task>> GetJobEventsStream(string jobSetId, string fromMessage = null, bool watch = false)