clusterReporterConfig


URI

<managerRoot uri>/clusterreporter[.<format>]

Supported methods

GET, PUT, HEAD

Parent resource

managerRoot

Introduction

clusterReporterConfig is the cluster reporter configuration information resource. Through the clusterReporterConfig resource, you can not only get the cluster reporter configuration information, but also report and add local computer to the cluster.

In the cluster architecture, any iServer can be a cluster server, accepting child node to join. When the child node joints, it needs to report to the cluster server address. (http://<ip>:<port>/iserver/services/cluster).

Supported Methods:

Supported output formats: rjson, json, html, xml.

Resource hierarchy

HTTP request methods

Implement the HTTP request on the following URI, where supermapiserver is the server name, with rjson being the output format.

http://supermapiserver:8090/iserver/manager/clusterreporter.rjson

GET request

Gets the configuration information of the cluster reporter.

Response structure

Execute the GET request on clusterReporterConfig. Return the configuration of the cluster reporter, as follows:

Field Type Description
reporters List<ReporterSetting> The cluster reporter.

Response example

The returned rjson format representation after implementing the GET request on the clusterReporterConfig resource  http://localhost:8090/iserver/manager/clusterreporter.rjson is as follows:

{"reporters": [

    {

        "address": "http://anotherclusterservice:8090/iserver/services/cluster",

        "enabled": false,

        "isTileWorker": false,

        "iserverId": "d7c64eb1ea1a4f11983082488ab9fba9",

        "localAddress": null,

        "token": null

    }

]}

PUT request

Add the new cluster reporter.

Request parameter

Following arguments need to be included in the request sent.

Name Type Description
reporters List<ReporterSetting> [Required]
The cluster reporter.

Response structure

The resource representation structure is as follows after implementing the PUT request.

Field Type Description

succeed

boolean Whether to add the cluster reporter successfully.

Response example

Executing POST request on clusterReporterConfig resource (http://localhost:8090/iserver/manager/clusterreporter.rjson), or add a cluster reporter. The request body to be sent is as follows:

{

    "reporters": [

        {

            "enabled": false,

            "iserverId": "d7c64eb1ea1a4f11983082488ab9fba9",

            "isTileWorker": false,

            "token": null,

            "address": "http://anotherclusterservice:8090/iserver/services/cluster",

            "localAddress": null

        },

        {

            "enabled": true,

            "isTileWorker": true,

            "token": "",

            "address": "http://192.168.17.147:8090/iserver/services/cluster"

        }

    ]

}

The response result in rjson format returned is as follows:

{

    "succeed": true

}

Executing PUT request on clusterReporterConfig resource (http://localhost:8090/iserver/manager/clusterreporter.rjson), or add a cluster reporter to spark cluster. The request body to be sent is as follows:

{

    "reporters": [

        {

            "enabled": true,

            "isTileWorker": false,

            "token": "",

            "address": "http://localhost:8090/iserver/services/cluster",

            "enabledSparkWork": true

        }

    ]

}

The response result in rjson format returned is as follows:

{

    "succeed": true

}

HEAD request

Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content. The meta-information includes the media-type, content-encoding, transfer-encoding, content-length, etc.

HEAD request can be used to check if the clusterReporterConfig resource exists, or if the clusterReporterConfig resource can be accessed by clients. It can also determine if the clusterReporterConfig resource supports an output format <format> if performed on a URI with .<format> included.

See