From 69f33ecefe9249ca543012f8ccff37c3754bbee2 Mon Sep 17 00:00:00 2001 From: Shivam Saraf Date: Tue, 14 Jan 2025 18:46:45 -0500 Subject: [PATCH 1/9] Updated deployment protos to work with already-implemented versioning-3 API's --- temporal/api/deployment/v1/message.proto | 57 +++++++++++++++++++ .../workflowservice/v1/request_response.proto | 36 +++++++++++- temporal/api/workflowservice/v1/service.proto | 27 +++++++++ 3 files changed, 117 insertions(+), 3 deletions(-) diff --git a/temporal/api/deployment/v1/message.proto b/temporal/api/deployment/v1/message.proto index 9a6b4aa4..571891ea 100644 --- a/temporal/api/deployment/v1/message.proto +++ b/temporal/api/deployment/v1/message.proto @@ -39,6 +39,7 @@ import "temporal/api/common/v1/message.proto"; // `Deployment` identifies a deployment of Temporal workers. The combination of deployment series // name + build ID serves as the identifier. User can use `WorkerDeploymentOptions` in their worker // programs to specify these values. +// [cleanup-wv-pre-release] message Deployment { // Different versions of the same worker service/application are related together by having a // shared series name. @@ -54,6 +55,7 @@ message Deployment { // `DeploymentInfo` holds information about a deployment. Deployment information is tracked // automatically by server as soon as the first poll from that deployment reaches the server. There // can be multiple task queue workers in a single deployment which are listed in this message. +// [cleanup-wv-pre-release] message DeploymentInfo { Deployment deployment = 1; google.protobuf.Timestamp create_time = 2; @@ -73,6 +75,7 @@ message DeploymentInfo { } // Used as part of Deployment write APIs to update metadata attached to a deployment. +// [cleanup-wv-pre-release] message UpdateDeploymentMetadata { map upsert_entries = 1; // List of keys to remove from the metadata. @@ -81,9 +84,63 @@ message UpdateDeploymentMetadata { // DeploymentListInfo is an abbreviated set of fields from DeploymentInfo that's returned in // ListDeployments. +// [cleanup-wv-pre-release] message DeploymentListInfo { deployment.v1.Deployment deployment = 1; google.protobuf.Timestamp create_time = 2; // If this deployment is the current deployment of its deployment series. bool is_current = 3; } + +// A Worker Deployment Version (Version, for short) represents all workers of the same +// code and config within a Deployment. Workers of the same Version are expected to +// behave exactly the same so when executions move between them there are no +// non-determinism issues. +// Worker Deployment Versions are created in Temporal server automatically when +// their first poller arrives to the server. +// Each Version has a Workflow Versioning Mode which is chosen by the app +// developer. (see WorkflowVersioningMode enum documentation) +message WorkerDeploymentVersionInfo { + // Identifies a Worker Deployment Version. Must be unique within the namespace. + // Same ID cannot be used in multiple Deployments. + // In some contexts, such as Reset-by-build-id, version might be used + // as "Build ID". + string version = 1; + + // Each Worker Version belongs to exactly one Deployment. + string deployment_name = 2; + + google.protobuf.Timestamp create_time = 3; + // All the Task Queues + repeated WorkerBuildTaskQueueInfo task_queue_infos = 4; + // Arbitrary user-provided metadata attached to this Build. + WorkerBuildMetadata metadata = 5; + // Aggregated status for all Task Queues being polled in this Build. + PollersStatus aggregated_pollers_status = 6; + + + message WorkerBuildTaskQueueInfo { + string name = 1; + temporal.api.enums.v1.TaskQueueType type = 2; + PollersStatus pollers_status = 3; + } +} + +message WorkerBuildMetadata { + // Arbitrary key-value pairs. + map entries = 1; +} + +// Pollers' status information. Depending on the context, this may be relevant to +// one or more Task Queues and one or more Builds. +message PollersStatus { + // True if there are active pollers for the relevant Task Queue(s) in the + // relevant Build(s). + bool has_pollers = 1; + // When server saw the first poller for (any of) the relevant Task Queue(s) in + // (any of) the relevant Build(s). + google.protobuf.Timestamp poll_start_timestamp = 2; + // Only present if has_poller is false. This is approximate and can be off by + // a few minutes. + google.protobuf.Timestamp poll_stop_timestamp = 3; +} diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index f84e3e2c..9f478170 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -1884,15 +1884,26 @@ message UpdateWorkflowExecutionOptionsResponse { temporal.api.workflow.v1.WorkflowExecutionOptions workflow_execution_options = 1; } +// [cleanup-wv-pre-release] Pre-release deployment APIs, clean up later message DescribeDeploymentRequest { string namespace = 1; deployment.v1.Deployment deployment = 2; } - +// [cleanup-wv-pre-release] Pre-release deployment APIs, clean up later message DescribeDeploymentResponse { deployment.v1.DeploymentInfo deployment_info = 1; } +message DescribeWorkerDeploymentVersionRequest { + string namespace = 1; + string version = 2; +} + +message DescribeWorkerDeploymentVersionResponse { + deployment.v1.WorkerDeploymentVersionInfo worker_deployment_version_info = 1; +} + +// [cleanup-wv-pre-release] Pre-release deployment APIs, clean up later message ListDeploymentsRequest { string namespace = 1; int32 page_size = 2; @@ -1901,11 +1912,13 @@ message ListDeploymentsRequest { string series_name = 4; } +// [cleanup-wv-pre-release] Pre-release deployment APIs, clean up later message ListDeploymentsResponse { bytes next_page_token = 1; repeated temporal.api.deployment.v1.DeploymentListInfo deployments = 2; } +// [cleanup-wv-pre-release] Pre-release deployment APIs, clean up later message SetCurrentDeploymentRequest { string namespace = 1; temporal.api.deployment.v1.Deployment deployment = 2; @@ -1916,28 +1929,45 @@ message SetCurrentDeploymentRequest { // links to internal deployment pipelines, etc. temporal.api.deployment.v1.UpdateDeploymentMetadata update_metadata = 4; } - +// [cleanup-wv-pre-release] Pre-release deployment APIs, clean up later message SetCurrentDeploymentResponse { temporal.api.deployment.v1.DeploymentInfo current_deployment_info = 1; // Info of the deployment that was current before executing this operation. temporal.api.deployment.v1.DeploymentInfo previous_deployment_info = 2; } +message SetCurrentDeploymentVersionRequest { + string namespace = 1; + string deployment_name = 2; + // Must be a Versioned Build. Pass empty string to unset. + string version = 3; + // Optional. The identity of the client who initiated this request. + string identity = 4; +} + +message SetCurrentDeploymentVersionResponse { + // Info of the version that was current before executing this operation. + string previous_version = 1; +} + // Returns the Current Deployment of a deployment series. +// [cleanup-wv-pre-release] Pre-release deployment APIs, clean up later message GetCurrentDeploymentRequest { string namespace = 1; string series_name = 2; } - +// [cleanup-wv-pre-release] Pre-release deployment APIs, clean up later message GetCurrentDeploymentResponse { temporal.api.deployment.v1.DeploymentInfo current_deployment_info = 1; } +// [cleanup-wv-pre-release] Pre-release deployment APIs, clean up later message GetDeploymentReachabilityRequest { string namespace = 1; temporal.api.deployment.v1.Deployment deployment = 2; } +// [cleanup-wv-pre-release] Pre-release deployment APIs, clean up later message GetDeploymentReachabilityResponse { temporal.api.deployment.v1.DeploymentInfo deployment_info = 1; enums.v1.DeploymentReachability reachability = 2; diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 0a6c8308..841aa6d5 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -774,6 +774,7 @@ service WorkflowService { // Describes a worker deployment. // Experimental. This API might significantly change or be removed in a future release. + // [cleanup-wv-pre-release] rpc DescribeDeployment (DescribeDeploymentRequest) returns (DescribeDeploymentResponse) { option (google.api.http) = { get: "/namespaces/{namespace}/deployments/{deployment.series_name}/{deployment.build_id}" @@ -783,9 +784,20 @@ service WorkflowService { }; } + // Describes a worker deployment version. + rpc DescribeWorkerDeploymentVersion (DescribeWorkerDeploymentVersionRequest) returns (DescribeWorkerDeploymentVersionResponse) { + option (google.api.http) = { + get: "/namespaces/{namespace}/worker-deployments/{version}" + additional_bindings { + get: "/api/v1/namespaces/{namespace}/worker-deployments/{version}" + } + }; + } + // Lists worker deployments in the namespace. Optionally can filter based on deployment series // name. // Experimental. This API might significantly change or be removed in a future release. + // [cleanup-wv-pre-release] rpc ListDeployments (ListDeploymentsRequest) returns (ListDeploymentsResponse) { option (google.api.http) = { get: "/namespaces/{namespace}/deployments" @@ -802,6 +814,7 @@ service WorkflowService { // cached value. In such a case, the `last_update_time` will inform you about the actual // reachability calculation time. // Experimental. This API might significantly change or be removed in a future release. + // [cleanup-wv-pre-release] rpc GetDeploymentReachability (GetDeploymentReachabilityRequest) returns (GetDeploymentReachabilityResponse) { option (google.api.http) = { get: "/namespaces/{namespace}/deployments/{deployment.series_name}/{deployment.build_id}/reachability" @@ -813,6 +826,7 @@ service WorkflowService { // Returns the current deployment (and its info) for a given deployment series. // Experimental. This API might significantly change or be removed in a future release. + // [cleanup-wv-pre-release] rpc GetCurrentDeployment (GetCurrentDeploymentRequest) returns (GetCurrentDeploymentResponse) { option (google.api.http) = { get: "/namespaces/{namespace}/current-deployment/{series_name}" @@ -825,6 +839,7 @@ service WorkflowService { // Sets a deployment as the current deployment for its deployment series. Can optionally update // the metadata of the deployment as well. // Experimental. This API might significantly change or be removed in a future release. + // [cleanup-wv-pre-release] rpc SetCurrentDeployment (SetCurrentDeploymentRequest) returns (SetCurrentDeploymentResponse) { option (google.api.http) = { post: "/namespaces/{namespace}/current-deployment/{deployment.series_name}" @@ -836,6 +851,18 @@ service WorkflowService { }; } + // Sets a deployment version as the current version for its deployment. + rpc SetCurrentDeploymentVersion (SetCurrentDeploymentVersionRequest) returns (SetCurrentDeploymentVersionResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/current-deployment-version/{deployment_name}" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/current-deployment-version/{deployment_name}" + body: "*" + } + }; + } + // Invokes the specified Update function on user Workflow code. rpc UpdateWorkflowExecution(UpdateWorkflowExecutionRequest) returns (UpdateWorkflowExecutionResponse) { option (google.api.http) = { From af2f8db9c3a39e4343872317151ff63fb7b9630e Mon Sep 17 00:00:00 2001 From: Shivam Saraf Date: Wed, 15 Jan 2025 10:20:42 -0500 Subject: [PATCH 2/9] package: workerdeployment --- temporal/api/deployment/v1/message.proto | 52 ----------- .../api/workerdeployment/v1/message.proto | 90 +++++++++++++++++++ .../workflowservice/v1/request_response.proto | 4 +- 3 files changed, 92 insertions(+), 54 deletions(-) create mode 100644 temporal/api/workerdeployment/v1/message.proto diff --git a/temporal/api/deployment/v1/message.proto b/temporal/api/deployment/v1/message.proto index 571891ea..2a410403 100644 --- a/temporal/api/deployment/v1/message.proto +++ b/temporal/api/deployment/v1/message.proto @@ -92,55 +92,3 @@ message DeploymentListInfo { bool is_current = 3; } -// A Worker Deployment Version (Version, for short) represents all workers of the same -// code and config within a Deployment. Workers of the same Version are expected to -// behave exactly the same so when executions move between them there are no -// non-determinism issues. -// Worker Deployment Versions are created in Temporal server automatically when -// their first poller arrives to the server. -// Each Version has a Workflow Versioning Mode which is chosen by the app -// developer. (see WorkflowVersioningMode enum documentation) -message WorkerDeploymentVersionInfo { - // Identifies a Worker Deployment Version. Must be unique within the namespace. - // Same ID cannot be used in multiple Deployments. - // In some contexts, such as Reset-by-build-id, version might be used - // as "Build ID". - string version = 1; - - // Each Worker Version belongs to exactly one Deployment. - string deployment_name = 2; - - google.protobuf.Timestamp create_time = 3; - // All the Task Queues - repeated WorkerBuildTaskQueueInfo task_queue_infos = 4; - // Arbitrary user-provided metadata attached to this Build. - WorkerBuildMetadata metadata = 5; - // Aggregated status for all Task Queues being polled in this Build. - PollersStatus aggregated_pollers_status = 6; - - - message WorkerBuildTaskQueueInfo { - string name = 1; - temporal.api.enums.v1.TaskQueueType type = 2; - PollersStatus pollers_status = 3; - } -} - -message WorkerBuildMetadata { - // Arbitrary key-value pairs. - map entries = 1; -} - -// Pollers' status information. Depending on the context, this may be relevant to -// one or more Task Queues and one or more Builds. -message PollersStatus { - // True if there are active pollers for the relevant Task Queue(s) in the - // relevant Build(s). - bool has_pollers = 1; - // When server saw the first poller for (any of) the relevant Task Queue(s) in - // (any of) the relevant Build(s). - google.protobuf.Timestamp poll_start_timestamp = 2; - // Only present if has_poller is false. This is approximate and can be off by - // a few minutes. - google.protobuf.Timestamp poll_stop_timestamp = 3; -} diff --git a/temporal/api/workerdeployment/v1/message.proto b/temporal/api/workerdeployment/v1/message.proto new file mode 100644 index 00000000..61d87558 --- /dev/null +++ b/temporal/api/workerdeployment/v1/message.proto @@ -0,0 +1,90 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.workerdeployment.v1; + +option go_package = "go.temporal.io/api/workerdeployment/v1;workerdeployment"; +option java_package = "io.temporal.api.workerdeployment.v1"; +option java_multiple_files = true; +option java_outer_classname = "MessageProto"; +option ruby_package = "Temporalio::Api::WorkerDeployment::V1"; +option csharp_namespace = "Temporalio.Api.WorkerDeployment.V1"; + +import "google/protobuf/timestamp.proto"; + +import "temporal/api/enums/v1/task_queue.proto"; +import "temporal/api/common/v1/message.proto"; + +// A Worker Deployment Version (Version, for short) represents all workers of the same +// code and config within a Deployment. Workers of the same Version are expected to +// behave exactly the same so when executions move between them there are no +// non-determinism issues. +// Worker Deployment Versions are created in Temporal server automatically when +// their first poller arrives to the server. +// Each Version has a Workflow Versioning Mode which is chosen by the app +// developer. (see WorkflowVersioningMode enum documentation) +message WorkerDeploymentVersionInfo { + // Identifies a Worker Deployment Version. Must be unique within the namespace. + // Same ID cannot be used in multiple Deployments. + // In some contexts, such as Reset-by-build-id, version might be used + // as "Build ID". + string version = 1; + + // Each Worker Version belongs to exactly one Deployment. + string deployment_name = 2; + + google.protobuf.Timestamp create_time = 3; + // All the Task Queues + repeated WorkerBuildTaskQueueInfo task_queue_infos = 4; + // Arbitrary user-provided metadata attached to this Build. + WorkerBuildMetadata metadata = 5; + // Aggregated status for all Task Queues being polled in this Build. + PollersStatus aggregated_pollers_status = 6; + + + message WorkerBuildTaskQueueInfo { + string name = 1; + temporal.api.enums.v1.TaskQueueType type = 2; + PollersStatus pollers_status = 3; + } +} + +message WorkerBuildMetadata { + // Arbitrary key-value pairs. + map entries = 1; +} + +// Pollers' status information. Depending on the context, this may be relevant to +// one or more Task Queues and one or more Builds. +message PollersStatus { + // True if there are active pollers for the relevant Task Queue(s) in the + // relevant Build(s). + bool has_pollers = 1; + // When server saw the first poller for (any of) the relevant Task Queue(s) in + // (any of) the relevant Build(s). + google.protobuf.Timestamp poll_start_timestamp = 2; + // Only present if has_poller is false. This is approximate and can be off by + // a few minutes. + google.protobuf.Timestamp poll_stop_timestamp = 3; +} diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 9f478170..00788ef7 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -61,7 +61,7 @@ import "temporal/api/batch/v1/message.proto"; import "temporal/api/sdk/v1/task_complete_metadata.proto"; import "temporal/api/sdk/v1/user_metadata.proto"; import "temporal/api/nexus/v1/message.proto"; - +import "temporal/api/workerdeployment/v1/message.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; @@ -1900,7 +1900,7 @@ message DescribeWorkerDeploymentVersionRequest { } message DescribeWorkerDeploymentVersionResponse { - deployment.v1.WorkerDeploymentVersionInfo worker_deployment_version_info = 1; + workerdeployment.v1.WorkerDeploymentVersionInfo worker_deployment_version_info = 1; } // [cleanup-wv-pre-release] Pre-release deployment APIs, clean up later From 715cf540965188a49656a54180688ce12724a04e Mon Sep 17 00:00:00 2001 From: Shivam Saraf Date: Wed, 15 Jan 2025 10:38:24 -0500 Subject: [PATCH 3/9] stop lint complaints --- temporal/api/.idea/workspace.xml | 55 +++++++++++++++++++ .../api/workerdeployment/v1/message.proto | 4 +- 2 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 temporal/api/.idea/workspace.xml diff --git a/temporal/api/.idea/workspace.xml b/temporal/api/.idea/workspace.xml new file mode 100644 index 00000000..c8219157 --- /dev/null +++ b/temporal/api/.idea/workspace.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + true + + \ No newline at end of file diff --git a/temporal/api/workerdeployment/v1/message.proto b/temporal/api/workerdeployment/v1/message.proto index 61d87558..dd5c730e 100644 --- a/temporal/api/workerdeployment/v1/message.proto +++ b/temporal/api/workerdeployment/v1/message.proto @@ -83,8 +83,8 @@ message PollersStatus { bool has_pollers = 1; // When server saw the first poller for (any of) the relevant Task Queue(s) in // (any of) the relevant Build(s). - google.protobuf.Timestamp poll_start_timestamp = 2; + google.protobuf.Timestamp poll_start_time = 2; // Only present if has_poller is false. This is approximate and can be off by // a few minutes. - google.protobuf.Timestamp poll_stop_timestamp = 3; + google.protobuf.Timestamp poll_stop_time = 3; } From d47560974bf690a4eacf026e312e791d780fafbb Mon Sep 17 00:00:00 2001 From: Shivam Saraf Date: Wed, 15 Jan 2025 10:50:19 -0500 Subject: [PATCH 4/9] Fixed breaking ci-build --- openapi/openapiv2.json | 318 ++++++++++++++++++++++++++++++++++++++--- openapi/openapiv3.yaml | 247 +++++++++++++++++++++++++++++++- 2 files changed, 545 insertions(+), 20 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index b961ba80..caf4a284 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -868,9 +868,54 @@ ] } }, + "/api/v1/namespaces/{namespace}/current-deployment-version/{deploymentName}": { + "post": { + "summary": "Sets a deployment version as the current version for its deployment.", + "operationId": "SetCurrentDeploymentVersion2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1SetCurrentDeploymentVersionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentName", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceSetCurrentDeploymentVersionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/current-deployment/{deployment.seriesName}": { "post": { - "summary": "Sets a deployment as the current deployment for its deployment series. Can optionally update\nthe metadata of the deployment as well.\nExperimental. This API might significantly change or be removed in a future release.", + "summary": "Sets a deployment as the current deployment for its deployment series. Can optionally update\nthe metadata of the deployment as well.\nExperimental. This API might significantly change or be removed in a future release.\n[cleanup-wv-pre-release]", "operationId": "SetCurrentDeployment2", "responses": { "200": { @@ -916,7 +961,7 @@ }, "/api/v1/namespaces/{namespace}/current-deployment/{seriesName}": { "get": { - "summary": "Returns the current deployment (and its info) for a given deployment series.\nExperimental. This API might significantly change or be removed in a future release.", + "summary": "Returns the current deployment (and its info) for a given deployment series.\nExperimental. This API might significantly change or be removed in a future release.\n[cleanup-wv-pre-release]", "operationId": "GetCurrentDeployment2", "responses": { "200": { @@ -953,7 +998,7 @@ }, "/api/v1/namespaces/{namespace}/deployments": { "get": { - "summary": "Lists worker deployments in the namespace. Optionally can filter based on deployment series\nname.\nExperimental. This API might significantly change or be removed in a future release.", + "summary": "Lists worker deployments in the namespace. Optionally can filter based on deployment series\nname.\nExperimental. This API might significantly change or be removed in a future release.\n[cleanup-wv-pre-release]", "operationId": "ListDeployments2", "responses": { "200": { @@ -1005,7 +1050,7 @@ }, "/api/v1/namespaces/{namespace}/deployments/{deployment.seriesName}/{deployment.buildId}": { "get": { - "summary": "Describes a worker deployment.\nExperimental. This API might significantly change or be removed in a future release.", + "summary": "Describes a worker deployment.\nExperimental. This API might significantly change or be removed in a future release.\n[cleanup-wv-pre-release]", "operationId": "DescribeDeployment2", "responses": { "200": { @@ -1050,7 +1095,7 @@ }, "/api/v1/namespaces/{namespace}/deployments/{deployment.seriesName}/{deployment.buildId}/reachability": { "get": { - "summary": "Returns the reachability level of a worker deployment to help users decide when it is time\nto decommission a deployment. Reachability level is calculated based on the deployment's\n`status` and existing workflows that depend on the given deployment for their execution.\nCalculating reachability is relatively expensive. Therefore, server might return a recently\ncached value. In such a case, the `last_update_time` will inform you about the actual\nreachability calculation time.\nExperimental. This API might significantly change or be removed in a future release.", + "summary": "Returns the reachability level of a worker deployment to help users decide when it is time\nto decommission a deployment. Reachability level is calculated based on the deployment's\n`status` and existing workflows that depend on the given deployment for their execution.\nCalculating reachability is relatively expensive. Therefore, server might return a recently\ncached value. In such a case, the `last_update_time` will inform you about the actual\nreachability calculation time.\nExperimental. This API might significantly change or be removed in a future release.\n[cleanup-wv-pre-release]", "operationId": "GetDeploymentReachability2", "responses": { "200": { @@ -1730,6 +1775,43 @@ ] } }, + "/api/v1/namespaces/{namespace}/worker-deployments/{version}": { + "get": { + "summary": "Describes a worker deployment version.", + "operationId": "DescribeWorkerDeploymentVersion2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DescribeWorkerDeploymentVersionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "version", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/worker-task-reachability": { "get": { "summary": "Deprecated. Use `DescribeTaskQueue`.", @@ -3868,9 +3950,54 @@ ] } }, + "/namespaces/{namespace}/current-deployment-version/{deploymentName}": { + "post": { + "summary": "Sets a deployment version as the current version for its deployment.", + "operationId": "SetCurrentDeploymentVersion", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1SetCurrentDeploymentVersionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentName", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceSetCurrentDeploymentVersionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/current-deployment/{deployment.seriesName}": { "post": { - "summary": "Sets a deployment as the current deployment for its deployment series. Can optionally update\nthe metadata of the deployment as well.\nExperimental. This API might significantly change or be removed in a future release.", + "summary": "Sets a deployment as the current deployment for its deployment series. Can optionally update\nthe metadata of the deployment as well.\nExperimental. This API might significantly change or be removed in a future release.\n[cleanup-wv-pre-release]", "operationId": "SetCurrentDeployment", "responses": { "200": { @@ -3916,7 +4043,7 @@ }, "/namespaces/{namespace}/current-deployment/{seriesName}": { "get": { - "summary": "Returns the current deployment (and its info) for a given deployment series.\nExperimental. This API might significantly change or be removed in a future release.", + "summary": "Returns the current deployment (and its info) for a given deployment series.\nExperimental. This API might significantly change or be removed in a future release.\n[cleanup-wv-pre-release]", "operationId": "GetCurrentDeployment", "responses": { "200": { @@ -3953,7 +4080,7 @@ }, "/namespaces/{namespace}/deployments": { "get": { - "summary": "Lists worker deployments in the namespace. Optionally can filter based on deployment series\nname.\nExperimental. This API might significantly change or be removed in a future release.", + "summary": "Lists worker deployments in the namespace. Optionally can filter based on deployment series\nname.\nExperimental. This API might significantly change or be removed in a future release.\n[cleanup-wv-pre-release]", "operationId": "ListDeployments", "responses": { "200": { @@ -4005,7 +4132,7 @@ }, "/namespaces/{namespace}/deployments/{deployment.seriesName}/{deployment.buildId}": { "get": { - "summary": "Describes a worker deployment.\nExperimental. This API might significantly change or be removed in a future release.", + "summary": "Describes a worker deployment.\nExperimental. This API might significantly change or be removed in a future release.\n[cleanup-wv-pre-release]", "operationId": "DescribeDeployment", "responses": { "200": { @@ -4050,7 +4177,7 @@ }, "/namespaces/{namespace}/deployments/{deployment.seriesName}/{deployment.buildId}/reachability": { "get": { - "summary": "Returns the reachability level of a worker deployment to help users decide when it is time\nto decommission a deployment. Reachability level is calculated based on the deployment's\n`status` and existing workflows that depend on the given deployment for their execution.\nCalculating reachability is relatively expensive. Therefore, server might return a recently\ncached value. In such a case, the `last_update_time` will inform you about the actual\nreachability calculation time.\nExperimental. This API might significantly change or be removed in a future release.", + "summary": "Returns the reachability level of a worker deployment to help users decide when it is time\nto decommission a deployment. Reachability level is calculated based on the deployment's\n`status` and existing workflows that depend on the given deployment for their execution.\nCalculating reachability is relatively expensive. Therefore, server might return a recently\ncached value. In such a case, the `last_update_time` will inform you about the actual\nreachability calculation time.\nExperimental. This API might significantly change or be removed in a future release.\n[cleanup-wv-pre-release]", "operationId": "GetDeploymentReachability", "responses": { "200": { @@ -4660,6 +4787,43 @@ ] } }, + "/namespaces/{namespace}/worker-deployments/{version}": { + "get": { + "summary": "Describes a worker deployment version.", + "operationId": "DescribeWorkerDeploymentVersion", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DescribeWorkerDeploymentVersionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "version", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/worker-task-reachability": { "get": { "summary": "Deprecated. Use `DescribeTaskQueue`.", @@ -5819,6 +5983,20 @@ }, "description": "Replaces the routing rule with the given source Build ID." }, + "WorkerDeploymentVersionInfoWorkerBuildTaskQueueInfo": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/v1TaskQueueType" + }, + "pollersStatus": { + "$ref": "#/definitions/v1PollersStatus" + } + } + }, "WorkflowEventEventReference": { "type": "object", "properties": { @@ -6269,7 +6447,7 @@ "description": "Build ID changes with each version of the worker when the worker program code and/or config\nchanges." } }, - "description": "`Deployment` identifies a deployment of Temporal workers. The combination of deployment series\nname + build ID serves as the identifier. User can use `WorkerDeploymentOptions` in their worker\nprograms to specify these values." + "title": "`Deployment` identifies a deployment of Temporal workers. The combination of deployment series\nname + build ID serves as the identifier. User can use `WorkerDeploymentOptions` in their worker\nprograms to specify these values.\n[cleanup-wv-pre-release]" }, "identity": { "type": "string", @@ -6279,6 +6457,20 @@ "$ref": "#/definitions/v1UpdateDeploymentMetadata", "description": "Optional. Use to add or remove user-defined metadata entries. Metadata entries are exposed\nwhen describing a deployment. It is a good place for information such as operator name,\nlinks to internal deployment pipelines, etc." } + }, + "title": "[cleanup-wv-pre-release] Pre-release deployment APIs, clean up later" + }, + "WorkflowServiceSetCurrentDeploymentVersionBody": { + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Must be a Versioned Build. Pass empty string to unset." + }, + "identity": { + "type": "string", + "description": "Optional. The identity of the client who initiated this request." + } } }, "WorkflowServiceSignalWithStartWorkflowExecutionBody": { @@ -8215,7 +8407,7 @@ "description": "Build ID changes with each version of the worker when the worker program code and/or config\nchanges." } }, - "description": "`Deployment` identifies a deployment of Temporal workers. The combination of deployment series\nname + build ID serves as the identifier. User can use `WorkerDeploymentOptions` in their worker\nprograms to specify these values." + "title": "`Deployment` identifies a deployment of Temporal workers. The combination of deployment series\nname + build ID serves as the identifier. User can use `WorkerDeploymentOptions` in their worker\nprograms to specify these values.\n[cleanup-wv-pre-release]" }, "v1DeploymentInfo": { "type": "object", @@ -8246,7 +8438,7 @@ "description": "If this deployment is the current deployment of its deployment series." } }, - "description": "`DeploymentInfo` holds information about a deployment. Deployment information is tracked\nautomatically by server as soon as the first poll from that deployment reaches the server. There\ncan be multiple task queue workers in a single deployment which are listed in this message." + "title": "`DeploymentInfo` holds information about a deployment. Deployment information is tracked\nautomatically by server as soon as the first poll from that deployment reaches the server. There\ncan be multiple task queue workers in a single deployment which are listed in this message.\n[cleanup-wv-pre-release]" }, "v1DeploymentListInfo": { "type": "object", @@ -8263,7 +8455,7 @@ "description": "If this deployment is the current deployment of its deployment series." } }, - "description": "DeploymentListInfo is an abbreviated set of fields from DeploymentInfo that's returned in\nListDeployments." + "title": "DeploymentListInfo is an abbreviated set of fields from DeploymentInfo that's returned in\nListDeployments.\n[cleanup-wv-pre-release]" }, "v1DeploymentReachability": { "type": "string", @@ -8346,7 +8538,8 @@ "deploymentInfo": { "$ref": "#/definitions/v1DeploymentInfo" } - } + }, + "title": "[cleanup-wv-pre-release] Pre-release deployment APIs, clean up later" }, "v1DescribeNamespaceResponse": { "type": "object", @@ -8435,6 +8628,14 @@ } } }, + "v1DescribeWorkerDeploymentVersionResponse": { + "type": "object", + "properties": { + "workerDeploymentVersionInfo": { + "$ref": "#/definitions/v1WorkerDeploymentVersionInfo" + } + } + }, "v1DescribeWorkflowExecutionResponse": { "type": "object", "properties": { @@ -8747,7 +8948,8 @@ "currentDeploymentInfo": { "$ref": "#/definitions/v1DeploymentInfo" } - } + }, + "title": "[cleanup-wv-pre-release] Pre-release deployment APIs, clean up later" }, "v1GetDeploymentReachabilityResponse": { "type": "object", @@ -8763,7 +8965,8 @@ "format": "date-time", "description": "Reachability level might come from server cache. This timestamp specifies when the value\nwas actually calculated." } - } + }, + "title": "[cleanup-wv-pre-release] Pre-release deployment APIs, clean up later" }, "v1GetNexusEndpointResponse": { "type": "object", @@ -9312,7 +9515,8 @@ "$ref": "#/definitions/v1DeploymentListInfo" } } - } + }, + "title": "[cleanup-wv-pre-release] Pre-release deployment APIs, clean up later" }, "v1ListNamespacesResponse": { "type": "object", @@ -10452,6 +10656,26 @@ } } }, + "v1PollersStatus": { + "type": "object", + "properties": { + "hasPollers": { + "type": "boolean", + "description": "True if there are active pollers for the relevant Task Queue(s) in the \nrelevant Build(s)." + }, + "pollStartTime": { + "type": "string", + "format": "date-time", + "description": "When server saw the first poller for (any of) the relevant Task Queue(s) in \n(any of) the relevant Build(s)." + }, + "pollStopTime": { + "type": "string", + "format": "date-time", + "description": "Only present if has_poller is false. This is approximate and can be off by \na few minutes." + } + }, + "description": "Pollers' status information. Depending on the context, this may be relevant to \none or more Task Queues and one or more Builds." + }, "v1ProtocolMessageCommandAttributes": { "type": "object", "properties": { @@ -11493,6 +11717,16 @@ "$ref": "#/definitions/v1DeploymentInfo", "description": "Info of the deployment that was current before executing this operation." } + }, + "title": "[cleanup-wv-pre-release] Pre-release deployment APIs, clean up later" + }, + "v1SetCurrentDeploymentVersionResponse": { + "type": "object", + "properties": { + "previousVersion": { + "type": "string", + "description": "Info of the version that was current before executing this operation." + } } }, "v1Severity": { @@ -12483,7 +12717,7 @@ "description": "List of keys to remove from the metadata." } }, - "description": "Used as part of Deployment write APIs to update metadata attached to a deployment." + "title": "Used as part of Deployment write APIs to update metadata attached to a deployment.\n[cleanup-wv-pre-release]" }, "v1UpdateNamespaceInfo": { "type": "object", @@ -12736,6 +12970,52 @@ }, "description": "Specifies client's intent to wait for Update results." }, + "v1WorkerBuildMetadata": { + "type": "object", + "properties": { + "entries": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v1Payload" + }, + "description": "Arbitrary key-value pairs." + } + } + }, + "v1WorkerDeploymentVersionInfo": { + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Identifies a Worker Deployment Version. Must be unique within the namespace.\nSame ID cannot be used in multiple Deployments.\nIn some contexts, such as Reset-by-build-id, version might be used\nas \"Build ID\"." + }, + "deploymentName": { + "type": "string", + "description": "Each Worker Version belongs to exactly one Deployment." + }, + "createTime": { + "type": "string", + "format": "date-time" + }, + "taskQueueInfos": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/WorkerDeploymentVersionInfoWorkerBuildTaskQueueInfo" + }, + "title": "All the Task Queues" + }, + "metadata": { + "$ref": "#/definitions/v1WorkerBuildMetadata", + "description": "Arbitrary user-provided metadata attached to this Build." + }, + "aggregatedPollersStatus": { + "$ref": "#/definitions/v1PollersStatus", + "description": "Aggregated status for all Task Queues being polled in this Build." + } + }, + "title": "A Worker Deployment Version (Version, for short) represents all workers of the same \ncode and config within a Deployment. Workers of the same Version are expected to \nbehave exactly the same so when executions move between them there are no \nnon-determinism issues.\nWorker Deployment Versions are created in Temporal server automatically when \ntheir first poller arrives to the server.\nEach Version has a Workflow Versioning Mode which is chosen by the app\ndeveloper. (see WorkflowVersioningMode enum documentation)" + }, "v1WorkerVersionCapabilities": { "type": "object", "properties": { diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 01547435..527667d5 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -772,6 +772,42 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/current-deployment-version/{deploymentName}: + post: + tags: + - WorkflowService + description: Sets a deployment version as the current version for its deployment. + operationId: SetCurrentDeploymentVersion + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: deploymentName + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SetCurrentDeploymentVersionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SetCurrentDeploymentVersionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/current-deployment/{deployment.series_name}: post: tags: @@ -780,6 +816,7 @@ paths: Sets a deployment as the current deployment for its deployment series. Can optionally update the metadata of the deployment as well. Experimental. This API might significantly change or be removed in a future release. + [cleanup-wv-pre-release] operationId: SetCurrentDeployment parameters: - name: namespace @@ -818,6 +855,7 @@ paths: description: |- Returns the current deployment (and its info) for a given deployment series. Experimental. This API might significantly change or be removed in a future release. + [cleanup-wv-pre-release] operationId: GetCurrentDeployment parameters: - name: namespace @@ -851,6 +889,7 @@ paths: Lists worker deployments in the namespace. Optionally can filter based on deployment series name. Experimental. This API might significantly change or be removed in a future release. + [cleanup-wv-pre-release] operationId: ListDeployments parameters: - name: namespace @@ -893,6 +932,7 @@ paths: description: |- Describes a worker deployment. Experimental. This API might significantly change or be removed in a future release. + [cleanup-wv-pre-release] operationId: DescribeDeployment parameters: - name: namespace @@ -952,6 +992,7 @@ paths: cached value. In such a case, the `last_update_time` will inform you about the actual reachability calculation time. Experimental. This API might significantly change or be removed in a future release. + [cleanup-wv-pre-release] operationId: GetDeploymentReachability parameters: - name: namespace @@ -1528,6 +1569,36 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/worker-deployments/{version}: + get: + tags: + - WorkflowService + description: Describes a worker deployment version. + operationId: DescribeWorkerDeploymentVersion + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: version + in: path + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeWorkerDeploymentVersionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/worker-task-reachability: get: tags: @@ -3435,6 +3506,42 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/current-deployment-version/{deploymentName}: + post: + tags: + - WorkflowService + description: Sets a deployment version as the current version for its deployment. + operationId: SetCurrentDeploymentVersion + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: deploymentName + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SetCurrentDeploymentVersionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SetCurrentDeploymentVersionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/current-deployment/{deployment.series_name}: post: tags: @@ -3443,6 +3550,7 @@ paths: Sets a deployment as the current deployment for its deployment series. Can optionally update the metadata of the deployment as well. Experimental. This API might significantly change or be removed in a future release. + [cleanup-wv-pre-release] operationId: SetCurrentDeployment parameters: - name: namespace @@ -3481,6 +3589,7 @@ paths: description: |- Returns the current deployment (and its info) for a given deployment series. Experimental. This API might significantly change or be removed in a future release. + [cleanup-wv-pre-release] operationId: GetCurrentDeployment parameters: - name: namespace @@ -3514,6 +3623,7 @@ paths: Lists worker deployments in the namespace. Optionally can filter based on deployment series name. Experimental. This API might significantly change or be removed in a future release. + [cleanup-wv-pre-release] operationId: ListDeployments parameters: - name: namespace @@ -3556,6 +3666,7 @@ paths: description: |- Describes a worker deployment. Experimental. This API might significantly change or be removed in a future release. + [cleanup-wv-pre-release] operationId: DescribeDeployment parameters: - name: namespace @@ -3615,6 +3726,7 @@ paths: cached value. In such a case, the `last_update_time` will inform you about the actual reachability calculation time. Experimental. This API might significantly change or be removed in a future release. + [cleanup-wv-pre-release] operationId: GetDeploymentReachability parameters: - name: namespace @@ -4133,6 +4245,36 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/worker-deployments/{version}: + get: + tags: + - WorkflowService + description: Describes a worker deployment version. + operationId: DescribeWorkerDeploymentVersion + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: version + in: path + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeWorkerDeploymentVersionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/worker-task-reachability: get: tags: @@ -5936,6 +6078,7 @@ components: `Deployment` identifies a deployment of Temporal workers. The combination of deployment series name + build ID serves as the identifier. User can use `WorkerDeploymentOptions` in their worker programs to specify these values. + [cleanup-wv-pre-release] DeploymentInfo: type: object properties: @@ -5962,6 +6105,7 @@ components: `DeploymentInfo` holds information about a deployment. Deployment information is tracked automatically by server as soon as the first poll from that deployment reaches the server. There can be multiple task queue workers in a single deployment which are listed in this message. + [cleanup-wv-pre-release] DeploymentInfo_TaskQueueInfo: type: object properties: @@ -5993,6 +6137,7 @@ components: description: |- DeploymentListInfo is an abbreviated set of fields from DeploymentInfo that's returned in ListDeployments. + [cleanup-wv-pre-release] DeploymentTransition: type: object properties: @@ -6060,6 +6205,7 @@ components: properties: deploymentInfo: $ref: '#/components/schemas/DeploymentInfo' + description: '[cleanup-wv-pre-release] Pre-release deployment APIs, clean up later' DescribeNamespaceResponse: type: object properties: @@ -6132,6 +6278,11 @@ components: description: |- This map contains Task Queue information for each Build ID. Empty string as key value means unversioned. Only set in `ENHANCED` mode. + DescribeWorkerDeploymentVersionResponse: + type: object + properties: + workerDeploymentVersionInfo: + $ref: '#/components/schemas/WorkerDeploymentVersionInfo' DescribeWorkflowExecutionResponse: type: object properties: @@ -6420,6 +6571,7 @@ components: properties: currentDeploymentInfo: $ref: '#/components/schemas/DeploymentInfo' + description: '[cleanup-wv-pre-release] Pre-release deployment APIs, clean up later' GetDeploymentReachabilityResponse: type: object properties: @@ -6439,6 +6591,7 @@ components: Reachability level might come from server cache. This timestamp specifies when the value was actually calculated. format: date-time + description: '[cleanup-wv-pre-release] Pre-release deployment APIs, clean up later' GetNexusEndpointResponse: type: object properties: @@ -6916,6 +7069,7 @@ components: type: array items: $ref: '#/components/schemas/DeploymentListInfo' + description: '[cleanup-wv-pre-release] Pre-release deployment APIs, clean up later' ListNamespacesResponse: type: object properties: @@ -7807,6 +7961,21 @@ components: description: |- If a worker has opted into the worker versioning feature while polling, its capabilities will appear here. + PollersStatus: + type: object + properties: + hasPollers: + type: boolean + description: "True if there are active pollers for the relevant Task Queue(s) in the \n relevant Build(s)." + pollStartTime: + type: string + description: "When server saw the first poller for (any of) the relevant Task Queue(s) in \n (any of) the relevant Build(s)." + format: date-time + pollStopTime: + type: string + description: "Only present if has_poller is false. This is approximate and can be off by \n a few minutes." + format: date-time + description: "Pollers' status information. Depending on the context, this may be relevant to \n one or more Task Queues and one or more Builds." QueryRejected: type: object properties: @@ -8878,6 +9047,7 @@ components: Optional. Use to add or remove user-defined metadata entries. Metadata entries are exposed when describing a deployment. It is a good place for information such as operator name, links to internal deployment pipelines, etc. + description: '[cleanup-wv-pre-release] Pre-release deployment APIs, clean up later' SetCurrentDeploymentResponse: type: object properties: @@ -8887,6 +9057,26 @@ components: allOf: - $ref: '#/components/schemas/DeploymentInfo' description: Info of the deployment that was current before executing this operation. + description: '[cleanup-wv-pre-release] Pre-release deployment APIs, clean up later' + SetCurrentDeploymentVersionRequest: + type: object + properties: + namespace: + type: string + deploymentName: + type: string + version: + type: string + description: Must be a Versioned Build. Pass empty string to unset. + identity: + type: string + description: Optional. The identity of the client who initiated this request. + SetCurrentDeploymentVersionResponse: + type: object + properties: + previousVersion: + type: string + description: Info of the version that was current before executing this operation. SignalExternalWorkflowExecutionFailedEventAttributes: type: object properties: @@ -9860,7 +10050,9 @@ components: items: type: string description: List of keys to remove from the metadata. - description: Used as part of Deployment write APIs to update metadata attached to a deployment. + description: |- + Used as part of Deployment write APIs to update metadata attached to a deployment. + [cleanup-wv-pre-release] UpdateNamespaceInfo: type: object properties: @@ -10169,6 +10361,59 @@ components: user specified timeout, API call returns even if specified stage is not reached. format: enum description: Specifies client's intent to wait for Update results. + WorkerBuildMetadata: + type: object + properties: + entries: + type: object + additionalProperties: + $ref: '#/components/schemas/Payload' + description: Arbitrary key-value pairs. + WorkerDeploymentVersionInfo: + type: object + properties: + version: + type: string + description: |- + Identifies a Worker Deployment Version. Must be unique within the namespace. + Same ID cannot be used in multiple Deployments. + In some contexts, such as Reset-by-build-id, version might be used + as "Build ID". + deploymentName: + type: string + description: Each Worker Version belongs to exactly one Deployment. + createTime: + type: string + format: date-time + taskQueueInfos: + type: array + items: + $ref: '#/components/schemas/WorkerDeploymentVersionInfo_WorkerBuildTaskQueueInfo' + description: All the Task Queues + metadata: + allOf: + - $ref: '#/components/schemas/WorkerBuildMetadata' + description: Arbitrary user-provided metadata attached to this Build. + aggregatedPollersStatus: + allOf: + - $ref: '#/components/schemas/PollersStatus' + description: Aggregated status for all Task Queues being polled in this Build. + description: "A Worker Deployment Version (Version, for short) represents all workers of the same \n code and config within a Deployment. Workers of the same Version are expected to \n behave exactly the same so when executions move between them there are no \n non-determinism issues.\n Worker Deployment Versions are created in Temporal server automatically when \n their first poller arrives to the server.\n Each Version has a Workflow Versioning Mode which is chosen by the app\n developer. (see WorkflowVersioningMode enum documentation)" + WorkerDeploymentVersionInfo_WorkerBuildTaskQueueInfo: + type: object + properties: + name: + type: string + type: + enum: + - TASK_QUEUE_TYPE_UNSPECIFIED + - TASK_QUEUE_TYPE_WORKFLOW + - TASK_QUEUE_TYPE_ACTIVITY + - TASK_QUEUE_TYPE_NEXUS + type: string + format: enum + pollersStatus: + $ref: '#/components/schemas/PollersStatus' WorkerVersionCapabilities: type: object properties: From aa2f1a9d8613a8b3dbdba1e02705cf3eb441c5a6 Mon Sep 17 00:00:00 2001 From: Shivam Saraf Date: Wed, 15 Jan 2025 13:33:39 -0500 Subject: [PATCH 5/9] Moved updated protos into deployment package for consistency with server repo --- temporal/api/deployment/v1/message.proto | 53 +++++++++++ .../api/workerdeployment/v1/message.proto | 90 ------------------- .../workflowservice/v1/request_response.proto | 3 +- 3 files changed, 54 insertions(+), 92 deletions(-) delete mode 100644 temporal/api/workerdeployment/v1/message.proto diff --git a/temporal/api/deployment/v1/message.proto b/temporal/api/deployment/v1/message.proto index 2a410403..43097dc6 100644 --- a/temporal/api/deployment/v1/message.proto +++ b/temporal/api/deployment/v1/message.proto @@ -92,3 +92,56 @@ message DeploymentListInfo { bool is_current = 3; } + +// A Worker Deployment Version (Version, for short) represents all workers of the same +// code and config within a Deployment. Workers of the same Version are expected to +// behave exactly the same so when executions move between them there are no +// non-determinism issues. +// Worker Deployment Versions are created in Temporal server automatically when +// their first poller arrives to the server. +// Each Version has a Workflow Versioning Mode which is chosen by the app +// developer. (see WorkflowVersioningMode enum documentation) +message WorkerDeploymentVersionInfo { + // Identifies a Worker Deployment Version. Must be unique within the namespace. + // Same ID cannot be used in multiple Deployments. + // In some contexts, such as Reset-by-build-id, version might be used + // as "Build ID". + string version = 1; + + // Each Worker Version belongs to exactly one Deployment. + string deployment_name = 2; + + google.protobuf.Timestamp create_time = 3; + // All the Task Queues + repeated WorkerBuildTaskQueueInfo task_queue_infos = 4; + // Arbitrary user-provided metadata attached to this Build. + WorkerBuildMetadata metadata = 5; + // Aggregated status for all Task Queues being polled in this Build. + PollersStatus aggregated_pollers_status = 6; + + + message WorkerBuildTaskQueueInfo { + string name = 1; + temporal.api.enums.v1.TaskQueueType type = 2; + PollersStatus pollers_status = 3; + } +} + +message WorkerBuildMetadata { + // Arbitrary key-value pairs. + map entries = 1; +} + +// Pollers' status information. Depending on the context, this may be relevant to +// one or more Task Queues and one or more Builds. +message PollersStatus { + // True if there are active pollers for the relevant Task Queue(s) in the + // relevant Build(s). + bool has_pollers = 1; + // When server saw the first poller for (any of) the relevant Task Queue(s) in + // (any of) the relevant Build(s). + google.protobuf.Timestamp poll_start_time = 2; + // Only present if has_poller is false. This is approximate and can be off by + // a few minutes. + google.protobuf.Timestamp poll_stop_time = 3; +} diff --git a/temporal/api/workerdeployment/v1/message.proto b/temporal/api/workerdeployment/v1/message.proto deleted file mode 100644 index dd5c730e..00000000 --- a/temporal/api/workerdeployment/v1/message.proto +++ /dev/null @@ -1,90 +0,0 @@ -// The MIT License -// -// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -syntax = "proto3"; - -package temporal.api.workerdeployment.v1; - -option go_package = "go.temporal.io/api/workerdeployment/v1;workerdeployment"; -option java_package = "io.temporal.api.workerdeployment.v1"; -option java_multiple_files = true; -option java_outer_classname = "MessageProto"; -option ruby_package = "Temporalio::Api::WorkerDeployment::V1"; -option csharp_namespace = "Temporalio.Api.WorkerDeployment.V1"; - -import "google/protobuf/timestamp.proto"; - -import "temporal/api/enums/v1/task_queue.proto"; -import "temporal/api/common/v1/message.proto"; - -// A Worker Deployment Version (Version, for short) represents all workers of the same -// code and config within a Deployment. Workers of the same Version are expected to -// behave exactly the same so when executions move between them there are no -// non-determinism issues. -// Worker Deployment Versions are created in Temporal server automatically when -// their first poller arrives to the server. -// Each Version has a Workflow Versioning Mode which is chosen by the app -// developer. (see WorkflowVersioningMode enum documentation) -message WorkerDeploymentVersionInfo { - // Identifies a Worker Deployment Version. Must be unique within the namespace. - // Same ID cannot be used in multiple Deployments. - // In some contexts, such as Reset-by-build-id, version might be used - // as "Build ID". - string version = 1; - - // Each Worker Version belongs to exactly one Deployment. - string deployment_name = 2; - - google.protobuf.Timestamp create_time = 3; - // All the Task Queues - repeated WorkerBuildTaskQueueInfo task_queue_infos = 4; - // Arbitrary user-provided metadata attached to this Build. - WorkerBuildMetadata metadata = 5; - // Aggregated status for all Task Queues being polled in this Build. - PollersStatus aggregated_pollers_status = 6; - - - message WorkerBuildTaskQueueInfo { - string name = 1; - temporal.api.enums.v1.TaskQueueType type = 2; - PollersStatus pollers_status = 3; - } -} - -message WorkerBuildMetadata { - // Arbitrary key-value pairs. - map entries = 1; -} - -// Pollers' status information. Depending on the context, this may be relevant to -// one or more Task Queues and one or more Builds. -message PollersStatus { - // True if there are active pollers for the relevant Task Queue(s) in the - // relevant Build(s). - bool has_pollers = 1; - // When server saw the first poller for (any of) the relevant Task Queue(s) in - // (any of) the relevant Build(s). - google.protobuf.Timestamp poll_start_time = 2; - // Only present if has_poller is false. This is approximate and can be off by - // a few minutes. - google.protobuf.Timestamp poll_stop_time = 3; -} diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 00788ef7..5d0bfbd5 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -61,7 +61,6 @@ import "temporal/api/batch/v1/message.proto"; import "temporal/api/sdk/v1/task_complete_metadata.proto"; import "temporal/api/sdk/v1/user_metadata.proto"; import "temporal/api/nexus/v1/message.proto"; -import "temporal/api/workerdeployment/v1/message.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; @@ -1900,7 +1899,7 @@ message DescribeWorkerDeploymentVersionRequest { } message DescribeWorkerDeploymentVersionResponse { - workerdeployment.v1.WorkerDeploymentVersionInfo worker_deployment_version_info = 1; + deployment.v1.WorkerDeploymentVersionInfo worker_deployment_version_info = 1; } // [cleanup-wv-pre-release] Pre-release deployment APIs, clean up later From df0f1400e03f23c2deecbd55d6ce825234eb1c43 Mon Sep 17 00:00:00 2001 From: Shivam Saraf Date: Wed, 15 Jan 2025 13:36:22 -0500 Subject: [PATCH 6/9] removed non-required file --- temporal/api/.idea/workspace.xml | 55 -------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 temporal/api/.idea/workspace.xml diff --git a/temporal/api/.idea/workspace.xml b/temporal/api/.idea/workspace.xml deleted file mode 100644 index c8219157..00000000 --- a/temporal/api/.idea/workspace.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - true - - \ No newline at end of file From 2cf303dbfb2f2e3396aa94faaffb06e293d01f9d Mon Sep 17 00:00:00 2001 From: Shivam Saraf Date: Thu, 16 Jan 2025 10:59:25 -0500 Subject: [PATCH 7/9] addressed comments --- openapi/openapiv2.json | 45 +----------------------- openapi/openapiv3.yaml | 35 +----------------- temporal/api/deployment/v1/message.proto | 25 +------------ 3 files changed, 3 insertions(+), 102 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index caf4a284..a6173004 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -5991,9 +5991,6 @@ }, "type": { "$ref": "#/definitions/v1TaskQueueType" - }, - "pollersStatus": { - "$ref": "#/definitions/v1PollersStatus" } } }, @@ -10656,26 +10653,6 @@ } } }, - "v1PollersStatus": { - "type": "object", - "properties": { - "hasPollers": { - "type": "boolean", - "description": "True if there are active pollers for the relevant Task Queue(s) in the \nrelevant Build(s)." - }, - "pollStartTime": { - "type": "string", - "format": "date-time", - "description": "When server saw the first poller for (any of) the relevant Task Queue(s) in \n(any of) the relevant Build(s)." - }, - "pollStopTime": { - "type": "string", - "format": "date-time", - "description": "Only present if has_poller is false. This is approximate and can be off by \na few minutes." - } - }, - "description": "Pollers' status information. Depending on the context, this may be relevant to \none or more Task Queues and one or more Builds." - }, "v1ProtocolMessageCommandAttributes": { "type": "object", "properties": { @@ -12970,18 +12947,6 @@ }, "description": "Specifies client's intent to wait for Update results." }, - "v1WorkerBuildMetadata": { - "type": "object", - "properties": { - "entries": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/v1Payload" - }, - "description": "Arbitrary key-value pairs." - } - } - }, "v1WorkerDeploymentVersionInfo": { "type": "object", "properties": { @@ -13003,15 +12968,7 @@ "type": "object", "$ref": "#/definitions/WorkerDeploymentVersionInfoWorkerBuildTaskQueueInfo" }, - "title": "All the Task Queues" - }, - "metadata": { - "$ref": "#/definitions/v1WorkerBuildMetadata", - "description": "Arbitrary user-provided metadata attached to this Build." - }, - "aggregatedPollersStatus": { - "$ref": "#/definitions/v1PollersStatus", - "description": "Aggregated status for all Task Queues being polled in this Build." + "description": "All the Task Queues that have ever polled from this Deployment version." } }, "title": "A Worker Deployment Version (Version, for short) represents all workers of the same \ncode and config within a Deployment. Workers of the same Version are expected to \nbehave exactly the same so when executions move between them there are no \nnon-determinism issues.\nWorker Deployment Versions are created in Temporal server automatically when \ntheir first poller arrives to the server.\nEach Version has a Workflow Versioning Mode which is chosen by the app\ndeveloper. (see WorkflowVersioningMode enum documentation)" diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 527667d5..94baa7d3 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -7961,21 +7961,6 @@ components: description: |- If a worker has opted into the worker versioning feature while polling, its capabilities will appear here. - PollersStatus: - type: object - properties: - hasPollers: - type: boolean - description: "True if there are active pollers for the relevant Task Queue(s) in the \n relevant Build(s)." - pollStartTime: - type: string - description: "When server saw the first poller for (any of) the relevant Task Queue(s) in \n (any of) the relevant Build(s)." - format: date-time - pollStopTime: - type: string - description: "Only present if has_poller is false. This is approximate and can be off by \n a few minutes." - format: date-time - description: "Pollers' status information. Depending on the context, this may be relevant to \n one or more Task Queues and one or more Builds." QueryRejected: type: object properties: @@ -10361,14 +10346,6 @@ components: user specified timeout, API call returns even if specified stage is not reached. format: enum description: Specifies client's intent to wait for Update results. - WorkerBuildMetadata: - type: object - properties: - entries: - type: object - additionalProperties: - $ref: '#/components/schemas/Payload' - description: Arbitrary key-value pairs. WorkerDeploymentVersionInfo: type: object properties: @@ -10389,15 +10366,7 @@ components: type: array items: $ref: '#/components/schemas/WorkerDeploymentVersionInfo_WorkerBuildTaskQueueInfo' - description: All the Task Queues - metadata: - allOf: - - $ref: '#/components/schemas/WorkerBuildMetadata' - description: Arbitrary user-provided metadata attached to this Build. - aggregatedPollersStatus: - allOf: - - $ref: '#/components/schemas/PollersStatus' - description: Aggregated status for all Task Queues being polled in this Build. + description: All the Task Queues that have ever polled from this Deployment version. description: "A Worker Deployment Version (Version, for short) represents all workers of the same \n code and config within a Deployment. Workers of the same Version are expected to \n behave exactly the same so when executions move between them there are no \n non-determinism issues.\n Worker Deployment Versions are created in Temporal server automatically when \n their first poller arrives to the server.\n Each Version has a Workflow Versioning Mode which is chosen by the app\n developer. (see WorkflowVersioningMode enum documentation)" WorkerDeploymentVersionInfo_WorkerBuildTaskQueueInfo: type: object @@ -10412,8 +10381,6 @@ components: - TASK_QUEUE_TYPE_NEXUS type: string format: enum - pollersStatus: - $ref: '#/components/schemas/PollersStatus' WorkerVersionCapabilities: type: object properties: diff --git a/temporal/api/deployment/v1/message.proto b/temporal/api/deployment/v1/message.proto index 43097dc6..8742f7d3 100644 --- a/temporal/api/deployment/v1/message.proto +++ b/temporal/api/deployment/v1/message.proto @@ -112,36 +112,13 @@ message WorkerDeploymentVersionInfo { string deployment_name = 2; google.protobuf.Timestamp create_time = 3; - // All the Task Queues + // All the Task Queues that have ever polled from this Deployment version. repeated WorkerBuildTaskQueueInfo task_queue_infos = 4; - // Arbitrary user-provided metadata attached to this Build. - WorkerBuildMetadata metadata = 5; - // Aggregated status for all Task Queues being polled in this Build. - PollersStatus aggregated_pollers_status = 6; - message WorkerBuildTaskQueueInfo { string name = 1; temporal.api.enums.v1.TaskQueueType type = 2; - PollersStatus pollers_status = 3; } } -message WorkerBuildMetadata { - // Arbitrary key-value pairs. - map entries = 1; -} -// Pollers' status information. Depending on the context, this may be relevant to -// one or more Task Queues and one or more Builds. -message PollersStatus { - // True if there are active pollers for the relevant Task Queue(s) in the - // relevant Build(s). - bool has_pollers = 1; - // When server saw the first poller for (any of) the relevant Task Queue(s) in - // (any of) the relevant Build(s). - google.protobuf.Timestamp poll_start_time = 2; - // Only present if has_poller is false. This is approximate and can be off by - // a few minutes. - google.protobuf.Timestamp poll_stop_time = 3; -} From ac8d8a6a0b18a04db69cb89fb6539149d9d00b4c Mon Sep 17 00:00:00 2001 From: Shivam <57200924+Shivs11@users.noreply.github.com> Date: Thu, 16 Jan 2025 12:16:17 -0500 Subject: [PATCH 8/9] Update temporal/api/workflowservice/v1/service.proto Co-authored-by: Shahab Tajik --- temporal/api/workflowservice/v1/service.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 841aa6d5..b5c1c7d8 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -787,7 +787,7 @@ service WorkflowService { // Describes a worker deployment version. rpc DescribeWorkerDeploymentVersion (DescribeWorkerDeploymentVersionRequest) returns (DescribeWorkerDeploymentVersionResponse) { option (google.api.http) = { - get: "/namespaces/{namespace}/worker-deployments/{version}" + get: "/namespaces/{namespace}/worker-deployments-version/{version}" additional_bindings { get: "/api/v1/namespaces/{namespace}/worker-deployments/{version}" } From 2842f130c9180736e0ea2fd91c659e2574b5fec3 Mon Sep 17 00:00:00 2001 From: Shivam Saraf Date: Thu, 16 Jan 2025 12:18:01 -0500 Subject: [PATCH 9/9] updated service.prot files --- openapi/openapiv2.json | 184 +++++++++--------- openapi/openapiv3.yaml | 148 +++++++------- temporal/api/workflowservice/v1/service.proto | 6 +- 3 files changed, 169 insertions(+), 169 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index a6173004..33e2fa09 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -868,51 +868,6 @@ ] } }, - "/api/v1/namespaces/{namespace}/current-deployment-version/{deploymentName}": { - "post": { - "summary": "Sets a deployment version as the current version for its deployment.", - "operationId": "SetCurrentDeploymentVersion2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1SetCurrentDeploymentVersionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "deploymentName", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceSetCurrentDeploymentVersionBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, "/api/v1/namespaces/{namespace}/current-deployment/{deployment.seriesName}": { "post": { "summary": "Sets a deployment as the current deployment for its deployment series. Can optionally update\nthe metadata of the deployment as well.\nExperimental. This API might significantly change or be removed in a future release.\n[cleanup-wv-pre-release]", @@ -1775,7 +1730,52 @@ ] } }, - "/api/v1/namespaces/{namespace}/worker-deployments/{version}": { + "/api/v1/namespaces/{namespace}/worker-deployment/{deploymentName}/set-current-version": { + "post": { + "summary": "Sets a deployment version as the current version for its deployment.", + "operationId": "SetCurrentDeploymentVersion2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1SetCurrentDeploymentVersionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentName", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceSetCurrentDeploymentVersionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/worker-deployments-version/{version}": { "get": { "summary": "Describes a worker deployment version.", "operationId": "DescribeWorkerDeploymentVersion2", @@ -3950,51 +3950,6 @@ ] } }, - "/namespaces/{namespace}/current-deployment-version/{deploymentName}": { - "post": { - "summary": "Sets a deployment version as the current version for its deployment.", - "operationId": "SetCurrentDeploymentVersion", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1SetCurrentDeploymentVersionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "deploymentName", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceSetCurrentDeploymentVersionBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, "/namespaces/{namespace}/current-deployment/{deployment.seriesName}": { "post": { "summary": "Sets a deployment as the current deployment for its deployment series. Can optionally update\nthe metadata of the deployment as well.\nExperimental. This API might significantly change or be removed in a future release.\n[cleanup-wv-pre-release]", @@ -4787,7 +4742,52 @@ ] } }, - "/namespaces/{namespace}/worker-deployments/{version}": { + "/namespaces/{namespace}/worker-deployment/{deploymentName}/set-current-version": { + "post": { + "summary": "Sets a deployment version as the current version for its deployment.", + "operationId": "SetCurrentDeploymentVersion", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1SetCurrentDeploymentVersionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentName", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceSetCurrentDeploymentVersionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/worker-deployments-version/{version}": { "get": { "summary": "Describes a worker deployment version.", "operationId": "DescribeWorkerDeploymentVersion", diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 94baa7d3..f047a009 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -772,42 +772,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/current-deployment-version/{deploymentName}: - post: - tags: - - WorkflowService - description: Sets a deployment version as the current version for its deployment. - operationId: SetCurrentDeploymentVersion - parameters: - - name: namespace - in: path - required: true - schema: - type: string - - name: deploymentName - in: path - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SetCurrentDeploymentVersionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/SetCurrentDeploymentVersionResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/current-deployment/{deployment.series_name}: post: tags: @@ -1569,7 +1533,43 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/worker-deployments/{version}: + /api/v1/namespaces/{namespace}/worker-deployment/{deploymentName}/set-current-version: + post: + tags: + - WorkflowService + description: Sets a deployment version as the current version for its deployment. + operationId: SetCurrentDeploymentVersion + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: deploymentName + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SetCurrentDeploymentVersionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SetCurrentDeploymentVersionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/worker-deployments-version/{version}: get: tags: - WorkflowService @@ -3506,42 +3506,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/current-deployment-version/{deploymentName}: - post: - tags: - - WorkflowService - description: Sets a deployment version as the current version for its deployment. - operationId: SetCurrentDeploymentVersion - parameters: - - name: namespace - in: path - required: true - schema: - type: string - - name: deploymentName - in: path - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SetCurrentDeploymentVersionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/SetCurrentDeploymentVersionResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' /namespaces/{namespace}/current-deployment/{deployment.series_name}: post: tags: @@ -4245,7 +4209,43 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/worker-deployments/{version}: + /namespaces/{namespace}/worker-deployment/{deploymentName}/set-current-version: + post: + tags: + - WorkflowService + description: Sets a deployment version as the current version for its deployment. + operationId: SetCurrentDeploymentVersion + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: deploymentName + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SetCurrentDeploymentVersionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SetCurrentDeploymentVersionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/worker-deployments-version/{version}: get: tags: - WorkflowService diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index b5c1c7d8..5427000f 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -789,7 +789,7 @@ service WorkflowService { option (google.api.http) = { get: "/namespaces/{namespace}/worker-deployments-version/{version}" additional_bindings { - get: "/api/v1/namespaces/{namespace}/worker-deployments/{version}" + get: "/api/v1/namespaces/{namespace}/worker-deployments-version/{version}" } }; } @@ -854,10 +854,10 @@ service WorkflowService { // Sets a deployment version as the current version for its deployment. rpc SetCurrentDeploymentVersion (SetCurrentDeploymentVersionRequest) returns (SetCurrentDeploymentVersionResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/current-deployment-version/{deployment_name}" + post: "/namespaces/{namespace}/worker-deployment/{deployment_name}/set-current-version" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/current-deployment-version/{deployment_name}" + post: "/api/v1/namespaces/{namespace}/worker-deployment/{deployment_name}/set-current-version" body: "*" } };