Skip to content

Commit 2a52d08

Browse files
LutaoXcursoragentjsundai
authored
Fix Cloud Ops API docs accuracy (SDK, version header, auth) (#4902)
* Fix Cloud Ops API docs accuracy for SDK, version header, and auth Correct Go module/import paths, split gRPC vs HTTP version-header requirements, fix the Ops API sample link, and clarify prerequisites, roles, protobuf generation, PrivateLink DNS, and async concurrency limits. Co-authored-by: Cursor <cursoragent@cursor.com> * Remove experimental callout from Cloud Ops Go SDK section Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Jwahir Sundai <jwahir.sundai@temporal.io>
1 parent ec1a38b commit 2a52d08

1 file changed

Lines changed: 53 additions & 42 deletions

File tree

docs/cloud/operation-api.mdx

Lines changed: 53 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,21 @@ The Temporal Cloud Operations API, or the Cloud Ops API, is an open source, publ
2222

2323
## Develop applications with the Cloud Ops API
2424

25-
You can use the HTTP API or the gRPC API depending on how you need to integrate with your platform. The URL to access both the HTTP and gRPC Cloud Ops API is `saas-api.tmprl.cloud`.
25+
You can use the HTTP API or the gRPC API depending on how you need to integrate with your platform.
26+
27+
- HTTP: `https://saas-api.tmprl.cloud`
28+
- gRPC: `saas-api.tmprl.cloud:443`
29+
30+
If you connect to Temporal Cloud over [AWS PrivateLink](/cloud/connectivity/aws-connectivity) or [GCP Private Service Connect](/cloud/connectivity/gcp-connectivity), configure private DNS for `saas-api.tmprl.cloud` so control-plane clients (Cloud Ops API, Terraform, tcld) reach the private endpoint.
2631

2732
### Prerequisites
2833

2934
These prerequisites are required for using either HTTP or gRPC.
3035

31-
- [Temporal Cloud user account](/cloud/get-started)
32-
- [API Key](/cloud/tcld/apikey#create) for authentication
36+
- A Temporal Cloud [User](/cloud/manage-access/users) or [Service Account](/cloud/manage-access/service-accounts)
37+
- An [API Key](/cloud/api-keys#manage-api-keys) for authentication (owned by that User or Service Account)
38+
39+
Required [roles and permissions](/cloud/manage-access/roles-and-permissions) vary by operation. Some account-wide management operations require Account Owner or Global Admin. Others work with Developer, Finance Admin, Namespace Admin, or custom roles.
3340

3441
### Use cases
3542

@@ -68,17 +75,17 @@ To start using the Go SDK with the Cloud Ops API, follow these steps:
6875

6976
1. Install the Go SDK:
7077
```go
71-
go get github.com/temporalio/cloud-sdk-go
78+
go get go.temporal.io/cloud-sdk@latest
7279
```
7380

7481
2. Import and use the SDK:
7582
```go
7683
import (
77-
"github.com/temporalio/cloud-sdk-go/client"
84+
"go.temporal.io/cloud-sdk/cloudclient"
7885
)
7986
```
8087

81-
3. The Go SDK provides pre-built client interfaces that handle authentication and connection setup. Refer to the [Go samples](https://github.com/temporalio/cloud-samples-go) for detailed usage examples.
88+
3. The Go SDK provides pre-built client interfaces that handle authentication and connection setup. Refer to the [Go samples](https://github.com/temporalio/cloud-samples-go) for detailed usage examples, including [Cloud Ops API client setup](https://github.com/temporalio/cloud-samples-go/blob/main/client/api/client.go).
8289

8390
The Go SDK eliminates the need to work directly with generated protobuf files and provides a more idiomatic Go experience.
8491

@@ -88,60 +95,64 @@ For programming languages other than Go, download the gRPC protobufs from the [C
8895

8996
Use [gRPC](https://grpc.io/docs/) to compile and generate code in your preferred [programming language](https://grpc.io/docs/#official-support). The steps below use Python as an example and require [Python's gRPC tools](https://grpc.io/docs/languages/python/quickstart/#grpc-tools) to be installed, but the approach can be adapted for other supported programming languages.
9097

98+
You can also generate clients from the published Buf module at [buf.build/temporalio/cloud-api](https://buf.build/temporalio/cloud-api).
99+
91100
1. Clone the Temporal Cloud API repository:
92101

93102
```command
94103
git clone https://github.com/temporalio/cloud-api.git
95104
cd cloud-api
96105
```
97106

98-
2. Copy Protobuf files:
99-
100-
- Navigate to the `temporal` directory.
101-
- Copy the protobuf files to your project directory.
107+
2. Compile the Protobuf files from the repository root (protos live under `temporal/` and import each other):
102108

103-
3. Compile the Protobuf files:
104-
105-
```python
106-
python -m grpc_tools.protoc -I./ --python_out=./ --grpc_python_out=./ *.proto
109+
```command
110+
python -m grpc_tools.protoc \
111+
-I. \
112+
--python_out=. \
113+
--grpc_python_out=. \
114+
$(find temporal -name '*.proto')
107115
```
108-
- `-I` specifies the directory of the `.proto` files.
109-
- `--python_out=` sets the output directory for generated Python classes.
110-
- `--grpc_python_out=` sets the output directory for generated gRPC service classes.
111-
- `*.proto` processes all `.proto` files.
116+
117+
- `-I.` adds the repository root to the import path.
118+
- `--python_out=` and `--grpc_python_out=` set the output directories for generated classes.
119+
- `find temporal -name '*.proto'` includes all Cloud Ops API protos and their dependencies under `temporal/`.
112120

113121
After compiling the Protobuf files, you will have generated code files in your project directory.
114122
These files enable interaction with the Temporal Cloud API in your chosen programming language.
115123

116-
4. Import the Generated Files:
117-
118-
- Locate the Python files (.py) generated in your project directory.
119-
- Import these files into your Python application where you intend to interact with the Temporal Cloud API.
120-
121-
2. Use the API:
122-
- Use the classes and methods defined in the imported files to communicate with the Temporal Cloud services.
123-
- Ensure to handle any required authentication or configuration as needed for Temporal Cloud.
124+
3. Import the generated files into your application and call the Cloud Ops API. Handle authentication with an API key and set the API version header as described in [Usage guidelines](#usage-guidelines).
124125

125126
This approach can be adapted for other programming languages by following their respective import and usage conventions for the generated code files.
126127

127128
## Usage guidelines
128129

129130
When interacting with the Temporal Cloud Ops API, follow these guidelines:
130131

131-
- API version header:
132-
- Always include the `temporal-cloud-api-version` header in your requests, specifying the API version identifier.
133-
- The current API version can be found [here](https://github.com/temporalio/cloud-api/blob/main/VERSION#L1C1-L1C14).
134-
- Connection URL:
135-
- Connect to the Temporal Cloud using the gRPC URL: `saas-api.tmprl.cloud:443`.
136-
- Engagement steps:
137-
- Generate API key:
138-
- Obtain an [API Key for authentication](/cloud/api-keys#manage-api-keys). Note that many operations may require Admin privileges.
139-
- Set up client:
140-
- Establish a secure connection to the Temporal Cloud. Refer to the example [Client setup in Go](https://github.com/temporalio/cloud-samples-go/blob/main/client/temporal/client.go) for guidance.
141-
- Execute operations:
142-
- For operation specifics, refer to the `cloudservice/v1/request_response.proto` for gRPC messages and `cloudservice/v1/service.proto` for gRPC services.
143-
144-
These steps provide a structured approach to using the Temporal Cloud Ops API effectively, ensuring proper authentication and connection setup.
132+
### API version header
133+
134+
Use the `temporal-cloud-api-version` header to select an API version. The backend uses this version to safely mutate resources. The current API version is in the [`cloud-api` VERSION file](https://github.com/temporalio/cloud-api/blob/main/VERSION).
135+
136+
**gRPC**
137+
138+
gRPC clients must send a `temporal-cloud-api-version` header on every request.
139+
140+
**HTTP**
141+
142+
For HTTP clients, the version header is optional. If omitted, the HTTP gateway defaults it to the latest API version. This supports simple `curl` usage without looking up a version first.
143+
144+
For production HTTP automation, still pin an explicit version so behavior does not change when the gateway’s latest version advances.
145+
146+
### Connection URL
147+
148+
- gRPC: `saas-api.tmprl.cloud:443`
149+
- HTTP: `https://saas-api.tmprl.cloud`
150+
151+
### Engagement steps
152+
153+
1. Generate an [API Key for authentication](/cloud/api-keys#manage-api-keys). Required permissions vary by operation; see [roles and permissions](/cloud/manage-access/roles-and-permissions).
154+
2. Establish a secure connection. For Go, see [Cloud Ops API client setup](https://github.com/temporalio/cloud-samples-go/blob/main/client/api/client.go).
155+
3. Execute operations. For request and response messages, see `cloudservice/v1/request_response.proto`. For services, see `cloudservice/v1/service.proto`.
145156

146157
## Rate limits
147158

@@ -163,9 +174,9 @@ This limit applies to all requests made by each user through any client (tcld, U
163174

164175
This limit applies to all requests made by each service account through any client (tcld, Cloud Ops API).
165176

166-
**Asynchronous Operations: 10 concurrent operations at a time**
177+
**Asynchronous operations: 10 concurrent operations at a time**
167178

168-
This limits the number of concurrent asynchronous operations that can be in-flight at any given time.
179+
By default, each account can have up to 10 long-running (asynchronous) mutating operations in flight at once. This limit applies to a subset of create, update, and delete operations (for example Namespace, User, API Key, Export Sink, and Service Account mutations), not every RPC that returns an async operation.
169180

170181
### Important considerations
171182

0 commit comments

Comments
 (0)