|
8 | 8 | _ "github.com/lib/pq"
|
9 | 9 | "github.com/shinobistack/gokakashi/ent"
|
10 | 10 | "github.com/shinobistack/gokakashi/internal/restapi/server/middleware"
|
| 11 | + agents1 "github.com/shinobistack/gokakashi/internal/restapi/v1/agents" |
| 12 | + agenttasks1 "github.com/shinobistack/gokakashi/internal/restapi/v1/agenttasks" |
| 13 | + |
11 | 14 | integrations1 "github.com/shinobistack/gokakashi/internal/restapi/v1/integrations"
|
12 | 15 | integrationtype1 "github.com/shinobistack/gokakashi/internal/restapi/v1/integrationtype"
|
13 | 16 | policies1 "github.com/shinobistack/gokakashi/internal/restapi/v1/policies"
|
@@ -84,6 +87,18 @@ func (srv *Server) Service() *web.Service {
|
84 | 87 | apiV1.Put("/scans/{scan_id}/labels", usecase.NewInteractor(scanlabels1.UpdateScanLabel(srv.DB)))
|
85 | 88 | apiV1.Delete("/scans/{scan_id}/labels/{key}", usecase.NewInteractor(scanlabels1.DeleteScanLabel(srv.DB)))
|
86 | 89 |
|
| 90 | + apiV1.Post("/agents", usecase.NewInteractor(agents1.CreateAgent(srv.DB))) |
| 91 | + apiV1.Get("/agents", usecase.NewInteractor(agents1.ListAgents(srv.DB))) |
| 92 | + apiV1.Get("/agents/{id}", usecase.NewInteractor(agents1.GetAgent(srv.DB))) |
| 93 | + apiV1.Put("/agents/{id}", usecase.NewInteractor(agents1.UpdateAgent(srv.DB))) |
| 94 | + apiV1.Delete("/agents/{id}", usecase.NewInteractor(agents1.DeleteAgent(srv.DB))) |
| 95 | + |
| 96 | + apiV1.Post("/agents/{agent_id}/tasks", usecase.NewInteractor(agenttasks1.CreateAgentTask(srv.DB))) |
| 97 | + apiV1.Get("/agents/{agent_id}/tasks", usecase.NewInteractor(agenttasks1.ListAgentTasks(srv.DB))) |
| 98 | + apiV1.Get("/agents/{agent_id}/tasks/{id}", usecase.NewInteractor(agenttasks1.GetAgentTask(srv.DB))) |
| 99 | + apiV1.Put("/agents/{agent_id}/tasks/{id}", usecase.NewInteractor(agenttasks1.UpdateAgentTask(srv.DB))) |
| 100 | + apiV1.Delete("/agents/{agent_id}/tasks/{id}", usecase.NewInteractor(agenttasks1.DeleteAgentTask(srv.DB))) |
| 101 | + |
87 | 102 | s.Mount("/api/v1/openapi.json", specHandler(apiV1.OpenAPICollector.SpecSchema().(*openapi31.Spec)))
|
88 | 103 | s.Mount("/api/v1", apiV1)
|
89 | 104 |
|
|
0 commit comments