Skip to content

Commit c509e7d

Browse files
committed
Added LoggingManager and Health back to OpenAPI
1 parent 885ad30 commit c509e7d

File tree

8 files changed

+1449
-71
lines changed

8 files changed

+1449
-71
lines changed

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
<description>Quarkus monorepo demonstrating Panache REST server with PrimeReact UI client</description>
1010
<url>https://github.com/melloware/quarkus-monorepo</url>
1111
<properties>
12-
<quarkus.platform.version>3.22.0</quarkus.platform.version>
13-
<quarkus.logmanager.version>3.3.2</quarkus.logmanager.version>
14-
<quarkus.ngrok.version>1.6.0</quarkus.ngrok.version>
12+
<quarkus.platform.version>3.22.2</quarkus.platform.version>
13+
<quarkus.logmanager.version>3.3.4</quarkus.logmanager.version>
14+
<quarkus.ngrok.version>1.7.0</quarkus.ngrok.version>
1515
<quarkus.postgresql.version>0.3.1</quarkus.postgresql.version>
1616
<quarkus.rest-problem.version>3.20.1</quarkus.rest-problem.version>
1717
<quarkus.quinoa.version>2.5.4</quarkus.quinoa.version>

src/main/resources/application.properties

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ quarkus.resteasy.problem.include-mdc-properties=uuid,application,version
5959
quarkus.resteasy.problem.constraint-violation.status=422
6060
quarkus.resteasy.problem.constraint-violation.title=Unprocessable Content
6161
quarkus.resteasy.problem.constraint-violation.description=Unprocessable Content: server understood the content type of the request content, and the syntax of the request content was correct, but it was unable to process the contained instructions.
62-
quarkus.logging-manager.openapi.included=false
63-
quarkus.smallrye-health.openapi.included=false
62+
quarkus.logging-manager.openapi.included=true
63+
quarkus.smallrye-health.openapi.included=true
6464
quarkus.smallrye-openapi.store-schema-directory=src/main/webui/
6565
quarkus.swagger-ui.title=Quarkus PrimeReact
6666
quarkus.swagger-ui.always-include=true
@@ -76,3 +76,5 @@ mp.openapi.extensions.smallrye.info.contact.name=Melloware
7676
mp.openapi.extensions.smallrye.info.contact.email=mellowaredev@gmail.com
7777
mp.openapi.extensions.smallrye.info.contact.url=https://melloware.com
7878

79+
%dev.quarkus.datasource.dev-ui.allow-sql=true
80+
%dev.quarkus.hibernate-orm.dev-ui.allow-hql=true

src/main/webui/openapi.json

Lines changed: 310 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,56 @@
323323
"examples" : [ "Invalid email format" ]
324324
}
325325
}
326+
},
327+
"LoggerLevel" : {
328+
"title" : "LoggerLevel",
329+
"type" : "string",
330+
"enum" : [ "OFF", "SEVERE", "ERROR", "FATAL", "WARNING", "WARN", "INFO", "DEBUG", "TRACE", "CONFIG", "FINE", "FINER", "FINEST", "ALL" ]
331+
},
332+
"LoggerInfo" : {
333+
"title" : "LoggerInfo",
334+
"type" : "object",
335+
"properties" : {
336+
"configuredLevel" : {
337+
"$ref" : "#/components/schemas/LoggerLevel"
338+
},
339+
"effectiveLevel" : {
340+
"$ref" : "#/components/schemas/LoggerLevel"
341+
},
342+
"name" : {
343+
"type" : "string"
344+
}
345+
}
346+
},
347+
"HealthResponse" : {
348+
"type" : "object",
349+
"properties" : {
350+
"checks" : {
351+
"type" : "array",
352+
"items" : {
353+
"$ref" : "#/components/schemas/HealthCheck"
354+
}
355+
},
356+
"status" : {
357+
"type" : "string",
358+
"enum" : [ "UP", "DOWN" ]
359+
}
360+
}
361+
},
362+
"HealthCheck" : {
363+
"type" : "object",
364+
"properties" : {
365+
"data" : {
366+
"type" : [ "object", "null" ]
367+
},
368+
"name" : {
369+
"type" : "string"
370+
},
371+
"status" : {
372+
"type" : "string",
373+
"enum" : [ "UP", "DOWN" ]
374+
}
375+
}
326376
}
327377
}
328378
},
@@ -332,6 +382,12 @@
332382
}, {
333383
"name" : "WebSocket Resource",
334384
"description" : "WebSocket operations."
385+
}, {
386+
"name" : "Logging Manager",
387+
"description" : "Visualize and manage the log level of your loggers."
388+
}, {
389+
"name" : "MicroProfile Health",
390+
"description" : "Check the health of the application"
335391
} ],
336392
"paths" : {
337393
"/entity/cars" : {
@@ -615,6 +671,260 @@
615671
}
616672
}
617673
}
674+
},
675+
"/q/logging-manager" : {
676+
"summary" : "Return info on all loggers, or a specific logger",
677+
"description" : "Logging Manager Loggers",
678+
"get" : {
679+
"operationId" : "logging_manager_get_all",
680+
"summary" : "Information on Logger(s)",
681+
"description" : "Get information on all loggers or a specific logger.",
682+
"tags" : [ "Logging Manager" ],
683+
"parameters" : [ {
684+
"name" : "loggerName",
685+
"in" : "query",
686+
"schema" : {
687+
"type" : "string"
688+
}
689+
} ],
690+
"responses" : {
691+
"200" : {
692+
"description" : "Ok",
693+
"content" : {
694+
"application/json" : {
695+
"schema" : {
696+
"type" : "array",
697+
"items" : {
698+
"$ref" : "#/components/schemas/LoggerInfo"
699+
}
700+
}
701+
}
702+
}
703+
},
704+
"404" : {
705+
"description" : "Not Found"
706+
}
707+
}
708+
},
709+
"post" : {
710+
"operationId" : "logging_manager_update",
711+
"summary" : "Update log level",
712+
"description" : "Update a log level for a certain logger",
713+
"tags" : [ "Logging Manager" ],
714+
"requestBody" : {
715+
"content" : {
716+
"application/x-www-form-urlencoded" : {
717+
"schema" : {
718+
"type" : "object",
719+
"properties" : {
720+
"loggerName" : { },
721+
"loggerLevel" : {
722+
"$ref" : "#/components/schemas/LoggerLevel"
723+
}
724+
}
725+
}
726+
}
727+
}
728+
},
729+
"responses" : {
730+
"201" : {
731+
"description" : "Created"
732+
}
733+
}
734+
}
735+
},
736+
"/q/logging-manager/levels" : {
737+
"description" : "All available levels",
738+
"summary" : "Return all levels that is available",
739+
"get" : {
740+
"description" : "This returns all possible log levels",
741+
"operationId" : "logging_manager_levels",
742+
"tags" : [ "Logging Manager" ],
743+
"summary" : "Get all available levels",
744+
"responses" : {
745+
"200" : {
746+
"description" : "Ok",
747+
"content" : {
748+
"application/json" : {
749+
"schema" : {
750+
"type" : "array",
751+
"items" : {
752+
"$ref" : "#/components/schemas/LoggerLevel"
753+
}
754+
}
755+
}
756+
}
757+
}
758+
}
759+
}
760+
},
761+
"/q/health" : {
762+
"description" : "MicroProfile Health Endpoint",
763+
"summary" : "MicroProfile Health provides a way for your application to distribute information about its healthiness state to state whether or not it is able to function properly",
764+
"get" : {
765+
"operationId" : "microprofile_health_root",
766+
"description" : "Check the health of the application",
767+
"tags" : [ "MicroProfile Health" ],
768+
"summary" : "An aggregated view of the Liveness, Readiness and Startup of this application",
769+
"responses" : {
770+
"200" : {
771+
"description" : "OK",
772+
"content" : {
773+
"application/json" : {
774+
"schema" : {
775+
"$ref" : "#/components/schemas/HealthResponse"
776+
}
777+
}
778+
}
779+
},
780+
"503" : {
781+
"description" : "Service Unavailable",
782+
"content" : {
783+
"application/json" : {
784+
"schema" : {
785+
"$ref" : "#/components/schemas/HealthResponse"
786+
}
787+
}
788+
}
789+
},
790+
"500" : {
791+
"description" : "Internal Server Error",
792+
"content" : {
793+
"application/json" : {
794+
"schema" : {
795+
"$ref" : "#/components/schemas/HealthResponse"
796+
}
797+
}
798+
}
799+
}
800+
}
801+
}
802+
},
803+
"/q/health/live" : {
804+
"description" : "MicroProfile Health - Liveness Endpoint",
805+
"summary" : "Liveness checks are utilized to tell whether the application should be restarted",
806+
"get" : {
807+
"operationId" : "microprofile_health_liveness",
808+
"description" : "Check the liveness of the application",
809+
"tags" : [ "MicroProfile Health" ],
810+
"summary" : "The Liveness check of this application",
811+
"responses" : {
812+
"200" : {
813+
"description" : "OK",
814+
"content" : {
815+
"application/json" : {
816+
"schema" : {
817+
"$ref" : "#/components/schemas/HealthResponse"
818+
}
819+
}
820+
}
821+
},
822+
"503" : {
823+
"description" : "Service Unavailable",
824+
"content" : {
825+
"application/json" : {
826+
"schema" : {
827+
"$ref" : "#/components/schemas/HealthResponse"
828+
}
829+
}
830+
}
831+
},
832+
"500" : {
833+
"description" : "Internal Server Error",
834+
"content" : {
835+
"application/json" : {
836+
"schema" : {
837+
"$ref" : "#/components/schemas/HealthResponse"
838+
}
839+
}
840+
}
841+
}
842+
}
843+
}
844+
},
845+
"/q/health/ready" : {
846+
"description" : "MicroProfile Health - Readiness Endpoint",
847+
"summary" : "Readiness checks are used to tell whether the application is able to process requests",
848+
"get" : {
849+
"operationId" : "microprofile_health_readiness",
850+
"description" : "Check the readiness of the application",
851+
"tags" : [ "MicroProfile Health" ],
852+
"summary" : "The Readiness check of this application",
853+
"responses" : {
854+
"200" : {
855+
"description" : "OK",
856+
"content" : {
857+
"application/json" : {
858+
"schema" : {
859+
"$ref" : "#/components/schemas/HealthResponse"
860+
}
861+
}
862+
}
863+
},
864+
"503" : {
865+
"description" : "Service Unavailable",
866+
"content" : {
867+
"application/json" : {
868+
"schema" : {
869+
"$ref" : "#/components/schemas/HealthResponse"
870+
}
871+
}
872+
}
873+
},
874+
"500" : {
875+
"description" : "Internal Server Error",
876+
"content" : {
877+
"application/json" : {
878+
"schema" : {
879+
"$ref" : "#/components/schemas/HealthResponse"
880+
}
881+
}
882+
}
883+
}
884+
}
885+
}
886+
},
887+
"/q/health/started" : {
888+
"description" : "MicroProfile Health - Startup Endpoint",
889+
"summary" : "Startup checks are an used to tell when the application has started",
890+
"get" : {
891+
"operationId" : "microprofile_health_startup",
892+
"description" : "Check the startup of the application",
893+
"tags" : [ "MicroProfile Health" ],
894+
"summary" : "The Startup check of this application",
895+
"responses" : {
896+
"200" : {
897+
"description" : "OK",
898+
"content" : {
899+
"application/json" : {
900+
"schema" : {
901+
"$ref" : "#/components/schemas/HealthResponse"
902+
}
903+
}
904+
}
905+
},
906+
"503" : {
907+
"description" : "Service Unavailable",
908+
"content" : {
909+
"application/json" : {
910+
"schema" : {
911+
"$ref" : "#/components/schemas/HealthResponse"
912+
}
913+
}
914+
}
915+
},
916+
"500" : {
917+
"description" : "Internal Server Error",
918+
"content" : {
919+
"application/json" : {
920+
"schema" : {
921+
"$ref" : "#/components/schemas/HealthResponse"
922+
}
923+
}
924+
}
925+
}
926+
}
927+
}
618928
}
619929
},
620930
"info" : {

0 commit comments

Comments
 (0)