Get and Basic Get Services
Get Service
This is a Get service that returns node information. You can use the Get service (with associated Service Template) to isolate a GMS node based on GMS status. This service has the following characteristics:
- It returns an HTTP response code of either 200 OK or 503 Service Unavailable, by default.
- For 200 OK responses, it also returns all options specified in the configuration.
You can create a service of this type in your environment, and configure your load balancer to use the service as the health check. To take a node out of service (for load balancing purposes and based on your load balancer settings), simply configure the service to return the required HTTP code (503, 404, and so on).
Sequence Diagrams
Configuration
Using the GMS Service Management User Interface, load the Get service template, and configure the Get service.
Option Name | Option Value | Description |
---|---|---|
_type | builtin | Type of service. |
_offline_code | 503 | HTTP code to return when GMS is OFFLINE (default is 503). |
_online_code | 200 | HTTP code to return when GMS is ONLINE (default is 200). |
_service | get | Service name. |
custom_parameter_1 | value1 | Available for custom values.
Note: Do not use a leading underscore with the custom parameters. Custom parameters with leading underscores will not be returned in responses from the service. |
custom_parameter_2 | value2 | Available for custom values.
Note: Do not use a leading underscore with the custom parameters. Custom parameters with leading underscores will not be returned in responses from the service. |
API
Enable / Disable Node
Enables changing the GMS node status:
- ONLINE: GMS is OK to process requests.
- OFFLINE: GMS is running, accepts requests, but Load Balancer will be aware that it will need to remove this GMS from the active GMS list (for future maintenance). The Application in Solution Control Interface (SCI) will appear as Suspended.
- SHUTDOWN: GMS shuts down.
Note: The following two URLs are protected by Basic Authentication:
- POST http://127.0.0.1:8080/genesys/1/admin/node/changestatus/OFFLINE
- POST http://127.0.0.1:8080/genesys/1/admin/node/changestatus/ONLINE
Operation
Method | POST | ||
---|---|---|---|
URL | /genesys/1/admin/node/changestatus/{status} | ||
Parameter | Type | Mandatory | Description |
URI Parameters | |||
status | string | mandatory | ONLINE, OFFLINE, SHUTDOWN |
Response
HTTP code | 200 |
---|---|
HTTP message | OK |
Get Node Status
Operation
Method | GET | ||
---|---|---|---|
URL | /genesys/1/service/{serviceName} | ||
Parameter | Type | Mandatory | Description |
URI Parameters | |||
serviceName | string | mandatory | Name of the builtin "GET" service defined in Service Management UI. |
Response
HTTP code | 200 |
---|---|
HTTP message | OK |
Body | A JSON object with list of defined parameters |
Example
GET http://127.0.0.1:8080/genesys/1/service/LoadBalancer-checker HTTP/1.1 Accept-Encoding: gzip,deflate gms_user: dd Host: 127.0.0.1:8080 Connection: Keep-Alive User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
Response in case of GMS being online:
HTTP/1.1 200 OK Date: Tue, 12 Nov 2013 15:38:55 GMT Pragma: no-cache Cache-Control: no-cache Cache-Control: no-store Content-Type: application/json;charset=UTF-8 Content-Type: application/json;charset=UTF-8 Transfer-Encoding: chunked Server: Jetty(7.6.0.v20120127) {"custom_parameter_1":"value1","custom_parameter_2":"value2"}
Basic Get Service
(Introduced in GMS 8.5.000.08.)
This is a basic_get service that returns service information. You can use the basic_get service to isolate a GMS service based on the Configuration Manager option. This service has the following characteristics:
- It returns an HTTP response code based on the result option defined in Configuration Manager. If the result is 404, a 404 error will be thrown on the service response.
- It returns a JSON list of values defined in Configuration Manager if the value of the result option is 200.
Example
The following table shows an example for the section service.basicget service in Configuration Manager:
Option Name | Option Value | Description |
---|---|---|
_service | basic_get
|
Service name. |
_type | builtin | Genesys Mobile Services-based services. |
error_code | 404 Not Found | HTTP error code. |
result | 404 | HTTP response code. |
Where:
Option name | Option type | Restriction on value | Description |
---|---|---|---|
result | String | Mandatory
Valid values: 200,401,403,404,503, and so on. |
A valid HTTP response code (http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html). If result=200, the response body will contain a JSON list of options defined in Configuration Manager (options that do not have a leading underscore, for example, error_code or result). |
Example of response:
[service.basic_get] _service=basic_get _type=builtin error_code=200 OK result=200 HTTP Response: { "result": "200", "error_code": "200 OK" }