Skip to content

Add section to CC API doc on updating resources for Advanced clusters #19541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions src/current/cockroachcloud/cloud-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,52 @@ If the request was successful, the API returns the updated cluster details.

For details about returned fields, refer to the [response example and schema](https://www.cockroachlabs.com/docs/api/cloud/v1.html#patch-/api/v1/clusters/-cluster_id-) in the API reference.

## Change the resources for a CockroachDB Advanced cluster

To change the hardware specifications (e.g., number of vCPUs or number of nodes) for a CockroachDB Advanced cluster, use the `/v1/clusters/{cluster_id}` endpoint with the `PATCH` method.

For example, to change the number of vCPUs per node to 8:

{% include_cached copy-clipboard.html %}
~~~ shell
curl --request PATCH \
--url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id} \
--header 'Authorization: Bearer {secret_key}' \
--header 'Content-Type: application/json' \
--json '{
"spec": {
"dedicated": {
"hardware": {
"machine_spec": {
"num_virtual_cpus": 8
}
}
}
}
}'
~~~

To change the number of nodes in a region:

{% include_cached copy-clipboard.html %}
~~~ shell
curl --request PATCH \
--url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id} \
--header 'Authorization: Bearer {secret_key}' \
--header 'Content-Type: application/json' \
--json '{
"spec": {
"dedicated": {
"region_nodes": {
"us-east-1": 5
}
}
}
}'
~~~

Where `{cluster_id}` is the ID of your cluster and `{secret_key}` is your API key.

## Change a cluster's plan

This section shows how to change a cluster's plan using the CockroachDB {{ site.data.products.cloud }} API. To use Terraform instead, refer to [Provision a cluster with Terraform]({% link cockroachcloud/provision-a-cluster-with-terraform.md %}#change-a-clusters-plan).
Expand Down
Loading