A newer version of IMDG is available.

View latest

Using the REST Endpoint Groups

Hazelcast members exposes various REST endpoints and these are grouped. REST endpoint groups are as follows:

  • CLUSTER_READ

  • CLUSTER_WRITE

  • HEALTH_CHECK

  • HOT_RESTART

  • WAN

  • DATA

  • CP

Using the REST service is disabled by default. To be able to use the REST endpoints, you need to enable the REST API as follows:
  • XML

  • YAML

<hazelcast>
    ...
    <network>
        <rest-api enabled="true">
        ...
        </rest-api>
    </network>
    ...
</hazelcast>
hazelcast:
  network:
    rest-api:
      enabled: true

The following table lists all the endpoints along with the groups they belong to.

Table 1. REST Endpoint Groups
Endpoint Group Default Endpoints

CLUSTER_READ

Enabled

  • /hazelcast/rest/cluster

  • /hazelcast/rest/management/cluster/state

  • /hazelcast/rest/license (GET)

  • /hazelcast/rest/management/cluster/version (GET)

  • /hazelcast/rest/management/cluster/nodes

  • /hazelcast/rest/instance

CLUSTER_WRITE

Disabled

  • /hazelcast/rest/management/cluster/changeState

  • /hazelcast/rest/license (POST)

  • /hazelcast/rest/management/cluster/version (POST)

  • /hazelcast/rest/management/cluster/clusterShutdown

  • /hazelcast/rest/management/cluster/memberShutdown

  • /hazelcast/rest/cp-subsystem/members/local

  • /hazelcast/rest/cp-subsystem/groups

  • /hazelcast/rest/cp-subsystem/groups/${CPGROUP_NAME}

  • /hazelcast/rest/cp-subsystem/members

  • /hazelcast/rest/cp-subsystem/groups/${CPGROUP_NAME}/remove

  • /hazelcast/rest/cp-subsystem/members/${CPMEMBER_UUID}/remove

  • /hazelcast/rest/cp-subsystem/restart

  • /hazelcast/rest/cp-subsystem/groups/${CPGROUP_NAME}/sessions

  • /hazelcast/rest/cp-subsystem/groups/${CPGROUP_NAME}/sessions/${CP_SESSION_ID}/remove

  • /hazelcast/ (Other HTTP REST API operations)

HEALTH_CHECK

Enabled

  • /hazelcast/health/node-state

  • /hazelcast/health/cluster-state

  • /hazelcast/health/cluster-safe

  • /hazelcast/health/migration-queue-size

  • /hazelcast/health/cluster-size

  • /hazelcast/health/ready

HOT_RESTART

Disabled

  • /hazelcast/rest/management/cluster/forceStart

  • /hazelcast/rest/management/cluster/partialStart

  • /hazelcast/rest/management/cluster/hotBackup

  • /hazelcast/rest/management/cluster/hotBackupInterrupt

WAN

Disabled

  • /hazelcast/rest/wan/sync/map

  • /hazelcast/rest/wan/sync/allmaps

  • /hazelcast/rest/wan/clearWanQueues

  • /hazelcast/rest/wan/addWanConfig

  • /hazelcast/rest/wan/pausePublisher

  • /hazelcast/rest/wan/stopPublisher

  • /hazelcast/rest/wan/resumePublisher

  • /hazelcast/rest/wan/consistencyCheck/map

DATA

Disabled

  • /hazelcast/rest/maps/

  • /hazelcast/rest/queues/QUEUE_NAME/size

  • /hazelcast/rest/queues/$QUEUE_NAME/$SECONDS

CP

Disabled

  • /hazelcast/rest/cp-subsystem/members/local

  • /hazelcast/rest/cp-subsystem/groups

  • /hazelcast/rest/cp-subsystem/groups/${CPGROUP_NAME}

  • /hazelcast/rest/cp-subsystem/members

  • /hazelcast/rest/cp-subsystem/groups/${CPGROUP_NAME}/remove

  • /hazelcast/rest/cp-subsystem/members/${CPMEMBER_UUID}/remove

  • /hazelcast/rest/cp-subsystem/reset

  • /hazelcast/rest/cp-subsystem/groups/${CPGROUP_NAME}/sessions

  • /hazelcast/rest/cp-subsystem/groups/${CPGROUP_NAME}/sessions/${CP_SESSION_ID}/remove

You can enable or disable any REST endpoint group using the following declarative configuration (HEALTH_CHECK group is used as an example):

  • XML

  • YAML

<hazelcast>
    ...
    <network>
        <rest-api enabled="true">
            <endpoint-group name="HEALTH_CHECK" enabled="false"/>
        </rest-api>
    </network>
    ...
</hazelcast>
hazelcast:
  network:
    rest-api:
      enabled: true
      endpoint-groups:
        HEALTH_CHECK
          enabled: false

The following is the equivalent programmatic configuration:

RestApiConfig restApiConfig = new RestApiConfig()
        .setEnabled(false)
        .enableGroups(RestEndpointGroup.HEALTH_CHECK);
Config config = new Config();
config.getNetworkConfig().setRestApiConfig(restApiConfig);

Alternatively, you can also use the advanced-network element for the same purpose:

  • XML

  • YAML

<hazelcast>
    ...
    <advanced-network enabled="true">
        <rest-server-socket-endpoint-config>
            <endpoint-groups>
                <endpoint-group name="HEALTH_CHECK" enabled="false"/>
            </endpoint-groups>
        </rest-server-socket-endpoint-config>
    </advanced-network>
    ...
</hazelcast>
hazelcast:
  advanced-network:
    enabled: true
    rest-server-socket-endpoint-config:
      endpoint-groups:
        HEALTH_CHECK:
          enabled: false

And the following is the equivalent programmatic configuration:

RestServerEndpointConfig restServerEndpointConfig = new RestServerEndpointConfig()
        .setEnabled(false);
        .enableGroups(RestEndpointGroup.HEALTH_CHECK);
Config config = new Config();
config.getAdvancedNetworkConfig().setRestEndpointConfig(restServerEndpointConfig);
See the Advanced Network Configuration section for more information on the advanced-network element.

When you enable or disable a REST endpoint group, all the endpoints in that group are enabled or disabled, respectively. For the examples above, we disabled the endpoints belonging to the HEALTH_CHECK endpoint group.