GridGain Developers Hub

REST API

The GridGain 9 clusters provide an OpenAPI specification that can be used to work with GridGain 9 by standard REST methods.

OpenAPI Specification

You can access online specification in the API section. The OpenAPI documentation provides extended information on all REST endpoints you can access and the required payloads.

REST Connector Configuration

By default, rest connector starts on port 10300. THis port can be configured in the ignite.rest node configuration.

Using HTTP Tools

Once the cluster is started, you can use external tools to monitor the cluster over http, or manage the cluster. In this example, we will use curl to get cluster status:

curl 'http://localhost:10300/management/v1/cluster/state'

You are not limited to only monitoring, as GridGain REST API provides endpoints that can be used to manage the cluster as well. For example, you can create a snapshot via REST:

curl -H "Content-Type: application/json" -d '{"snapshotType": "FULL","tableNames": "table1,table2","startTimeEpochMilli": 0}' http://localhost:10300/management/v1/snapshot/create

You can also rename an already-initialized cluster. The new name is sent as a plain-text body to the cluster/rename endpoint:

curl -X POST -H "Content-Type: text/plain" -d 'newClusterName' http://localhost:10300/management/v1/cluster/rename

On success, the endpoint returns the updated ClusterTag as JSON, including the new name and the unchanged cluster ID. The request fails with 400 if the supplied name is empty. The same operation is available from the CLI tool as cluster rename.

Java Project Configuration

If you want to integrate GridGain REST API closer into your application, we recommend using an OpenAPI generator to generate a Java client. Once the client is generated, you can use it to work with REST API from code, for example:

ApiClient client = Configuration.getDefaultApiClient();
// Set base URL
client.setBasePath("http://localhost:10300");

// Get cluster configuration.
ClusterConfigurationApi clusterConfigurationApi = new ClusterConfigurationApi(client);
String configuration = clusterConfigurationApi.getClusterConfiguration();