diff --git a/modules/manage/partials/controlplane-api.adoc b/modules/manage/partials/controlplane-api.adoc index c343d8759..153870818 100644 --- a/modules/manage/partials/controlplane-api.adoc +++ b/modules/manage/partials/controlplane-api.adoc @@ -1,3 +1,9 @@ +// GCP region for the create-network and create-cluster examples below. +// Defined once per environment so the network and cluster regions can't drift +// (a mismatch is rejected with REASON_CLUSTER_NETWORK_REGION_MISMATCH). +ifdef::env-dedicated[:gcp-region: us-central1] +ifdef::env-byoc[:gcp-region: us-west1] + The Redpanda Cloud API is a collection of REST APIs that allow you to interact with different parts of Redpanda Cloud. The Control Plane API enables you to programmatically manage your organization's Redpanda infrastructure outside of the Cloud UI. You can call the API endpoints directly, or use tools like Terraform or Python scripts to automate cluster management. See link:/api/doc/cloud-controlplane/[Control Plane API] for the full API reference documentation. @@ -95,7 +101,7 @@ Create a network by making a request to link:/api/doc/cloud-controlplane/operati Choose a xref:networking:cidr-ranges.adoc[CIDR range] that does not overlap with your existing VPCs or your Redpanda network. ifdef::env-dedicated[] -[,bash] +[,bash,subs="+attributes"] ---- curl -d \ '{ @@ -105,14 +111,14 @@ curl -d \ "cluster_type": "TYPE_DEDICATED", "name": "", "resource_group_id": "", - "region": "us-west1" + "region": "{gcp-region}" } }' -H "Content-Type: application/json" \ -H "Authorization: Bearer " -X POST https://api.redpanda.com/v1/networks ---- endif::[] ifdef::env-byoc[] -[,bash] +[,bash,subs="+attributes"] ---- curl -d \ '{ @@ -122,7 +128,7 @@ curl -d \ "cluster_type": "TYPE_BYOC", "name": "", "resource_group_id": "", - "region": "us-west1" + "region": "{gcp-region}" } }' -H "Content-Type: application/json" \ -H "Authorization: Bearer " -X POST https://api.redpanda.com/v1/networks @@ -245,7 +251,7 @@ This endpoint returns a <>. After the network is created, make a request to the link:/api/doc/cloud-controlplane/operation/operation-clusterservice_createcluster[`POST /v1/clusters`] with the resource group ID and network ID in the request body. ifdef::env-dedicated[] -[,bash] +[,bash,subs="+attributes"] ---- curl -d \ '{ @@ -255,13 +261,13 @@ curl -d \ "name": "my-new-cluster", "resource_group_id": "", "network_id": "", - "region": "us-west1", - "throughput_tier": "tier-1-gcp-um4g", + "region": "{gcp-region}", + "throughput_tier": "", "type": "TYPE_DEDICATED", "zones": [ - "us-west1-a", - "us-west1-b", - "us-west1-c" + "{gcp-region}-a", + "{gcp-region}-b", + "{gcp-region}-c" ], "cluster_configuration": { "custom_properties": { @@ -272,9 +278,11 @@ curl -d \ }' -H "Content-Type: application/json" \ -H "Authorization: Bearer " -X POST https://api.redpanda.com/v1/clusters ---- + +Replace `` with a usage tier that is valid for your region and cluster type. For example, `tier-1-gcp-v2-x86`. See the link:/api/doc/cloud-controlplane/topic/topic-regions-and-usage-tiers[Control Plane API reference] for the full list of regions, zones, and tiers. endif::[] ifdef::env-byoc[] -[,bash] +[,bash,subs="+attributes"] ---- curl -d \ '{ @@ -284,13 +292,13 @@ curl -d \ "name": "my-new-cluster", "resource_group_id": "", "network_id": "", - "region": "us-west1", - "throughput_tier": "tier-1-gcp-um4g", + "region": "{gcp-region}", + "throughput_tier": "", "type": "TYPE_BYOC", "zones": [ - "us-west1-a", - "us-west1-b", - "us-west1-c" + "{gcp-region}-a", + "{gcp-region}-b", + "{gcp-region}-c" ], "cluster_configuration": { "custom_properties": { @@ -301,6 +309,8 @@ curl -d \ }' -H "Content-Type: application/json" \ -H "Authorization: Bearer " -X POST https://api.redpanda.com/v1/clusters ---- + +Replace `` with a usage tier that is valid for your region and cluster type. For example, `tier-1-gcp-v2-x86`. See the link:/api/doc/cloud-controlplane/topic/topic-regions-and-usage-tiers[Control Plane API reference] for the full list of regions, zones, and tiers. endif::[] The Create Cluster endpoint returns a <>. When the operation completes, you can retrieve cluster details by calling link:/api/doc/cloud-controlplane/operation/operation-clusterservice_getcluster[`GET /v1/clusters/\{id}`], and passing the cluster ID as a parameter.