You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e02a141
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: src/G4.Services.Hub.Api.V4/Controllers/AutomationAsyncController.cs
+32Lines changed: 32 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,14 @@
1
1
usingG4.Models;
2
2
usingG4.Services.Domain.V4;
3
+
usingG4.Services.Domain.V4.Models;
3
4
4
5
usingMicrosoft.AspNetCore.Http;
5
6
usingMicrosoft.AspNetCore.Mvc;
6
7
7
8
usingSwashbuckle.AspNetCore.Annotations;
8
9
9
10
usingSystem.Net.Mime;
11
+
usingSystem.Text.Json;
10
12
11
13
namespaceG4.Services.Hub.Api.V4.Controllers
12
14
{
@@ -56,5 +58,35 @@ public IActionResult Start([FromBody] G4AutomationModel automation)
56
58
// Return an HTTP 202 Accepted response indicating that the automation task has been accepted.
57
59
returnAccepted();
58
60
}
61
+
62
+
[HttpPost]
63
+
[Route("file/start")]
64
+
[SwaggerOperation(
65
+
Summary="Enqueue a new automation task from a file.",
66
+
Description="Reads a G4 automation model from the provided file path, deserializes the file content into a G4AutomationModel, and enqueues it into the pending queue. The automation task will be picked up by any available automation worker for asynchronous processing.",
67
+
Tags=["Automation","AutomationAsync"])]
68
+
[SwaggerResponse(StatusCodes.Status202Accepted,
69
+
Description="The automation task has been accepted and enqueued. The response is empty as processing is performed asynchronously.",
70
+
Type=typeof(void),
71
+
ContentTypes=[MediaTypeNames.Application.Json])]
72
+
publicIActionResultStart(
73
+
[FromBody]
74
+
[SwaggerRequestBody(
75
+
Description="The file invocation model containing the path to the automation JSON file.",
76
+
Required=true)]
77
+
FileInvokeModelinvokeModel)
78
+
{
79
+
// Read the automation file content from the provided file path.
Copy file name to clipboardExpand all lines: src/G4.Services.Hub.Api.V4/Controllers/AutomationController.cs
+31Lines changed: 31 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
usingG4.Extensions;
2
2
usingG4.Models;
3
3
usingG4.Services.Domain.V4;
4
+
usingG4.Services.Domain.V4.Models;
4
5
5
6
usingMicrosoft.AspNetCore.Http;
6
7
usingMicrosoft.AspNetCore.Mvc;
@@ -22,6 +23,36 @@ public class AutomationController(IDomain domain) : ControllerBase
22
23
// The domain service for the G4™ engine.
23
24
privatereadonlyIDomain_domain=domain;
24
25
26
+
[HttpPost]
27
+
[Route("file/invoke")]
28
+
[SwaggerOperation(
29
+
summary:"Invokes an automation session from a file.",
30
+
description:"Reads a G4 automation model from the provided file path, deserializes the file content into a `G4AutomationModel`, and invokes the automation session. The result includes detailed information about the automation run, returned in JSON format.",
31
+
Tags=["Automation"])]
32
+
[SwaggerResponse(StatusCodes.Status200OK,
33
+
description:"Successfully invoked the automation session from the provided file. Returns a dictionary containing detailed information about the automation run.",
0 commit comments