Skip to content

Commit

Permalink
add debug endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticroentgen committed Jun 6, 2024
1 parent 7bdd649 commit 2a0f4b5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CloudController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,9 @@ public Machine GetRunnerByHostname(string hostname)
{
return _activeRunners.FirstOrDefault(x => x.Name == hostname);
}

public List<Machine> GetAllRunners()
{
return _activeRunners.ToList();
}
}
7 changes: 7 additions & 0 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@ public static void Main(string[] args)
});

app.MapGet("/debug", (HttpRequest request,
[FromServices] CloudController cloud, [FromServices] ILogger<Program> logger, [FromServices] RunnerQueue runnerQueue) =>
{
return Results.Json(cloud.GetAllRunners());
});


app.MapPost("/runner-state", async (HttpRequest request,
[FromServices] CloudController cloud, [FromServices] ILogger<Program> logger, [FromServices] RunnerQueue runnerQueue, [FromQuery] string hostname, [FromQuery] string state) =>
{
Expand Down

0 comments on commit 2a0f4b5

Please sign in to comment.