Skip to content

Commit

Permalink
Add interface for .Net generated client. (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
jankaspar authored Dec 19, 2019
1 parent e642796 commit 83dae67
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/DotNet/Armada.Client.Test/Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion client/DotNet/Armada.Client/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ public interface IEvent
string Queue { get; }
System.DateTimeOffset? Created { get; }
}

public interface IArmadaClient
{
Task<ApiCancellationResult> CancelJobsAsync(ApiJobCancelRequest body);
Task<ApiJobSubmitResponse> SubmitJobsAsync(ApiJobSubmitRequest body);
Task<object> CreateQueueAsync(string name, ApiQueue body);
Task<IEnumerable<StreamResponse<ApiEventStreamMessage>>> GetJobEventsStream(string jobSetId, string fromMessage = null, bool watch = false);
}

public partial class ApiEventMessage
{
Expand Down Expand Up @@ -41,7 +49,7 @@ public class StreamResponse<T>
public string Error { get; set; }
}

public partial class ArmadaClient
public partial class ArmadaClient : IArmadaClient
{
public async Task<IEnumerable<StreamResponse<ApiEventStreamMessage>>> GetJobEventsStream(string jobSetId,
string fromMessage = null, bool watch = false)
Expand Down

0 comments on commit 83dae67

Please sign in to comment.