Class Management
java.lang.Object
com.codename1.backend.Management
- All Implemented Interfaces:
HttpServer.Handler
The server's management endpoints: health for the load balancer, metrics for a scraper, and the jobs and managed beans for an operator.
GET /manage/health public; 503 while draining
GET /manage/metrics every metric, as JSON
GET /manage/prometheus every metric, in the Prometheus text format
GET /manage/jobs the scheduled jobs and their last runs
GET /manage/managed the managed beans, with their attributes' values
POST /manage/managed/{bean}/{operation} calls an operation; body: arguments
Off by default outside a development profile; cn1.management.enabled
turns it on or off explicitly, and cn1.management.path moves it.
Everything but health needs Authorization: Bearer .
Without a token, a development profile serves the read-only views to anyone
who can reach the port -- a laptop -- and no profile serves an operation,
since an operation changes the running server.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic ListdescribeBeans(List all) Each ofall-- a server's managed beans, fromBackend.getManagedBeans()-- with its attributes' current values and its operations.static ManagementfromConfig(Config config) The endpoints this configuration asks for, or null when they are off.handle(HttpServer.Request request) static Object
-
Field Details
-
ENABLED
- See Also:
-
PATH
- See Also:
-
TOKEN
- See Also:
-
-
Method Details
-
fromConfig
The endpoints this configuration asks for, or null when they are off.
Throws
IOException: when they are on outside development with no token, which would publish the server's internals to anyone
- Throws:
IOException
-
describeBeans
Each ofall-- a server's managed beans, fromBackend.getManagedBeans()-- with its attributes' current values and its operations. -
invoke
-
handle
- Specified by:
handlein interfaceHttpServer.Handler- Throws:
Exception
-