Skip to content

Commit

Permalink
Sync Nexus Cloud API (#40)
Browse files Browse the repository at this point in the history
- Update endpoint name regex
- Add endpoint description
- Rename CloudWorkerTargetSpec to WorkerTargetSpec
- Add next_page_token to GetNexusEndpointsResponse
- Group nexus related request and responses together.
  • Loading branch information
nikki-dag authored Aug 16, 2024
1 parent f7be5c4 commit 060abc0
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 57 deletions.
111 changes: 59 additions & 52 deletions temporal/api/cloud/cloudservice/v1/request_response.proto
Original file line number Diff line number Diff line change
Expand Up @@ -257,23 +257,7 @@ message GetNexusEndpointsRequest {
message GetNexusEndpointsResponse {
// The list of endpoints in ascending id order.
repeated temporal.api.cloud.nexus.v1.Endpoint endpoints = 1;
}

message GetUserGroupsRequest {
// The requested size of the page to retrieve - optional.
// Cannot exceed 1000. Defaults to 100.
int32 page_size = 1;
// The page token if this is continuing from another response - optional.
string page_token = 2;
// Filter groups by the namespace they have access to - optional.
string namespace = 3;
// Filter groups by their name - optional.
string group_name = 4;
}

message GetUserGroupsResponse {
// The list of groups in ascending name order.
repeated temporal.api.cloud.identity.v1.UserGroup groups = 1;
// The next page's token.
string next_page_token = 2;
}
Expand All @@ -299,6 +283,65 @@ message CreateNexusEndpointRequest {
message CreateNexusEndpointResponse {
// The id of the endpoint that was created.
string endpoint_id = 1;

// The async operation.
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 2;
}

message UpdateNexusEndpointRequest {
// The id of the nexus endpoint to update.
string endpoint_id = 1;

// The updated nexus endpoint specification.
temporal.api.cloud.nexus.v1.EndpointSpec spec = 2;

// The version of the nexus endpoint for which this update is intended for.
// The latest version can be found in the GetNexusEndpoint operation response.
string resource_version = 3;

// The id to use for this async operation - optional.
string async_operation_id = 4;
}

message UpdateNexusEndpointResponse {
// The async operation.
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message DeleteNexusEndpointRequest {
// The id of the nexus endpoint to delete.
string endpoint_id = 1;

// The version of the endpoint for which this delete is intended for.
// The latest version can be found in the GetNexusEndpoint operation response.
string resource_version = 2;

// The id to use for this async operation - optional.
string async_operation_id = 3;
}

message DeleteNexusEndpointResponse {
// The async operation
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message GetUserGroupsRequest {
// The requested size of the page to retrieve - optional.
// Cannot exceed 1000. Defaults to 100.
int32 page_size = 1;
// The page token if this is continuing from another response - optional.
string page_token = 2;
// Filter groups by the namespace they have access to - optional.
string namespace = 3;
// Filter groups by their name - optional.
string group_name = 4;
}

message GetUserGroupsResponse {
// The list of groups in ascending name order.
repeated temporal.api.cloud.identity.v1.UserGroup groups = 1;
// The next page's token.
string next_page_token = 2;
}

message GetUserGroupRequest {
Expand Down Expand Up @@ -327,26 +370,6 @@ message CreateUserGroupResponse {
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 2;
}

message UpdateNexusEndpointRequest {
// The id of the nexus endpoint to update.
string endpoint_id = 1;

// The updated nexus endpoint specification.
temporal.api.cloud.nexus.v1.EndpointSpec spec = 2;

// The version of the nexus endpoint for which this update is intended for.
// The latest version can be found in the GetNexusEndpoint operation response.
string resource_version = 3;

// The id to use for this async operation - optional.
string async_operation_id = 4;
}

message UpdateNexusEndpointResponse {
// The async operation.
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message UpdateUserGroupRequest {
// The id of the group to update.
string group_id = 1;
Expand All @@ -365,22 +388,6 @@ message UpdateUserGroupResponse {
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message DeleteNexusEndpointRequest {
// The id of the nexus endpoint to delete.
string endpoint_id = 1;

// The version of the endpoint for which this delete is intended for.
// The latest version can be found in the GetNexusEndpoint operation response.
string resource_version = 2;

// The id to use for this async operation - optional.
string async_operation_id = 3;
}

message DeleteNexusEndpointResponse {
// The async operation
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}
message DeleteUserGroupRequest {
// The id of the group to delete.
string group_id = 1;
Expand Down
11 changes: 6 additions & 5 deletions temporal/api/cloud/nexus/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "google/protobuf/timestamp.proto";

message EndpointSpec {
// The name of the endpoint. Must be unique within an account.
// The name must match `[a-zA-Z_][a-zA-Z0-9_]*`.
// The name must match `^[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9]$`.
// This field is mutable.
string name = 1;

Expand All @@ -19,14 +19,17 @@ message EndpointSpec {
// must match with at least one of the specs to be accepted by the endpoint.
// This field is mutable.
repeated EndpointPolicySpec policy_specs = 3;

// The markdown description of the endpoint - optional.
string description = 4;
}

message EndpointTargetSpec {
// A target spec for routing nexus requests to a specific cloud namespace worker.
CloudWorkerTargetSpec cloud_worker_target_spec = 1;
WorkerTargetSpec worker_target_spec = 1;
}

message CloudWorkerTargetSpec {
message WorkerTargetSpec {
// The target cloud namespace to route requests to. Namespace must be in same account as the endpoint. This field is mutable.
string namespace_id = 1;

Expand Down Expand Up @@ -70,5 +73,3 @@ message Endpoint {
// The date and time when the endpoint was last modified.
google.protobuf.Timestamp last_modified_time = 7;
}


0 comments on commit 060abc0

Please sign in to comment.