Soabase adds support for Jersey Resources to the Dropwizard admin servlet. It also adds a suite of useful APIs.
By default, the base path for admin APIs is "/api".
API | METHOD | Payload | Response |
/api/soa | GET | n/a | A SoaInfo object (see below) |
/api/soa/discovery/single/{service} | GET | n/a | A DiscoveryInstance object (see below) representing an available registered instance for the specified service. |
/api/soa/discovery/all/{service} | GET | n/a | List of DiscoveryInstance objects (see below) representing all available registered instances for the specified service. |
/api/soa/discovery/services | GET | n/a | List of all currently known services. |
/api/soa/discovery/deploymentGroups/{service} | GET | n/a | An array. Each array index is the name of a deployment group. The value is true if the group is active, false if not. |
/api/soa/discovery/deploymentGroup/{service}/{group} | PUT | boolean | Change the activation state of the given deployment group for the given service. Leave the group blank for the default group. |
/api/soa/discovery/deploymentGroup/{service} | POST | DeploymentGroupSetting[] | Change the activation states of the all deployment groups for the given service. Groups not in the payload are removed. |
/api/soa/attributes/{key} | GET | n/a | Returns the current value of the specified dynamic attribute as the instance would see it (i.e. applying scopes, etc.). |
/api/soa/attributes/{key} | PUT | String | Override the value of the specified dynamic attribute in this instance. |
/api/soa/attributes/{key} | DELETE | /n/a | Delete any override of the specified dynamic attribute in this instance. |
/api/soa/logging/files | GET | /n/a | List of log files as LoggingFile objects (see below). |
/api/soa/logging/file/gzip/{key} | GET | /n/a | Returns the specified log file using a gzip stream. |
/api/soa/logging/file/raw/{key} | GET | /n/a | Returns the specified log file using an uncompressed stream. |
You can add your own Jersey Resources to the admin servlet. In the run() method of your application, access the admin Jersey Environment via:
SoaFeatures features = SoaBundle.getFeatures(environment); JerseyEnvironment adminJerseyEnvironment = features.getNamedRequired(JerseyEnvironment.class, SoaFeatures.ADMIN_NAME); adminJerseyEnvironment.register(...) ... etc. ...
SoaInfo | |
mainPort | the instance's main port |
adminPort | the instance's admin port |
serviceName | the serviceName that the instance is part of |
instanceName | the instance's instanceName |
startTimeUtc | the start time of the instance UTC |
currentTimeUtc | the current time of the instance UTC |
DiscoveryInstance | |
id | Instance Id |
host | Host/address |
port | main port |
forceSsl | if true, main port is SSL |
adminPort | admin port |
healthyState | either "HEALTHY" or "UNHEALTHY" |
metaData | app defined meta data |
forcedState | one of "CLEARED", "REGISTER" or "UNREGISTER" |
LoggingFile | |
key | Key to use in subsequent APIs to reference the log file |
name | Log file name |
file | Full path to the file |
DeploymentGroupSetting | |
name | Deployment group name (or empty string for the default) |
active | boolean - true if active, false if not |