Skip to content

RestSwarmCategory

stockiNail edited this page May 24, 2017 · 4 revisions

Swarm services category

The swarm services give you the capability to manage JEM swarm environment, if configured.

Getting nodes

Provides a collection of swarm nodes by a filter.

Request
Parameter Value
URL /swarm/list?filter=
Method GET
Path none
Query filter parameter is optional and conatins the filter string (hostname, ip address or label of node) to apply to get what you are searching. Default is *
Content-Type application/json
Accept-Type application/json
Body none
Response
Status code Description
200 OK - Returns a list of nodes
500 Internal Server Error - The service had an exception
503 Service Unavailable - JEM cluster is not available.

Getting nodes by a complex filter

Provides a collection of nodes by a filter, with complex filter.

Request
Parameter Value
URL /swarm/listByFilter?filter=
Method GET
Path none
Query filter parameter is optional and conatins the filter string to apply to get what you are searching. Default is *
Content-Type application/json
Accept-Type application/json
Body none
Response
Status code Description
200 OK - Returns a list of nodes
500 Internal Server Error - The service had an exception
503 Service Unavailable - JEM cluster is not available.

Starting the swarm

You can start the swarm environment.

Request
Parameter Value
URL /swarm/start/
Method PUT
Path none
Query none
Content-Type application/json
Accept-Type text/plain
Body none
Response
Status code Description
200 OK - Returns true if it was able to start the swarm, otherwise false.
The TEXT format is:
"true" or "false"
500 Internal Server Error - The service had an exception
503 Service Unavailable - JEM cluster is not available.

Draining the swarm

You can drain the swarm environment.

Request
Parameter Value
URL /swarm/drain
Method PUT
Path none
Query none
Content-Type application/json
Accept-Type text/plain
Body none
Response
Status code Description
200 OK - Returns true if it was able to drain the swarm, otherwise false.
The TEXT format is:
"true" or "false"
500 Internal Server Error - The service had an exception
503 Service Unavailable - JEM cluster is not available.

Getting the swarm status

You can get the current status of swarm environment.

Request
Parameter Value
URL /swarm/status
Method GET
Path none
Query none
Content-Type application/json
Accept-Type text/plain
Body none
Response
Status code Description
200 OK - Returns the current status of swarm, in text format
500 Internal Server Error - The service had an exception
503 Service Unavailable - JEM cluster is not available.

Body format

This section described the JSON format of the BODY parameters to use in the requests and the BODY responses.

Nodes

It's a collection of nodes information:

[ node1,..., nodeN]
Node

A node is described by the following JSON format:

{
  "hostname" : "host name",
  "ipaddress" : "IP address",
  "port" : Hazelcast port (Integer),
  "rmiPort" : RMI port  port (Integer),
  "processId" : "process id in format [id]@[hostname]",
  "status" : "current status",
  "jobNames" : [ "list of job names which are managed by the JEM node"],
  "key" : "unique key in UUID format",
  "label" : "ip address and prot together",
  "executionEnvironment" : {
    "environment" : "JEM environment",
    "domain" : "servable domain",
    "staticAffinities" : [ "list of static affinity configured in JEM configuration file" ],
    "dynamicAffinities" : [ "list of affinities created by affinity policy" ],
    "memory" : current memory which can offer to the jobs to be executed (Integer),
    "parallelJobs" : maximum number of jobs which it can execute in parallel (Integer),
    "allAffinities" : [ "list with all affinities, merge of static and dynamic ones" ]
  },
  "systemArchitecture" : "system architecture",
  "systemName" : "OS name",
  "availableProcessors" : CPU of machines (Integer),
  "totalMemory" : total memory of machines (Integer),
  "startedTime" : started time in UTC format (Long),
  "type" : "java class used to manage the node",
  "jemVersion" : "JEM version",
  "javaVendor" : "JVM provider",
  "javaVersion" : "JAVA version",
  "swarmNode" : if it's a swarm node (Boolean),
  "operational" : if it's operational (Boolean)
}
Clone this wiki locally