API Reference
The GraphQL API is deprecated and no longer maintained. You can continue to use it with legacy clusters, but it does not support Viridian Cloud clusters. |
Queries
Cloud Providers
While creating a cluster, 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 cluster on Viridian Cloud from our GraphQL API with query regions
.
query {
regions(cloudProvider: "aws") {
name
isEnabledForStandard
isEnabledForEnterprise
}
}
Hazelcast Versions
To create or upgrade the Hazelcast Platform version of an Enterprise cluster, you need to select which Hazelcast version you need. To check available Hazelcast Platform versions, use the hazelcastVersions
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 an Enterprise cluster, 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 clusters, 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 zone. 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 a Standard Cluster
You can create a new Standard cluster with the 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 an Enterprise Cluster
You can create a new Enterprise cluster with the 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 Dedicated. |
You can optionally provide other properties such as data structures and Persistence features. |
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 by providing the ID of the cluster as an argument.
mutation {
deleteCluster(clusterId:"101") {
clusterId
}
}