REST Interface
FNZ Studio exposes simple resources using a REST API to obtain information about FNZ Studio's release version and state, and to initialize a cluster-wide shutdown.
Configuration
Before using the REST interface, you must enable it and configure authorization and authentication methods. Go to System Configuration > Configuration Properties > Edit Server Configuration (top left menu icon).
Changes to the configuration properties below are active immediately; no system restart is required.
| Configuration property | Description |
|---|---|
nm.rest.service.enabledBoolean |
Enable FNZ Studio's REST interface by setting this property to true. It is disabled by default. Example: nm.rest.service.enabled = trueDefault: false |
nm.rest.service.auth.ipsString |
Restrict access to the REST interface based the client's IP address. Enter a comma-separated list of IP addresses. You can use the star character (*) as a wildcard.nExamples:nnm.rest.service.auth.ips = 127.0.0.1,194.66.82.11,10.0.*nnm.rest.service.auth.ips = *Default value: 127.0.0.1,0:0:0:0:0:0:0:1 |
nm.rest.service.auth.loginEnum |
Specify the login method for REST clients: local: Accept only local users and check against password stored in user database, webapp: Use programmatic login method provided by the application server (requires support for servlet specification 3.0). nm.rest.service.auth.login = webapp. Default value: webapp |
nm.rest.service.auth.role Role |
Restrict access to the REST interface based on a user's role, e.g. Administrator, User, or another role defined in the application server. By default, no role is specified, meaning that a resource requiring authorization (e.g. /cluster/shutdown) cannot be called. Example: nm.rest.service.auth.role = Administrator. Default value: <empty> |
When executing a REST call, any access restrictions that apply are verified in the following order:
-
IP address match
-
User authentication
-
Role match
REST API
FNZ Studio's REST interface currently enables you to execute three types of GET requests, none of which require parameters:
/version/application/state/cluster/shutdown
To call a resource, use the following URI syntax:
http://${server}:${port}/${contextPath}/rest/${resourcePath}
Example:
http://localhost:8080/appway/rest/cluster/shutdown
| Resource path | Description |
|---|---|
/version
|
Returns the version of the FNZ Studio installation as a plain text string, e.g. '6.1.6'.nNo authentication is required: this resource can be called by any user regardless of role configuration. However, restrictions on IP addresses do apply. |
/application/state
|
| |Returns information about the state the FNZ Studio web application. Possible values are:
Note: This query applies to the whole cluster and cannot be used to check if a specific node in the cluster is still running. |
/cluster/shutdown
|
Initializes a cluster-wide shutdown, bringing all nodes into a status where stopping the application server or killing the JVM causes no rebalancing across nodes. Returns OK as a plain text string after the shutdown was successfully completed.nFor more information on shutting down a cluster installation, see Cluster Shutdown. |