Servers
The Servers resource provides information about the executing shim as well as a means for shutting the shim down. The information returned about the shim includes:
Name | Description |
---|---|
uuid | Unique identifier associated with the server |
interface | Interface the server is bound to |
port | Port the server is listening for connections on |
version | Software release number of the shim |
started | Date the shim what started |
There are two other properties that are only available when the shim is shutting down:
Name | Description |
---|---|
shutdownTime | Number of seconds until the shim terminates |
alreadyInProgress | true if the shim is terminating |
Since the shim is multi-threaded and multi-tenanted there is only one instance required handle all EMu based connections. The shim information returned applies to that single instance. When more than one instance of the shim is executed they run independent of each other and the information about other shims is not combined with that of the requested shim.
The servers resource is a shared resource since it is not associated with a tenant. It is system based. The shared tenant name is used along with the servers resource name to interact with the resource.
The following requests are supported for the servers resource.
Delete
DELETE /shared/servers
DELETE /shared/servers/{uuid}
The DELETE verb shuts down the shim. The first form requests all shims to shutdown, but given there is only one shim instance running it is terminated. The second form identifies the running instance by the UUID assigned to it when it started. The UUID can be retrieved using one of the GET methods. The shim may only be shutdown by the system administrator as defined by the admin server configuration setting.
The DELETE request may take a payload indicating the number of seconds to delay before the shim is terminated. A value greater than zero is recommended to ensure any outstanding requests complete before the shutdown. If a payload is not provided then the server configuration setting shutdownTime provides the value. The default value is three seconds.
The JSON Schema definition for the payload is:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "emu:/shared/resources/shutdown#",
"title": "shutdown definitions",
"description": "Definitions to validate JSON shutdown payload",
"definitions": {
"shutdown": {
"type": "object",
"properties": {
"shutdownTime": {
"type": "integer",
"minimum": 0
}
},
"additionalProperties": false
}
},
"anyOf": [
{
"$comment": "Required for shutdown delay",
"$ref": "#/definitions/shutdown"
}
]
}
Example URI
DELETE /shared/servers
Headers
Content-Type: application/json
Authorization: Bearer {token}
Prefer: representation=minimal
Body
{
"shutdownTime": 60
}
Response 200
{
"id": "emu:/shared/servers/fb8233a5-d76b-4876-b26b-d57b2739c13e",
"version": 1,
"data": {
"uuid": "fb8233a5-d76b-4876-b26b-d57b2739c13e",
"interface": "0.0.0.0",
"port": 8084,
"version": "1.0.8",
"started": "2021-04-28T14:56:11.285761+10:00",
"shutdownTime": 60,
"alreadyInProgress": false
}
}
Response Headers
Content-Type: application/json
Authorization: Bearer {token}
Retrieve
GET /shared/servers[?select={selectlist}]
GET /shared/servers/{uuid}[?select={selectlist}]
The GET method retrieves information about the running instance of the shim. The first form returns the results in a matches array, compatible with a search returning all servers, although there is only ever one server. The second form may be used where the UUID associated with the server instance is known.
By default all values in the record are returned. You can limit the values returned using the select query parameter. The parameter takes a comma separated list of field names. The field names are that of the enveloped record so most field names will start with data.. The Select Syntax section provides a complete description of acceptable values for the select query parameter.
Example URI
GET /shared/servers
Headers
Authorization: Bearer {token}
Prefer: representation=minimal
Response 200
{
"@namespaces": {
"emu": {
"name": "http://axiell.com/emu#"
}
},
"@controls": {
"self": {
"href": "http://swanston.melbourne.axiell.com:8084/shared/servers"
},
"start": {
"method": "GET",
"href": "http://swanston.melbourne.axiell.com:8084/"
},
"search": {
"method": "GET",
"href": "http://swanston.melbourne.axiell.com:8084/shared/servers"
}
},
"matches": [
{
"id": "emu:/shared/servers/a6ca56b7-a34e-45d4-acbf-e843553dcccd",
"version": 1,
"data": {
"uuid": "a6ca56b7-a34e-45d4-acbf-e843553dcccd",
"interface": "0.0.0.0",
"port": 8084,
"version": "1.0.8",
"started": "2021-04-26T17:19:58.252+10:00"
},
"@controls": {
"self": {
"href": "http://swanston.melbourne.axiell.com:8084/shared/servers/a6ca56b7-a34e-45d4-acbf-e843553dcccd"
}
}
}
]
}
Response Headers
Content-Type: application/vnd.mason+json; charset=UTF-8
Authorization: Bearer {token}