API Reference
Hazelcast Cloud uses GraphQL to provide a public API to consumers.
Queries
Cloud Providers
While creating a cluster on Hazelcast Cloud, you need to decide which cloud provider to use. You can make this decision according to where your current infrastructure is. Also, the cloud providers we support change according to the type of product you will use. We support different cloud providers on the Standard and Enterprise plans. So, you need to check available cloud providers before creating a cluster from our GraphQL API with a query cloudProviders
query {
cloudProviders {
name
isEnabledForStandard
isEnabledForEnterprise
}
}
Regions
Regions are geographic locations of where your cloud resources are located. Different cloud providers support different regions. Also, there may be some regions that we don’t support yet. So that you need to check available regions before creating a Hazecast Cluster on Hazecast Cloud from our GraphQL API with query regions
.
query {
regions(cloudProvider: "aws") {
name
isEnabledForStandard
isEnabledForEnterprise
}
}
Hazelcast Versions
In order to create or upgrade a version of an Enterprise type of cluster on Hazelcast Cloud, you need to select which Hazelcast version you need. The Hazelcast versions the Hazelcast Cloud supports changes according to the type of the product. So that you need to check available Hazelcast versions for your need with hazelcastVersion query
query {
hazelcastVersions {
version
upgradeableVersions
}
}
Instance Types
Instance types comprise varying combinations of CPU, memory, storage, and networking capacity and give you the flexibility to choose the appropriate mix of resources for your applications. Instance types changes according to a cloud provider, regions, and the ones we supported. In order to create Enterprise Cluster on Hazelcast Cloud, you need to select which instance type you will use with query instanceTypes
.
query {
instanceTypes(cloudProvider: "aws") {
name
totalMemory
}
}
Availability Zones
Availability zones are isolated locations within data center regions from which public cloud services originate and operate. In order to create Enterprise Cluster on Hazelcast Cloud, you need to select which availability zones should be used. This availability zones changes according to the cloud provider and region. Also, the number of instances you need, may not be available on this availability zones. So that you need to check available availability zones for your demand with availabilityZones query
.
query {
availabilityZones(
cloudProvider: "aws"
region: "us-west-2"
instanceType: "m5.large"
instanceCount: 5
) {
name
}
}
Cluster Details
You can fetch the details of the cluster you selected with Id as an input. To get details of select cluster you need to use cluster query
query {
cluster(clusterId: "423") {
id
name
password
port
hazelcastVersion
isAutoScalingEnabled
isHotBackupEnabled
isHotRestartEnabled
isIpWhitelistEnabled
isTlsEnabled
productType {
name
isFree
}
state
createdAt
startedAt
stoppedAt
discoveryTokens {source,token}
}
}
Cluster List
You can list all of your clusters according to their type of product (STANDARD
, ENTERPRISE
) with their details. You can fetch them will using clusters query
with providing product type.
query {
clusters(productType:"STANDARD") {
id
name
password
port
hazelcastVersion
isAutoScalingEnabled
isHotBackupEnabled
isHotRestartEnabled
isIpWhitelistEnabled
isTlsEnabled
productType {
name
isFree
}
state
createdAt
startedAt
stoppedAt
discoveryTokens {source,token}
}
}
Mutations
=== Create Standard Cluster
You can create a new Standard Hazelcast Cluster with createStandardCluster
mutation. This mutation needs at least the following inputs; name, cloud provider, region, cluster type, total memory, and Hazelcast version
. You can optionally provide other properties like data structures etc.
You need to collect some inputs from other queries. In this case, you need to get |
You can optionally provide other properties like data structures, hot backup features, etc. |
mutation {
createStandardCluster(
input: {
name: "my-cluster"
cloudProvider: "aws"
region: "us-west-2"
clusterType: SMALL
totalMemory: 2
hazelcastVersion: VERSION_4_0
}
) {
id
}
}
Create Enterprise Cluster
You can create a new Enterprise Hazelcast Cluster with createEnterpriseCluster mutation
. This mutation needs at least the following inputs; name, cloud provider, region, zones, instance type, instance per zone, Hazelcast version, public access value, and CIDR block
.
You need to collect some inputs from other queries. In this case, you need to get Also, you need to care about if the cloud provider and region are enabled for the enterprise version of the Hazelcast Cloud Product. |
You can optionally provide other properties like data structures, hot backup features, etc. |
mutation {
createEnterpriseCluster(
input:{
name: "my-cluster"
cloudProvider: "aws"
region: "eu-west-2"
zones: ["eu-west-2a", "eu-west-2b"]
instanceType: "m5.large"
instancePerZone: 2
hazelcastVersion: "4.0"
isPublicAccessEnabled: true
cidrBlock: "10.0.1.0/16"
}
)
{
id
}
}
Delete Cluster
You can delete your cluster with deleteCluster
mutation with providing id of the cluster as an argument.
mutation {
deleteCluster(clusterId:"101") {
clusterId
}
}