Skip to content
Merged
Show file tree
Hide file tree
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
15 changes: 11 additions & 4 deletions cloud-controlplane/overlays/add-x-topics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,24 @@ actions:
description: Add x-topics to the root of the document
update:
x-topics:
# - title: Quickstart
# content: quickstart.md
- title: Quickstart
content:
$ref: ../x-topics/quickstart.md
- title: Cloud API Overview
content:
$ref: ../../shared/x-topics/cloud-api-overview.md
- title: Authentication
content:
$ref: ../../shared/x-topics/about-authentication.md
- title: Regions and Usage Tiers
content:
$ref: ../x-topics/cloud-api-regions.md
$ref: ../x-topics/cloud-regions.md
- title: Long-running Operations
content:
$ref: ../x-topics/long-running-operations.md
- title: Error and Status Codes
content:
$ref: ../x-topics/controlplane-api-error-and-status-codes.md
$ref: ../x-topics/error-and-status-codes.md
- title: Deprecation Policy
content:
$ref: ../../shared/x-topics/cloud-api-deprecation-policy.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Cloud Control Plane API Error and Status Codes
# Control Plane API Error and Status Codes

The Redpanda Cloud API uses HTTP codes to indicate the status of a request. The response payload also includes [additional error codes and descriptions](#error-codes-and-details) that provide more detail about why an operation failed.

Expand Down
38 changes: 38 additions & 0 deletions cloud-controlplane/x-topics/long-running-operations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Long-running Operations in Redpanda Cloud

Some Cloud API endpoints do not directly return the resource itself, but instead return an operation. These operations may be long-running, meaning they may not complete immediately and can take several seconds or minutes to finish. Examples include creating or deleting clusters and networks, and updating cluster properties. Long-running operations are asynchronous and return a response indicating that the request has been accepted and is being processed.

When you initiate a long-running operation, the API responds with a status code such as `202 Accepted` and includes an operation ID. The following is an example response of Create Cluster:

```json
{
"operation": {
"id": "cqfc6vdmvio001r4vu4",
"metadata": {
"@type": "type.googleapis.com/redpanda.api.controlplane.v1.CreateClusterMetadata",
"cluster_id": "cqg168balf4e4pm8ptu"
},
"state": "STATE_IN_PROGRESS",
"started_at": "2024-07-23T20:31:29.948Z",
"type": "TYPE_CREATE_CLUSTER",
"resource_id": "cqg168balf4e4pm8ptu"
}
}
```

You can use the operation ID to poll the status of the operation or check for completion.

## Work with long-running operations

1. Send the request to start a long-running operation (for example, create a network).
2. Receive a response with an operation ID.
3. Poll the Get Operation endpoint using the provided ID.
4. Check for completion. When the operation is complete, the status will indicate success or failure, and any resulting resources will be available for next steps in your workflow (for example, using a newly-created network to create a cluster).

## Best practices

- Always check the operation status before assuming completion.
- Handle possible statuses `STATE_IN_PROGRESS`, `STATE_COMPLETED`, and `STATE_FAILED`.
- Review API documentation for specific endpoints that support long-running operations and their status-checking mechanisms.

For more details, refer to the Get Operation endpoint reference or the relevant endpoint reference.
56 changes: 56 additions & 0 deletions cloud-controlplane/x-topics/quickstart.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Redpanda Cloud Control Plane API Quickstart

The following steps describe how to authenticate with the Control API and create a new Redpanda cluster. For more information on the Control Plane API, see the Redpanda Cloud API Overview.

> **Note:** Redpanda Cloud uses a control plane and data plane architecture.
To see the available endpoints for managing resources within your clusters, such as topics, users, access control lists (ACLs), and connectors, see the Data Plane API Reference.

## Requirements

To use the Control Plane API:

1. You must be a customer with an existing organization in Redpanda Cloud.
2. You can only use one organization for authentication.

### Authenticate to the API from API Explorer

You can issue requests against the Control Plane API from your browser when viewing the API Explorer:

1. In the Redpanda Cloud UI, create a [service account (client)](https://cloud.redpanda.com/organization-iam?tab=service-accounts). Save the client ID and secret.
1. Go to the "Get access token" endpoint and click **Run in API Explorer**.
1. In the request body:
1. For `grant_type`, select `client_credentials`.
1. Enter the `client_id` and `client_secret` values you generated using the service account.
1. For `audience`, select `cloudv2-production.redpanda.cloud`.
1. Click **Send Request** on the code example to the right.
The Response block should populate with an `access_token` value. Copy the string value without the quotes. To make your next request to a different endpoint in the API Explorer, add the access token in the Authentication field.
> **Warning:** API requests from this page are executed against your actual environment and data, not a sandbox.

## Create a new cluster

### BYOC or Dedicated

1. Create a resource group by making a Create Resource Group request. The response returns a resource group ID. Pass this ID later when you call the Create Cluster endpoint.
1. Create a network by making a Create Network request. Note that this endpoint returns a long-running operation. The response returns a network ID in `resource_id`. Pass this ID when you call the Create Cluster endpoint.
1. When the Create Network operation is complete, create a cluster by making a Create Cluster request. Note that this endpoint returns a long-running operation.
1. For BYOC, run `rpk cloud byoc` in the shell, passing the `metadata.cluster_id` from the Create Cluster response as a flag:

**AWS:**
```bash
rpk cloud byoc aws apply --redpanda-id=<metadata.cluster_id>
```
**Azure:**
```bash
rpk cloud byoc azure apply --redpanda-id=<metadata.cluster_id> --subscription-id=<redpanda-cluster-azure-subscription-id>
```
**GCP:**
```bash
rpk cloud byoc gcp apply --redpanda-id=<metadata.cluster_id> --project-id=<gcp-project-id>
```

### Serverless

1. Make a Get Resource Group request to retrieve the default resource group ID. Pass this ID later when you call the Create Serverless Cluster endpoint.
1. Make a Get Serverless Regions request to see available regions.
1. Create a cluster by making a Create Serverless Cluster request, passing in the default resource group ID and desired cloud region in the request.

10 changes: 7 additions & 3 deletions cloud-dataplane/overlays/add-x-topics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ actions:
description: Add x-topics to the root of the document
update:
x-topics:
# - title: Quickstart
# content: quickstart.md
- title: Quickstart
content:
$ref: ../x-topics/quickstart.md
- title: Cloud API Overview
content:
$ref: ../../shared/x-topics/cloud-api-overview.md
- title: Authentication
content:
$ref: ../../shared/x-topics/about-authentication.md
- title: Error and Status Codes
content:
$ref: ../x-topics/dataplane-api-error-and-status-codes.md
$ref: ../x-topics/error-and-status-codes.md
- title: Deprecation Policy
content:
$ref: ../../shared/x-topics/cloud-api-deprecation-policy.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Cloud Data Plane API Error and Status Codes
# Data Plane API Error and Status Codes

The Redpanda Cloud API uses HTTP codes to indicate the status of a request. The response payload also includes [additional error codes and descriptions](#error-codes-and-details) that provide more detail about why an operation failed.

Example request:

```bash
curl https://api.redpanda.com/v1/clusters | jq
```
curl https://<dataplane_api_url>/topics | jq

Example response:

Expand All @@ -18,9 +17,8 @@ Example response:
{
"@type": "google.rpc.ErrorInfo",
"reason": "REASON_NO_TOKEN",
"domain": "redpanda.com/controlplane",
"domain": "redpanda.com/dataplane",
"metadata": {}
},
{
"@type": "google.rpc.Help",
"links": [
Expand Down
38 changes: 38 additions & 0 deletions cloud-dataplane/x-topics/quickstart.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Redpanda Cloud Data Plane API Quickstart

The following steps describe how to authenticate with the Data Plane API. For more information on the Data Plane API, see the Redpanda Cloud API Overview.

> **Note:** Redpanda Cloud uses a control plane and data plane architecture. To see the available endpoints for managing your clusters, networks, and resource groups, see the Control Plane API Reference.

## Requirements

To use the Data Plane API:

1. You must be a customer with an existing organization in Redpanda Cloud.
2. You can only use one organization for authentication.
3. You must have a running cluster in Redpanda Cloud.

### Authenticate to the API from API Explorer

You can issue requests against the Data Plane API from your browser when viewing the API Explorer:

1. In the Redpanda Cloud UI, create a [service account (client)](https://cloud.redpanda.com/organization-iam?tab=service-accounts). Save the client ID and secret.
1. Go to the "Get access token" endpoint and click **Run in API Explorer**.
1. In the request body:
1. For `grant_type`, select `client_credentials`.
1. Enter the `client_id` and `client_secret` values you generated using the service account.
1. For `audience`, select `cloudv2-production.redpanda.cloud`.
1. Click **Send Request** on the code example to the right.

The Response block should populate with an `access_token` value. Copy the string value without the quotes. To you make your next request on a different endpoint in the API Explorer, add the access token in the Authentication field.

> **Warning:** API requests from this page are executed against your actual environment and data, not a sandbox.

## Create a topic

1. If you don't already have the data plane API URL for your target cluster, make a Get Cluster (BYOC, Dedicated) or Get Serverless Cluster (Serverless) request against the Control Plane API. The response contains the Data Plane API URL. Copy the value of `dataplane_api.url` from the response body.
1. Go to **API Servers** in the sidebar and select “\{dataplane_api_url} - Data Plane API”. Paste the URL into the `dataplane_api_url` field.
1. To create a new Redpanda topic, make a Create Topic request.



81 changes: 81 additions & 0 deletions shared/x-topics/cloud-api-overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Redpanda Cloud API Overview

The Redpanda Cloud API is a collection of REST APIs that allow you to interact with different parts of Redpanda Cloud. You can call the API endpoints directly, or use tools like Terraform or Python scripts to automate cluster management and manage Redpanda Cloud resources.

## Requirements

To use the Cloud API:

- You must have a Redpanda Cloud account.
- You can only use one organization for authentication. See Authentication for steps to authenticate API requests.
- Serverless: To try the Cloud API with Serverless, [sign up for a free Standard trial](https://redpanda.com/cloud/serverless).

## Cloud API architecture

Redpanda Cloud uses a control plane and data plane architecture. The **control plane** is where most cluster management, operations, and maintenance takes place. The control plane enforces rules in the data plane. The **data plane** is where your cluster lives. The term _data plane_ is used interchangeably with _cluster_. For BYOC customers, the data plane is in your VPC. To learn more about the Redpanda Cloud platform, see the [Cloud Overview](https://docs.redpanda.com/docs/cloud/cloud-overview/).

The **Control Plane API** allows you to interact with the control plane. You use the Control Plane API to manage cloud resources for your organization, like clusters, resource groups, and networks. The Control Plane API does not interact directly with Redpanda clusters, although some of the actions performed through the API can eventually make their way to a cluster. See [Use the Control Plane API](https://docs.redpanda.com/docs/manage/api/controlplane/) for steps to create and delete clusters.

The **Data Plane APIs** are a collection of APIs through which you can perform actions directly against a Redpanda cluster. These APIs expose more high-level operations on the data plane by acting as a wrapper around the other APIs supported by Redpanda (Kafka API, Admin API, or Schema Registry API). See [Use the Data Plane APIs](https://docs.redpanda.com/docs/manage/api/cloud-dataplane-api/) for steps to create an access-control list (ACL), topic, or connector.

See also:

- [Redpanda API and SDK Reference documentation](https://docs.redpanda.com/reference/api-reference/)

## Base URLs

The Control Plane and Data Plane APIs are independent of each other. The Cloud API URL is distinct from the Data Plane API URLs.

### Control Plane API URL

The Control Plane API has a base URL that is the same for any organization:

```
https://api.redpanda.com
```

When making requests to the Control Plane API endpoints, the request URL is the base URL, plus the API version, plus the resource path. For example:

```bash
https://api.redpanda.com/v1/clusters
```

The current Control Plane API version is **v1**.

> **Important:** The Control Plane API versions v1beta1 and v1beta2 are deprecated. v1beta1 and v1beta2 are still available, but they will be removed in a future release and are not recommended for use.
>
> The deprecation timeline is:
>
> - Announcement date: May 27, 2025
> - End-of-support date: November 28, 2025
> - Retirement date: May 28, 2026
>
> See Deprecation Policy for more information.

### Data Plane APIs URL

The Data Plane API base URL is unique to the individual target cluster. It is different for each cluster. When making requests to the Data Plane API endpoints, the request URL is the base URL, plus the API version, plus the resource path. For example:

```bash
https://api-aeb32d9b.cn20bu40d061nvem7sv0.fmc.prd.cloud.redpanda.com/v1/users
```

The current Data Plane API version is **v1**.

> **Important:** The Data Plane API versions v1alpha1 and v1alpha2 are deprecated. v1alpha1 and v1alpha2 are still available, but they will be removed in a future release and are not recommended for use.
>
> The deprecation timeline is:
>
> - Announcement date: May 27, 2025
> - End-of-support date: November 28, 2025
> - Retirement date: May 28, 2026
>
> See Deprecation Policy for more information.

## Pagination

When an endpoint returns a list containing more items than can be returned in a single response, the response object includes a `next_page_token`. You can pass the token value as a parameter in the next request. When the full list has been returned, `next_page_token` is an empty string.

## Versioning and deprecation

The Cloud API Deprecation Policy outlines the process for phasing out an API version or specific features within an API. See Deprecation Policy for details.