docs-site/content/cloud-management-api/v1/cluster-configuration-changes.md
Once you've provisioned a cluster via the Typesense Cloud web console or using the Cluster Management API, you can change its configuration using the API below.
Here's a typical sequence of API Calls you'd perform when using this API:
The rest of this document will talk about the individual endpoints.
This endpoint lets you change the RAM, CPU, High Availability and Typesense Server versions of a cluster that is in service.
You can skip any fields you don't want to change in the payload below.
curl -X POST --location "https://cloud.typesense.org/api/v1/clusters/<ClusterId>/configuration-changes" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-TYPESENSE-CLOUD-MANAGEMENT-API-KEY: YOUR-API-KEY" \
-d '{
"new_memory": "1_gb",
"new_vcpu": "2_vcpus_2_hr_burst_per_day",
"new_typesense_server_version: "0.24.1",
"new_high_availability: "yes",
"perform_change_at": 1787923647,
"notification_email_addresses": ["[email protected]"]
}'
Response:
{
"success": true,
"configuration_change": {
"id": "ecf1d570-7f49-47ef-b648-41ccf7eaf5d2",
"status": "pending",
"created_at": 1687996347,
"updated_at": 1687996347,
"perform_change_at": 1787923647,
"completed_at": null,
"old_memory": "0.5_gb",
"old_vcpu": "2_vcpus_1_hr_burst_per_day",
"old_gpu": null,
"old_high_performance_disk": null,
"old_typesense_server_version": "0.23.1",
"old_high_availability": "no",
"old_load_balancing": "no",
"new_memory": "1_gb",
"new_vcpu": "2_vcpus_2_hr_burst_per_day",
"new_gpu": null,
"new_high_performance_disk": null,
"new_typesense_server_version": "0.24.1",
"new_high_availability": "yes",
"new_load_balancing": "yes",
"notification_email_addresses": [
"[email protected]"
]
}
}
:::tip Note You can only have one configuration change active / pending at a given time. :::
You can use any of the following parameters inside the payload of the above API call:
perform_change_atThe Unix timestamp at which this configuration change should be performed at.
Should be a timestamp in the future.
new_memoryHow much RAM this cluster should have.
You can use any of the following values mentioned here.
new_vcpuHow many CPU cores this cluster should have.
Only certain CPU configuration are available with particular RAM configurations. The table here lists all available configurations.
new_gpuWhen set to yes, it enables the use of a GPU to accelerate embedding generation when using built-in ML models both during indexing and searching.
Only certain RAM / CPU configurations are available with GPU acceleration. The table here lists all available configurations.
new_high_availabilityWhen set to yes, at least 3 nodes are provisioned in 3 different data centers to form a highly available (HA) cluster and your data is automatically replicated between all nodes.
:::tip Note Once High Availability is enabled, it cannot be turned off.
If you want to turn off HA, you'd need to provision a new cluster without HA, reindex your data in it and then terminate the HA cluster. :::
new_high_performance_diskWhen set to yes, the provisioned hard disk will be co-located on the same physical server that runs the node.
IMPORTANT: This option is only available when:
new_typesense_server_versionThe Typesense Server version to change this cluster to.
This endpoint can be used to get information about a single configuration change.
curl -X GET --location "https://cloud.typesense.org/api/v1/clusters/<ClusterID>/configuration-changes/<ConfigurationChangeId>" \
-H "Accept: application/json" \
-H "X-TYPESENSE-CLOUD-MANAGEMENT-API-KEY: YOUR-API-KEY"
Response:
{
"id": "ecf1d570-7f49-47ef-b648-41ccf7eaf5d2",
"status": "pending",
"created_at": 1687996347,
"updated_at": 1687996347,
"perform_change_at": 1787923647,
"completed_at": null,
"old_memory": "0.5_gb",
"old_vcpu": "2_vcpus_1_hr_burst_per_day",
"old_gpu": null,
"old_high_performance_disk": null,
"old_typesense_server_version": "0.23.1",
"old_high_availability": "no",
"old_load_balancing": "no",
"new_memory": "1_gb",
"new_vcpu": "2_vcpus_2_hr_burst_per_day",
"new_gpu": null,
"new_high_performance_disk": null,
"new_typesense_server_version": "0.24.1",
"new_high_availability": "yes",
"new_load_balancing": "yes",
"notification_email_addresses": [
"[email protected]"
]
}
statusThe status field can be any of the following values:
status | Description |
|---|---|
pending | Config change is pending execution at the specified perform_change_at timestamp. |
in_progress | Config change is in progress and cannot be canceled any more. |
canceled | Config change was canceled. |
succeeded | Config change was successfully completed. The completed_at field will give you the time when this config change was completed. |
failed | Config change failed due to an internal error. |
This endpoint can be used to list all configuration changes for a cluster.
curl -X GET --location "https://cloud.typesense.org/api/v1/clusters/<ClusterID>/configuration-changes?per_page=1" \
-H "Accept: application/json" \
-H "X-TYPESENSE-CLOUD-MANAGEMENT-API-KEY: YOUR-API-KEY"
Response:
{
"page": 1,
"per_page": 1,
"total": 10,
"configuration_changes": [
"id": "ecf1d570-7f49-47ef-b648-41ccf7eaf5d2",
"status": "pending",
"created_at": 1687996347,
"updated_at": 1687996347,
"perform_change_at": 1787923647,
"completed_at": null,
"old_memory": "0.5_gb",
"old_vcpu": "2_vcpus_1_hr_burst_per_day",
"old_gpu": null,
"old_high_performance_disk": null,
"old_typesense_server_version": "0.23.1",
"old_high_availability": "no",
"old_load_balancing": "no",
"new_memory": "1_gb",
"new_vcpu": "2_vcpus_2_hr_burst_per_day",
"new_gpu": null,
"new_high_performance_disk": null,
"new_typesense_server_version": "0.24.1",
"new_high_availability": "yes",
"new_load_balancing": "yes",
"notification_email_addresses": [
"[email protected]"
]
]
}
You can use the following query parameters with this endpoint:
per_pageThe number of results per page.
Default: 10
pagePage number to fetch
Default: 1
You can use this endpoint to cancel a pending configuration change.
curl -X PATCH --location "https://cloud.typesense.org/api/v1/clusters/<ClusterID>/configuration-changes/<ConfigurationChangeId>" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-TYPESENSE-CLOUD-MANAGEMENT-API-KEY: YOUR-API-KEY" \
-d '{
"status": "canceled"
}'
Response:
{
"success": true,
"configuration_change": {
"id": "ecf1d570-7f49-47ef-b648-41ccf7eaf5d2",
"status": "canceled",
"created_at": 1687996347,
"updated_at": 1687996347,
"perform_change_at": 1787923647,
"completed_at": null,
"old_memory": "0.5_gb",
"old_vcpu": "2_vcpus_1_hr_burst_per_day",
"old_high_performance_disk": null,
"old_typesense_server_version": "0.23.1",
"old_high_availability": "no",
"old_load_balancing": "no",
"new_memory": "1_gb",
"new_vcpu": "2_vcpus_2_hr_burst_per_day",
"new_high_performance_disk": null,
"new_typesense_server_version": "0.24.1",
"new_high_availability": "yes",
"new_load_balancing": "yes",
"notification_email_addresses": [
"[email protected]"
]
}
}