view-progress-log end-point returns a self-contained HTML
This commit is contained in:
parent
b432fdd0e5
commit
6d7587aeac
@ -1688,3 +1688,31 @@ viewProgressWithWebSockets :: Swagger
|
|||||||
viewProgressWithWebSockets = spec & definitions .~ defs
|
viewProgressWithWebSockets = spec & definitions .~ defs
|
||||||
where
|
where
|
||||||
(defs, spec) = runDeclare declareViewProgressWithWebSocketsSwagger mempty
|
(defs, spec) = runDeclare declareViewProgressWithWebSocketsSwagger mempty
|
||||||
|
|
||||||
|
|
||||||
|
declareViewProgressLogSwagger :: Declare (Definitions Schema) Swagger
|
||||||
|
declareViewProgressLogSwagger = do
|
||||||
|
let numberSchema = toParamSchema (Proxy :: Proxy Int)
|
||||||
|
|
||||||
|
numberResponse <- declareResponse (Proxy :: Proxy Int)
|
||||||
|
|
||||||
|
return $ mempty
|
||||||
|
& paths .~
|
||||||
|
fromList [ ("/api/view-progress-log/{jobId}",
|
||||||
|
mempty & DS.get ?~ (mempty
|
||||||
|
& parameters .~ [ Inline $ mempty
|
||||||
|
& name .~ "jobId"
|
||||||
|
& description ?~ "The ID for the job to be shown"
|
||||||
|
& required ?~ True
|
||||||
|
& schema .~ ParamOther (mempty
|
||||||
|
& in_ .~ ParamPath
|
||||||
|
& paramSchema .~ numberSchema)]
|
||||||
|
& produces ?~ MimeList ["text/html"]
|
||||||
|
& description ?~ "Returns HTML code with embedded JS script for showing logs via web sockets"
|
||||||
|
& at 200 ?~ Inline numberResponse))
|
||||||
|
]
|
||||||
|
|
||||||
|
viewProgressLog :: Swagger
|
||||||
|
viewProgressLog = spec & definitions .~ defs
|
||||||
|
where
|
||||||
|
(defs, spec) = runDeclare declareViewProgressLogSwagger mempty
|
||||||
|
@ -33,6 +33,8 @@ apiDescription = generalApi
|
|||||||
<> challengeRepoApi
|
<> challengeRepoApi
|
||||||
<> testProgressApi
|
<> testProgressApi
|
||||||
<> viewProgressWithWebSockets
|
<> viewProgressWithWebSockets
|
||||||
|
<> viewProgressLog
|
||||||
|
|
||||||
|
|
||||||
generalApi :: Swagger
|
generalApi :: Swagger
|
||||||
generalApi = (mempty :: Swagger)
|
generalApi = (mempty :: Swagger)
|
||||||
|
Loading…
Reference in New Issue
Block a user