Skip to content

Commit 8913cdb

Browse files
authored
Update cloud ops apis to latest (#930)
1 parent f1ae39a commit 8913cdb

File tree

14 files changed

+296
-63
lines changed

14 files changed

+296
-63
lines changed

client/src/raw.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,6 +1394,7 @@ proxier! {
13941394
);
13951395
(failover_namespace_region, cloudreq::FailoverNamespaceRegionRequest, cloudreq::FailoverNamespaceRegionResponse);
13961396
(add_namespace_region, cloudreq::AddNamespaceRegionRequest, cloudreq::AddNamespaceRegionResponse);
1397+
(delete_namespace_region, cloudreq::DeleteNamespaceRegionRequest, cloudreq::DeleteNamespaceRegionResponse);
13971398
(get_regions, cloudreq::GetRegionsRequest, cloudreq::GetRegionsResponse);
13981399
(get_region, cloudreq::GetRegionRequest, cloudreq::GetRegionResponse);
13991400
(get_api_keys, cloudreq::GetApiKeysRequest, cloudreq::GetApiKeysResponse);
@@ -1411,6 +1412,9 @@ proxier! {
14111412
(create_user_group, cloudreq::CreateUserGroupRequest, cloudreq::CreateUserGroupResponse);
14121413
(update_user_group, cloudreq::UpdateUserGroupRequest, cloudreq::UpdateUserGroupResponse);
14131414
(delete_user_group, cloudreq::DeleteUserGroupRequest, cloudreq::DeleteUserGroupResponse);
1415+
(add_user_group_member, cloudreq::AddUserGroupMemberRequest, cloudreq::AddUserGroupMemberResponse);
1416+
(remove_user_group_member, cloudreq::RemoveUserGroupMemberRequest, cloudreq::RemoveUserGroupMemberResponse);
1417+
(get_user_group_members, cloudreq::GetUserGroupMembersRequest, cloudreq::GetUserGroupMembersResponse);
14141418
(set_user_group_namespace_access, cloudreq::SetUserGroupNamespaceAccessRequest, cloudreq::SetUserGroupNamespaceAccessResponse);
14151419
(create_service_account, cloudreq::CreateServiceAccountRequest, cloudreq::CreateServiceAccountResponse);
14161420
(get_service_account, cloudreq::GetServiceAccountRequest, cloudreq::GetServiceAccountResponse);
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Push to Buf Registry
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v**'
7+
branches:
8+
- main
9+
permissions:
10+
contents: read
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repo
16+
uses: actions/checkout@v4
17+
- uses: bufbuild/buf-action@v1
18+
with:
19+
version: 1.49.0
20+
token: ${{ secrets.BUF_TEMPORALIO_TOKEN }}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# These owners will be the default owners for everything in
2+
# the repo. Unless a later match takes precedence,
3+
# @temporalio/saas will be requested for review when
4+
# someone opens a pull request.
5+
6+
* @temporalio/saas
Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1-
# Temporal cloud api proto files (Preview)
1+
# Temporal Cloud Operations API (Public Preview)
22

3-
> These apis are currently preview only and access is restricted. They are not meant for production use and could change. Please reach out to Temporal support to request preview access.
3+
> aka the Cloud Ops API
4+
> These apis (proto files) are currently offered as a Public Preview. While they are production worthy, they are subject to change. Please reach out to Temporal Support if you have questions.
45
56
## How to use
67

7-
Copy over the protobuf files under [temporal](temporal) directory to the project directory and then use [grpc](https://grpc.io/docs/) to compile and generate code in the desired programming language.
8+
To use the Cloud Ops API in your project, preform the following 4 steps:
9+
1. Copy over the protobuf files under [temporal](temporal) directory to your desired project directory
10+
2. Use [gRPC](https://grpc.io/docs/) to compile and generate code in your desired programming language, typically handled as a part of your code build process
11+
3. Create a client connection in your code using a Temporal Cloud API Key (see [Samples](#samples) below)
12+
4. Use the Cloud Operations API services to automate Cloud Operations, such as creating users or namespaces
813

914
### API Version
1015

1116
The client is expected to pass in a `temporal-cloud-api-version` header with the api version identifier with every request it makes to the apis. The backend will use the version to safely mutate resources. The `temporal:versioning:min_version` label specifies the minimum version of the API that supports the field.
1217

13-
Current Version:
14-
https://github.com/temporalio/api-cloud/blob/main/VERSION#L1C1-L1C14
18+
Current Version `v0.4.0`
1519

1620
### URL
1721

@@ -22,4 +26,11 @@ saas-api.tmprl.cloud:443
2226

2327
## Samples
2428

25-
Refer [cloud-samples-go](https://github.com/temporalio/cloud-samples-go) repository for demonstration on how a project can copy and build Go clients.
29+
Refer to the [cloud-samples-go](https://github.com/temporalio/cloud-samples-go/blob/main/cmd/worker/README.md) sample repository for how to use the cloud ops api in Go.
30+
> This sample demonstrates how to automate Temporal Cloud operations using Temporal Workflows that make Cloud Ops API requests within Workflow Activities ([Worker Sample README](https://github.com/temporalio/cloud-samples-go/tree/main/cmd/worker)).
31+
> See [here](https://github.com/temporalio/cloud-samples-go/blob/60d5cbca8696c87fb184efc56f5ae117561213d2/client/api/client.go#L16) for a quick reference showing you how to connect to Temporal Cloud with an API Key for the Cloud Ops API in Go.
32+
33+
Refer to the [temporal-cloud-api-client-typescript](https://github.com/steveandroulakis/temporal-cloud-api-client-typescript) sample repository for how to use the cloud ops api in Typescript.
34+
Refer to the [temporal-cloud-api-client-java](https://github.com/steveandroulakis/temporal-cloud-api-client-java) sample repository for how to use the cloud ops api in Java.
35+
Refer to the [temporal-cloud-api-client-kotlin](https://github.com/steveandroulakis/temporal-cloud-api-client-kotlin) sample repository for how to use the cloud ops api in Kotlin.
36+
> The Java, Typescript, and Kotlin sample apps all provide a simple HTML UI that demonstrates how to use the Cloud Ops API to CRUD Namespaces and Users.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-10-01-00
1+
v0.5.1

sdk-core-protos/protos/api_cloud_upstream/buf.lock

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,10 @@ deps:
44
- remote: buf.build
55
owner: googleapis
66
repository: googleapis
7-
commit: 711e289f6a384c4caeebaff7c6931ade
8-
digest: shake256:e08fb55dad7469f69df00304eed31427d2d1576e9aab31e6bf86642688e04caaf0372f15fe6974cf79432779a635b3ea401ca69c943976dc42749524e4c25d94
7+
commit: e93e34f48be043dab55be31b4b47f458
8+
digest: shake256:93dbe51c27606999eef918360df509485a4d272e79aaed6d0016940379a9b06d316fc5228b7b50cca94bb310f34c5fc5955ce7474f655f0d0a224c4121dda3c1
9+
- remote: buf.build
10+
owner: temporalio
11+
repository: api
12+
commit: 95c35fbcc7f647cbb0facec6fb60aca8
13+
digest: shake256:f40de31043fe8dbf433395ebd2c7fef6a395582a856da1476cf5bb8ec32c7091a2c21208590effa59715bcceceec8ab2a6331919eb260d72b1091d9c76fd535b

sdk-core-protos/protos/api_cloud_upstream/buf.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
version: v1
2+
name: buf.build/temporalio/cloud-api
23
deps:
34
- buf.build/googleapis/googleapis
5+
- buf.build/temporalio/api:v1.43.0
46
breaking:
57
use:
68
- FILE

sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/request_response.proto

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,25 @@ message AddNamespaceRegionResponse {
256256
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
257257
}
258258

259+
message DeleteNamespaceRegionRequest {
260+
// The namespace to delete a region.
261+
string namespace = 1;
262+
// The id of the standby region to be deleted.
263+
// The GetRegions API can be used to get the list of valid region ids.
264+
// Example: "aws-us-west-2".
265+
string region = 2;
266+
// The version of the namespace for which this delete region operation is intended for.
267+
// The latest version can be found in the GetNamespace operation response.
268+
string resource_version = 3;
269+
// The id to use for this async operation - optional.
270+
string async_operation_id = 4;
271+
}
272+
273+
message DeleteNamespaceRegionResponse {
274+
// The async operation.
275+
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
276+
}
277+
259278
message GetRegionsRequest {
260279
}
261280

@@ -463,11 +482,18 @@ message GetUserGroupsRequest {
463482
string display_name = 4;
464483
// Filter groups by the google group specification - optional.
465484
GoogleGroupFilter google_group = 5;
485+
// Filter groups by the SCIM group specification - optional.
486+
SCIMGroupFilter scim_group = 6;
487+
466488

467489
message GoogleGroupFilter {
468490
// Filter groups by the google group email - optional.
469491
string email_address = 1;
470492
}
493+
message SCIMGroupFilter {
494+
// Filter groups by the SCIM IDP id - optional.
495+
string idp_id = 1;
496+
}
471497
}
472498

473499
message GetUserGroupsResponse {
@@ -556,6 +582,58 @@ message SetUserGroupNamespaceAccessResponse {
556582
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
557583
}
558584

585+
message AddUserGroupMemberRequest {
586+
// The id of the group to add the member for.
587+
string group_id = 1;
588+
589+
// The member id to add to the group.
590+
temporal.api.cloud.identity.v1.UserGroupMemberId member_id = 2;
591+
592+
// The id to use for this async operation.
593+
// Optional, if not provided a random id will be generated.
594+
string async_operation_id = 3;
595+
}
596+
597+
message AddUserGroupMemberResponse {
598+
// The async operation.
599+
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
600+
}
601+
602+
message RemoveUserGroupMemberRequest {
603+
// The id of the group to add the member for.
604+
string group_id = 1;
605+
606+
// The member id to add to the group.
607+
temporal.api.cloud.identity.v1.UserGroupMemberId member_id = 2;
608+
609+
// The id to use for this async operation.
610+
// Optional, if not provided a random id will be generated.
611+
string async_operation_id = 3;
612+
}
613+
614+
message RemoveUserGroupMemberResponse {
615+
// The async operation.
616+
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
617+
}
618+
619+
message GetUserGroupMembersRequest {
620+
// The requested size of the page to retrieve - optional.
621+
// Cannot exceed 1000. Defaults to 100.
622+
int32 page_size = 1;
623+
// The page token if this is continuing from another response - optional.
624+
string page_token = 2;
625+
626+
// The group id to list members of.
627+
string group_id = 3;
628+
}
629+
630+
message GetUserGroupMembersResponse {
631+
// The list of group members
632+
repeated temporal.api.cloud.identity.v1.UserGroupMember members = 1;
633+
// The next page's token.
634+
string next_page_token = 2;
635+
}
636+
559637
message CreateServiceAccountRequest {
560638
// The spec of the service account to create.
561639
temporal.api.cloud.identity.v1.ServiceAccountSpec spec = 1;

sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/service.proto

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,13 @@ service CloudService {
128128
};
129129
}
130130

131+
// Delete a region from a namespace
132+
rpc DeleteNamespaceRegion (DeleteNamespaceRegionRequest) returns (DeleteNamespaceRegionResponse) {
133+
option (google.api.http) = {
134+
delete: "/cloud/namespaces/{namespace}/regions/{region}",
135+
};
136+
}
137+
131138
// Get all regions
132139
rpc GetRegions (GetRegionsRequest) returns (GetRegionsResponse) {
133140
option (google.api.http) = {
@@ -261,6 +268,28 @@ service CloudService {
261268
};
262269
}
263270

271+
// Add a member to the group, can only be used with Cloud group types.
272+
rpc AddUserGroupMember(AddUserGroupMemberRequest) returns (AddUserGroupMemberResponse) {
273+
option (google.api.http) = {
274+
post: "/cloud/user-groups/{group_id}/members",
275+
body: "*"
276+
};
277+
}
278+
279+
// Remove a member from the group, can only be used with Cloud group types.
280+
rpc RemoveUserGroupMember(RemoveUserGroupMemberRequest) returns (RemoveUserGroupMemberResponse) {
281+
option (google.api.http) = {
282+
post: "/cloud/user-groups/{group_id}/remove-member",
283+
body: "*"
284+
};
285+
}
286+
287+
rpc GetUserGroupMembers(GetUserGroupMembersRequest) returns (GetUserGroupMembersResponse) {
288+
option (google.api.http) = {
289+
get: "/cloud/user-groups/{group_id}/members",
290+
};
291+
}
292+
264293
// Create a service account.
265294
rpc CreateServiceAccount(CreateServiceAccountRequest) returns (CreateServiceAccountResponse) {
266295
option (google.api.http) = {

0 commit comments

Comments
 (0)