Skip to content

Commit

Permalink
Do not reuse NexusIncomingService for CreateOrUpdate request (#362)
Browse files Browse the repository at this point in the history
  • Loading branch information
bergundy authored Mar 6, 2024
1 parent a877192 commit 6776e41
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
2 changes: 2 additions & 0 deletions buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ breaking:
- WIRE_JSON
ignore:
- google
# Uncomment this after https://github.com/temporalio/api/pull/362 is merged
- temporal/api/operatorservice/v1/request_response.proto
lint:
use:
- DEFAULT
Expand Down
4 changes: 2 additions & 2 deletions openapi/openapiv2.json
Original file line number Diff line number Diff line change
Expand Up @@ -4711,11 +4711,11 @@
"version": {
"type": "string",
"format": "int64",
"description": "Data version for this service. Must match current version on update or set to 0 to create a new service."
"description": "Data version for this service, incremented for every update issued via the CreateOrUpdateNexusIncomingService\nAPI."
},
"name": {
"type": "string",
"description": "Service name, unique for this cluster.\nThe service name is used to address this service.\nBy default, when using Nexus over HTTP, the service name is matched against the base URL path.\nE.g. the URL /my-service would match a service named \"my-service\".\nThe name can contain any characters and is escaped when matched against a URL."
"description": "Service name, unique for this cluster.\nThe service name is used to address this service.\nBy default, when using Nexus over HTTP, the service name is matched against the base URL path.\nE.g. the URL /api/v1/services/my-service/ would match a service named \"my-service\".\nThe name must match `[a-zA-Z_][a-zA-Z0-9_]*`."
},
"namespace": {
"type": "string",
Expand Down
7 changes: 4 additions & 3 deletions temporal/api/nexus/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,14 @@ message Response {

// A binding from a service name to namespace, task queue, and metadata for dispatching incoming Nexus requests.
message IncomingService {
// Data version for this service. Must match current version on update or set to 0 to create a new service.
// Data version for this service, incremented for every update issued via the CreateOrUpdateNexusIncomingService
// API.
int64 version = 1;
// Service name, unique for this cluster.
// The service name is used to address this service.
// By default, when using Nexus over HTTP, the service name is matched against the base URL path.
// E.g. the URL /my-service would match a service named "my-service".
// The name can contain any characters and is escaped when matched against a URL.
// E.g. the URL /api/v1/services/my-service/ would match a service named "my-service".
// The name must match `[a-zA-Z_][a-zA-Z0-9_]*`.
string name = 2;
// Namespace to route requests to.
string namespace = 3;
Expand Down
18 changes: 17 additions & 1 deletion temporal/api/operatorservice/v1/request_response.proto
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ option csharp_namespace = "Temporalio.Api.OperatorService.V1";

import "temporal/api/enums/v1/common.proto";
import "temporal/api/nexus/v1/message.proto";
import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";

// (-- Search Attribute --)
Expand Down Expand Up @@ -139,8 +140,23 @@ message GetNexusIncomingServiceResponse {
temporal.api.nexus.v1.IncomingService service = 1;
}

// (-- api-linter: core::0133::request-unknown-fields=disabled
// aip.dev/not-precedent: CreateOrUpdateNexusIncomingServiceResponse RPC doesn't follow Google API format. --)
message CreateOrUpdateNexusIncomingServiceRequest {
temporal.api.nexus.v1.IncomingService service = 1;
// Data version for this service. Must match current version on update or set to 0 to create a new service.
int64 version = 1;
// Service name, unique for this cluster.
// The service name is used to address this service.
// By default, when using Nexus over HTTP, the service name is matched against the base URL path.
// E.g. the URL /api/v1/services/my-service/ would match a service named "my-service".
// The name must match `[a-zA-Z_][a-zA-Z0-9_]*`.
string name = 2;
// Namespace to route requests to.
string namespace = 3;
// Task queue to route requests to.
string task_queue = 4;
// Generic service metadata that is available to the server's authorizer.
map<string, google.protobuf.Any> metadata = 5;
}

message CreateOrUpdateNexusIncomingServiceResponse {
Expand Down
2 changes: 1 addition & 1 deletion temporal/api/operatorservice/v1/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ service OperatorService {
rpc DeleteNexusIncomingService(DeleteNexusIncomingServiceRequest) returns (DeleteNexusIncomingServiceResponse) {
}

// List all nexus incoming service names. Use next_page_token in the response for pagination.
// List all Nexus incoming services in the cluster. Use next_page_token in the response for pagination.
rpc ListNexusIncomingServices(ListNexusIncomingServicesRequest) returns (ListNexusIncomingServicesResponse) {
}
}

0 comments on commit 6776e41

Please sign in to comment.