Announcing Hazelcast Cloud GraphQL Explorer

Today, we are happy to announce Hazelcast Cloud Public API support via GraphQL to provide more flexibility to automate Hazelcast Cloud clusters. If you have a Hazelcast Cloud account, you can go to GraphQL Explorer to try queries and mutations.

Hands-on Examples

Create Cluster

In order to create a cluster in Hazelcast Cloud, you need to know:

  • Cloud Provider
  • Region
  • Cluster Type
  • Memory
  • Hazelcast Version

You can create a cluster based on the above parameters in GraphQL with the following mutation:

mutation {
  createStarterCluster(
    input:{
      name:"my-cluster",
      cloudProvider:"aws",
      region:"us-west-2",
      clusterType:SMALL,
      totalMemory:2,
      hazelcastVersion:VERSION_4_0
    }
  ){
    id
    }
}

Once you create a cluster, it will return the newly created cluster’s id in the response. You can select any field of interest as all fields are already in GraphQL Explorer page > Docs tab.

Hazelcast Cloud GraphQL Docs

Get Cluster Details

You can get cluster detail by id with a simple query:

query {
  cluster(clusterId: "53827") {
    id
    name
    password
    port
    hazelcastVersion
    isAutoScalingEnabled
    isHotBackupEnabled
    isHotRestartEnabled
    isIpWhitelistEnabled
    isTlsEnabled
    productType {
      name
      isFree
    }
    state
    createdAt
    startedAt
    stoppedAt
    discoveryTokens {source,token}
  }
}

As you can see, cluster id is from the “create” step:

GraphQL Get Cluster Detail

For more detailed examples, you can refer to the Hazelcast Cloud API Reference page.

Go SDK and Hazelcast Cloud CLI Is On The Way

Hazelcast Cloud GraphQL support is the initial point of the automation world and in the next iteration, we will be releasing a Golang SDK and Hazelcast Cloud CLI. Besides the Hazelcast Cloud Console, you will be able to use hzcloud CLI to operate your clusters. If you are using Golang in your projects and wanted to integrate with Hazelcast Cloud, it will be available very soon.