diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index bb205be6d..4f5c2cf0d 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -870,6 +870,105 @@ ] } }, + "/api/v1/namespaces/{namespace}/callbacks/{callbackToken}/result": { + "get": { + "operationId": "FetchCallbackResult2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1FetchCallbackResultResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "The namespace that invoked the callback.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "callbackToken", + "description": "The token referencing this callback as originally generated by the server.", + "in": "path", + "required": true, + "type": "string", + "format": "byte" + }, + { + "name": "identity", + "description": "The identity of the client who initiated this request.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "wait", + "description": "If true, the caller has indicated that it wants to wait for callback completion, turning the request\ninto a long poll. The server will wait the minimum duration from among the callback timeout, the request context\ndeadline, and the servers configured maximum long poll request timeout.", + "in": "query", + "required": false, + "type": "boolean" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/callbacks/{callbackToken}/terminate": { + "post": { + "operationId": "TerminateCallback2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1TerminateCallbackResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "The namespace that invoked the callback.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "callbackToken", + "description": "The token referencing this callback as originally generated by the server.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceTerminateCallbackBody" + } + } + ], + "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.\nDeprecated. Replaced by `SetWorkerDeploymentCurrentVersion`.", @@ -1095,6 +1194,112 @@ ] } }, + "/api/v1/namespaces/{namespace}/nexus/operations/{callerOperationRef.operationRef}/result": { + "get": { + "summary": "Retrieve the result of a Nexus operation. Optionally specify a wait period to turn this request into a long poll.", + "operationId": "FetchNexusOperationResult2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1FetchNexusOperationResultResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "The caller namespace.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "callerOperationRef.operationRef", + "description": "operation_ref is a business ID which can be used to reference durable Nexus operations within the caller namespace.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "identity", + "description": "The identity of the client who initiated this request.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "callerOperationRef.runId", + "description": "run_id is a UUID referring to a specific execution of the operation. Optional. Defaults to latest run.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "wait", + "description": "If true, the caller has indicated that it wants to wait for operation completion, turning the request into a long poll.\nThe server will wait the minimum duration from among the operation timeout, the request context deadline, and the\nservers configured maximum long poll request timeout.", + "in": "query", + "required": false, + "type": "boolean" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/nexus/operations/{callerOperationRef.operationRef}/terminate": { + "post": { + "operationId": "TerminateNexusOperation2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1TerminateNexusOperationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "The caller namespace.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "callerOperationRef.operationRef", + "description": "operation_ref is a business ID which can be used to reference durable Nexus operations within the caller namespace.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceTerminateNexusOperationBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/schedules": { "get": { "summary": "List all schedules in a namespace.", @@ -4765,6 +4970,105 @@ ] } }, + "/namespaces/{namespace}/callbacks/{callbackToken}/result": { + "get": { + "operationId": "FetchCallbackResult", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1FetchCallbackResultResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "The namespace that invoked the callback.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "callbackToken", + "description": "The token referencing this callback as originally generated by the server.", + "in": "path", + "required": true, + "type": "string", + "format": "byte" + }, + { + "name": "identity", + "description": "The identity of the client who initiated this request.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "wait", + "description": "If true, the caller has indicated that it wants to wait for callback completion, turning the request\ninto a long poll. The server will wait the minimum duration from among the callback timeout, the request context\ndeadline, and the servers configured maximum long poll request timeout.", + "in": "query", + "required": false, + "type": "boolean" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/callbacks/{callbackToken}/terminate": { + "post": { + "operationId": "TerminateCallback", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1TerminateCallbackResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "The namespace that invoked the callback.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "callbackToken", + "description": "The token referencing this callback as originally generated by the server.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceTerminateCallbackBody" + } + } + ], + "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.\nDeprecated. Replaced by `SetWorkerDeploymentCurrentVersion`.", @@ -4990,6 +5294,112 @@ ] } }, + "/namespaces/{namespace}/nexus/operations/{callerOperationRef.operationRef}/result": { + "get": { + "summary": "Retrieve the result of a Nexus operation. Optionally specify a wait period to turn this request into a long poll.", + "operationId": "FetchNexusOperationResult", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1FetchNexusOperationResultResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "The caller namespace.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "callerOperationRef.operationRef", + "description": "operation_ref is a business ID which can be used to reference durable Nexus operations within the caller namespace.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "identity", + "description": "The identity of the client who initiated this request.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "callerOperationRef.runId", + "description": "run_id is a UUID referring to a specific execution of the operation. Optional. Defaults to latest run.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "wait", + "description": "If true, the caller has indicated that it wants to wait for operation completion, turning the request into a long poll.\nThe server will wait the minimum duration from among the operation timeout, the request context deadline, and the\nservers configured maximum long poll request timeout.", + "in": "query", + "required": false, + "type": "boolean" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/nexus/operations/{callerOperationRef.operationRef}/terminate": { + "post": { + "operationId": "TerminateNexusOperation", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1TerminateNexusOperationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "The caller namespace.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "callerOperationRef.operationRef", + "description": "operation_ref is a business ID which can be used to reference durable Nexus operations within the caller namespace.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceTerminateNexusOperationBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/schedules": { "get": { "summary": "List all schedules in a namespace.", @@ -8862,6 +9272,59 @@ } } }, + "WorkflowServiceTerminateCallbackBody": { + "type": "object", + "properties": { + "identity": { + "type": "string", + "description": "The identity of the client who initiated this request." + }, + "requestId": { + "type": "string", + "description": "A UUID used to deduplicate client requests." + }, + "reason": { + "type": "string", + "description": "An optional reason for terminating this Callback." + }, + "details": { + "$ref": "#/definitions/v1Payloads", + "description": "Serialized additional information to attach to the termination." + } + } + }, + "WorkflowServiceTerminateNexusOperationBody": { + "type": "object", + "properties": { + "identity": { + "type": "string", + "description": "The identity of the client who initiated this request." + }, + "requestId": { + "type": "string", + "description": "A UUID used for deduplicating client retries. The request ID sent to the operation handler will be different." + }, + "callerOperationRef": { + "type": "object", + "properties": { + "runId": { + "type": "string", + "description": "run_id is a UUID referring to a specific execution of the operation. Optional. Defaults to latest run." + } + }, + "description": "Caller operation reference as returned in the StartNexusOperationResponse. `run_id` is optional and defaults to latest run.", + "title": "Caller operation reference as returned in the StartNexusOperationResponse. `run_id` is optional and defaults to latest run." + }, + "reason": { + "type": "string", + "description": "An optional reason for terminating this operation." + }, + "details": { + "$ref": "#/definitions/v1Payloads", + "description": "Serialized additional information to attach to the termination." + } + } + }, "WorkflowServiceTerminateWorkflowExecutionBody": { "type": "object", "properties": { @@ -10184,6 +10647,20 @@ "default": "CALLBACK_STATE_UNSPECIFIED", "description": "State of a callback.\n\n - CALLBACK_STATE_UNSPECIFIED: Default value, unspecified state.\n - CALLBACK_STATE_STANDBY: Callback is standing by, waiting to be triggered.\n - CALLBACK_STATE_SCHEDULED: Callback is in the queue waiting to be executed or is currently executing.\n - CALLBACK_STATE_BACKING_OFF: Callback has failed with a retryable error and is backing off before the next attempt.\n - CALLBACK_STATE_FAILED: Callback has failed.\n - CALLBACK_STATE_SUCCEEDED: Callback has succeeded.\n - CALLBACK_STATE_BLOCKED: Callback is blocked (eg: by circuit breaker)." }, + "v1CallerOperationReference": { + "type": "object", + "properties": { + "operationRef": { + "type": "string", + "description": "operation_ref is a business ID which can be used to reference durable Nexus operations within the caller namespace." + }, + "runId": { + "type": "string", + "description": "run_id is a UUID referring to a specific execution of the operation. Optional. Defaults to latest run." + } + }, + "description": "Identifies a specific Nexus operation in the caller (i.e. initiating) namespace ONLY. This reference is NOT sent to\nthe operation handler which may be in a different namespace. Because run_id is a UUID, a caller operation reference\nis unique within the calling namespace." + }, "v1CancelExternalWorkflowExecutionFailedCause": { "type": "string", "enum": [ @@ -10608,6 +11085,9 @@ }, "description": "Used by the worker versioning APIs, represents an unordered set of one or more versions which are\nconsidered to be compatible with each other. Currently the versions are always worker build IDs." }, + "v1CompleteNexusOperationResponse": { + "type": "object" + }, "v1CompleteWorkflowExecutionCommandAttributes": { "type": "object", "properties": { @@ -10773,6 +11253,10 @@ } } }, + "v1DeleteCallbackResponse": { + "type": "object", + "description": "If this response is returned, the server successfully processed the deletion request." + }, "v1DeleteNamespaceResponse": { "type": "object", "properties": { @@ -10785,6 +11269,10 @@ "v1DeleteNexusEndpointResponse": { "type": "object" }, + "v1DeleteNexusOperationResponse": { + "type": "object", + "description": "If this response is returned, the deletion request was successfully processed by the caller server." + }, "v1DeleteScheduleResponse": { "type": "object" }, @@ -11388,6 +11876,73 @@ }, "title": "Represents a historical replication status of a Namespace" }, + "v1FetchCallbackResultResponse": { + "type": "object", + "properties": { + "successful": { + "$ref": "#/definitions/v1FetchCallbackResultResponseSuccessful", + "description": "The callback has finished successfully." + }, + "unsuccessful": { + "$ref": "#/definitions/v1FetchCallbackResultResponseUnsuccessful", + "description": "The callback has finished unsuccessfully." + }, + "stillRunning": { + "$ref": "#/definitions/v1FetchCallbackResultResponseStillRunning", + "description": "The operation is still running, When waiting for completion, the caller may re-issue this request to start a\nnew long poll." + } + } + }, + "v1FetchCallbackResultResponseStillRunning": { + "type": "object" + }, + "v1FetchCallbackResultResponseSuccessful": { + "type": "object" + }, + "v1FetchCallbackResultResponseUnsuccessful": { + "type": "object", + "properties": { + "failure": { + "$ref": "#/definitions/apifailurev1Failure" + } + } + }, + "v1FetchNexusOperationResultResponse": { + "type": "object", + "properties": { + "successful": { + "$ref": "#/definitions/v1FetchNexusOperationResultResponseSuccessful", + "description": "The operation has finished successfully." + }, + "unsuccessful": { + "$ref": "#/definitions/v1FetchNexusOperationResultResponseUnsuccessful", + "description": "The operation has finished unsuccessfully." + }, + "stillRunning": { + "$ref": "#/definitions/v1FetchNexusOperationResultResponseStillRunning", + "description": "The operation is still running, When waiting for completion, the caller may re-issue this request to start a\nnew long poll." + } + } + }, + "v1FetchNexusOperationResultResponseStillRunning": { + "type": "object" + }, + "v1FetchNexusOperationResultResponseSuccessful": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/v1Payload" + } + } + }, + "v1FetchNexusOperationResultResponseUnsuccessful": { + "type": "object", + "properties": { + "operationError": { + "$ref": "#/definitions/v1UnsuccessfulOperationError" + } + } + }, "v1FetchWorkerConfigResponse": { "type": "object", "properties": { @@ -12509,6 +13064,17 @@ }, "description": "NewWorkflowExecutionInfo is a shared message that encapsulates all the\nrequired arguments to starting a workflow in different contexts." }, + "v1NexusCallerOperationRefReusePolicy": { + "type": "string", + "enum": [ + "NEXUS_CALLER_OPERATION_REF_REUSE_POLICY_UNSPECIFIED", + "NEXUS_CALLER_OPERATION_REF_REUSE_POLICY_ALLOW_DUPLICATE", + "NEXUS_CALLER_OPERATION_REF_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY", + "NEXUS_CALLER_OPERATION_REF_REUSE_POLICY_REJECT_DUPLICATE" + ], + "default": "NEXUS_CALLER_OPERATION_REF_REUSE_POLICY_UNSPECIFIED", + "description": "Defines whether to allow re-using a caller operation ref from a previously *completed* Nexus operation.\nIf the request is denied, the server returns a `NexusOperationAlreadyStartedFailure` error.\n\nSee `NexusCallerOperationRefConflictPolicy` for handling caller operation ref duplication with a *running* operation.\n\n - NEXUS_CALLER_OPERATION_REF_REUSE_POLICY_ALLOW_DUPLICATE: Allow starting an operation using the same caller operation reference.\n - NEXUS_CALLER_OPERATION_REF_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY: Allow starting an operation using the same caller operation ref, only when the last\noperation's final state is one of [terminated, cancelled, timed out, failed].\n - NEXUS_CALLER_OPERATION_REF_REUSE_POLICY_REJECT_DUPLICATE: Do not permit re-use of the caller operation ref for this operation. Future start operation requests\ncould potentially change the policy, allowing re-use of the caller operation ref." + }, "v1NexusHandlerErrorRetryBehavior": { "type": "string", "enum": [ @@ -13780,6 +14346,10 @@ } } }, + "v1RequestCancelNexusOperationResponse": { + "type": "object", + "description": "If this response is returned, the cancellation request was successfully recorded in the caller namespace for this\noperation and the server guarantees the cancellation request will be delivered to the operation handler. The\noperation handler may ignore the cancellation request and the operation may end up in any terminal state." + }, "v1RequestCancelWorkflowExecutionResponse": { "type": "object" }, @@ -14958,6 +15528,15 @@ } } }, + "v1StartNexusOperationResponse": { + "type": "object", + "properties": { + "callerOperationRef": { + "$ref": "#/definitions/v1CallerOperationReference", + "description": "An operation ref which can be used to reference this operation in the caller namespace." + } + } + }, "v1StartOperationRequest": { "type": "object", "properties": { @@ -15529,6 +16108,14 @@ "default": "TASK_REACHABILITY_UNSPECIFIED", "description": "Specifies which category of tasks may reach a worker on a versioned task queue.\nUsed both in a reachability query and its response.\nDeprecated.\n\n - TASK_REACHABILITY_NEW_WORKFLOWS: There's a possiblity for a worker to receive new workflow tasks. Workers should *not* be retired.\n - TASK_REACHABILITY_EXISTING_WORKFLOWS: There's a possiblity for a worker to receive existing workflow and activity tasks from existing workflows. Workers\nshould *not* be retired.\nThis enum value does not distinguish between open and closed workflows.\n - TASK_REACHABILITY_OPEN_WORKFLOWS: There's a possiblity for a worker to receive existing workflow and activity tasks from open workflows. Workers\nshould *not* be retired.\n - TASK_REACHABILITY_CLOSED_WORKFLOWS: There's a possiblity for a worker to receive existing workflow tasks from closed workflows. Workers may be\nretired dependending on application requirements. For example, if there's no need to query closed workflows." }, + "v1TerminateCallbackResponse": { + "type": "object", + "description": "If this response is returned, the server successfully processed the termination request and no more attempts to\ndeliver the callback will be made." + }, + "v1TerminateNexusOperationResponse": { + "type": "object", + "description": "If this response is returned, the termination request was successfully processed by the caller server.\nThe server will propagate a cancellation request to the operation handler. Regardless of whether the handler\nrespects that cancellation request, the caller server will record the operation as Terminated and will\nignore any future completion requests." + }, "v1TerminateWorkflowExecutionResponse": { "type": "object" }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 9fc0ffb40..8daaed39e 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -776,6 +776,88 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/callbacks/{callbackToken}/result: + get: + tags: + - WorkflowService + operationId: FetchCallbackResult + parameters: + - name: namespace + in: path + description: The namespace that invoked the callback. + required: true + schema: + type: string + - name: callbackToken + in: path + description: The token referencing this callback as originally generated by the server. + required: true + schema: + type: string + format: bytes + - name: identity + in: query + description: The identity of the client who initiated this request. + schema: + type: string + - name: wait + in: query + description: |- + If true, the caller has indicated that it wants to wait for callback completion, turning the request + into a long poll. The server will wait the minimum duration from among the callback timeout, the request context + deadline, and the servers configured maximum long poll request timeout. + schema: + type: boolean + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/FetchCallbackResultResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/callbacks/{callbackToken}/terminate: + post: + tags: + - WorkflowService + operationId: TerminateCallback + parameters: + - name: namespace + in: path + description: The namespace that invoked the callback. + required: true + schema: + type: string + - name: callbackToken + in: path + description: The token referencing this callback as originally generated by the server. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TerminateCallbackRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/TerminateCallbackResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/current-deployment/{deployment.series_name}: post: tags: @@ -1008,6 +1090,96 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/nexus/operations/{caller_operation_ref.operation_ref}/result: + get: + tags: + - WorkflowService + description: Retrieve the result of a Nexus operation. Optionally specify a wait period to turn this request into a long poll. + operationId: FetchNexusOperationResult + parameters: + - name: namespace + in: path + description: The caller namespace. + required: true + schema: + type: string + - name: caller_operation_ref.operation_ref + in: path + required: true + schema: + type: string + - name: identity + in: query + description: The identity of the client who initiated this request. + schema: + type: string + - name: callerOperationRef.operationRef + in: query + description: operation_ref is a business ID which can be used to reference durable Nexus operations within the caller namespace. + schema: + type: string + - name: callerOperationRef.runId + in: query + description: run_id is a UUID referring to a specific execution of the operation. Optional. Defaults to latest run. + schema: + type: string + - name: wait + in: query + description: |- + If true, the caller has indicated that it wants to wait for operation completion, turning the request into a long poll. + The server will wait the minimum duration from among the operation timeout, the request context deadline, and the + servers configured maximum long poll request timeout. + schema: + type: boolean + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/FetchNexusOperationResultResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/nexus/operations/{caller_operation_ref.operation_ref}/terminate: + post: + tags: + - WorkflowService + operationId: TerminateNexusOperation + parameters: + - name: namespace + in: path + description: The caller namespace. + required: true + schema: + type: string + - name: caller_operation_ref.operation_ref + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TerminateNexusOperationRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/TerminateNexusOperationResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/schedules: get: tags: @@ -4258,6 +4430,88 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/callbacks/{callbackToken}/result: + get: + tags: + - WorkflowService + operationId: FetchCallbackResult + parameters: + - name: namespace + in: path + description: The namespace that invoked the callback. + required: true + schema: + type: string + - name: callbackToken + in: path + description: The token referencing this callback as originally generated by the server. + required: true + schema: + type: string + format: bytes + - name: identity + in: query + description: The identity of the client who initiated this request. + schema: + type: string + - name: wait + in: query + description: |- + If true, the caller has indicated that it wants to wait for callback completion, turning the request + into a long poll. The server will wait the minimum duration from among the callback timeout, the request context + deadline, and the servers configured maximum long poll request timeout. + schema: + type: boolean + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/FetchCallbackResultResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/callbacks/{callbackToken}/terminate: + post: + tags: + - WorkflowService + operationId: TerminateCallback + parameters: + - name: namespace + in: path + description: The namespace that invoked the callback. + required: true + schema: + type: string + - name: callbackToken + in: path + description: The token referencing this callback as originally generated by the server. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TerminateCallbackRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/TerminateCallbackResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/current-deployment/{deployment.series_name}: post: tags: @@ -4490,6 +4744,96 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/nexus/operations/{caller_operation_ref.operation_ref}/result: + get: + tags: + - WorkflowService + description: Retrieve the result of a Nexus operation. Optionally specify a wait period to turn this request into a long poll. + operationId: FetchNexusOperationResult + parameters: + - name: namespace + in: path + description: The caller namespace. + required: true + schema: + type: string + - name: caller_operation_ref.operation_ref + in: path + required: true + schema: + type: string + - name: identity + in: query + description: The identity of the client who initiated this request. + schema: + type: string + - name: callerOperationRef.operationRef + in: query + description: operation_ref is a business ID which can be used to reference durable Nexus operations within the caller namespace. + schema: + type: string + - name: callerOperationRef.runId + in: query + description: run_id is a UUID referring to a specific execution of the operation. Optional. Defaults to latest run. + schema: + type: string + - name: wait + in: query + description: |- + If true, the caller has indicated that it wants to wait for operation completion, turning the request into a long poll. + The server will wait the minimum duration from among the operation timeout, the request context deadline, and the + servers configured maximum long poll request timeout. + schema: + type: boolean + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/FetchNexusOperationResultResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/nexus/operations/{caller_operation_ref.operation_ref}/terminate: + post: + tags: + - WorkflowService + operationId: TerminateNexusOperation + parameters: + - name: namespace + in: path + description: The caller namespace. + required: true + schema: + type: string + - name: caller_operation_ref.operation_ref + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TerminateNexusOperationRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/TerminateNexusOperationResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/schedules: get: tags: @@ -7342,6 +7686,19 @@ components: additionalProperties: type: string description: Header to attach to callback request. + CallerOperationReference: + type: object + properties: + operationRef: + type: string + description: operation_ref is a business ID which can be used to reference durable Nexus operations within the caller namespace. + runId: + type: string + description: run_id is a UUID referring to a specific execution of the operation. Optional. Defaults to latest run. + description: |- + Identifies a specific Nexus operation in the caller (i.e. initiating) namespace ONLY. This reference is NOT sent to + the operation handler which may be in a different namespace. Because run_id is a UUID, a caller operation reference + is unique within the calling namespace. CanceledFailureInfo: type: object properties: @@ -8343,6 +8700,64 @@ components: $ref: '#/components/schemas/NexusOperationFailureInfo' nexusHandlerFailureInfo: $ref: '#/components/schemas/NexusHandlerFailureInfo' + FetchCallbackResultResponse: + type: object + properties: + successful: + allOf: + - $ref: '#/components/schemas/FetchCallbackResultResponse_Successful' + description: The callback has finished successfully. + unsuccessful: + allOf: + - $ref: '#/components/schemas/FetchCallbackResultResponse_Unsuccessful' + description: The callback has finished unsuccessfully. + stillRunning: + allOf: + - $ref: '#/components/schemas/FetchCallbackResultResponse_StillRunning' + description: |- + The operation is still running, When waiting for completion, the caller may re-issue this request to start a + new long poll. + FetchCallbackResultResponse_StillRunning: + type: object + properties: {} + FetchCallbackResultResponse_Successful: + type: object + properties: {} + FetchCallbackResultResponse_Unsuccessful: + type: object + properties: + failure: + $ref: '#/components/schemas/Failure' + FetchNexusOperationResultResponse: + type: object + properties: + successful: + allOf: + - $ref: '#/components/schemas/FetchNexusOperationResultResponse_Successful' + description: The operation has finished successfully. + unsuccessful: + allOf: + - $ref: '#/components/schemas/FetchNexusOperationResultResponse_Unsuccessful' + description: The operation has finished unsuccessfully. + stillRunning: + allOf: + - $ref: '#/components/schemas/FetchNexusOperationResultResponse_StillRunning' + description: |- + The operation is still running, When waiting for completion, the caller may re-issue this request to start a + new long poll. + FetchNexusOperationResultResponse_StillRunning: + type: object + properties: {} + FetchNexusOperationResultResponse_Successful: + type: object + properties: + result: + $ref: '#/components/schemas/Payload' + FetchNexusOperationResultResponse_Unsuccessful: + type: object + properties: + operationError: + $ref: '#/components/schemas/UnsuccessfulOperationError' FetchWorkerConfigRequest: type: object properties: @@ -12520,6 +12935,65 @@ components: description: Last time versioning information of this Task Queue changed. format: date-time description: Experimental. Worker Deployments are experimental and might significantly change in the future. + TerminateCallbackRequest: + type: object + properties: + identity: + type: string + description: The identity of the client who initiated this request. + namespace: + type: string + description: The namespace that invoked the callback. + requestId: + type: string + description: A UUID used to deduplicate client requests. + callbackToken: + type: string + description: The token referencing this callback as originally generated by the server. + reason: + type: string + description: An optional reason for terminating this Callback. + details: + allOf: + - $ref: '#/components/schemas/Payloads' + description: Serialized additional information to attach to the termination. + TerminateCallbackResponse: + type: object + properties: {} + description: |- + If this response is returned, the server successfully processed the termination request and no more attempts to + deliver the callback will be made. + TerminateNexusOperationRequest: + type: object + properties: + identity: + type: string + description: The identity of the client who initiated this request. + namespace: + type: string + description: The caller namespace. + requestId: + type: string + description: A UUID used for deduplicating client retries. The request ID sent to the operation handler will be different. + callerOperationRef: + allOf: + - $ref: '#/components/schemas/CallerOperationReference' + description: Caller operation reference as returned in the StartNexusOperationResponse. `run_id` is optional and defaults to latest run. + reason: + type: string + description: An optional reason for terminating this operation. + details: + allOf: + - $ref: '#/components/schemas/Payloads' + description: Serialized additional information to attach to the termination. + TerminateNexusOperationResponse: + type: object + properties: {} + description: |- + If this response is returned, the termination request was successfully processed by the caller server. + The server will propagate a cancellation request to the operation handler. Regardless of whether the handler + respects that cancellation request, the caller server will record the operation as Terminated and will + ignore any future completion requests. TerminateWorkflowExecutionRequest: type: object properties: @@ -12704,6 +13178,14 @@ components: UnpauseActivityResponse: type: object properties: {} + UnsuccessfulOperationError: + type: object + properties: + operationState: + type: string + description: See https://github.com/nexus-rpc/api/blob/main/SPEC.md#operationinfo. + failure: + $ref: '#/components/schemas/Failure' UpdateActivityOptionsRequest: type: object properties: diff --git a/temporal/api/enums/v1/nexus.proto b/temporal/api/enums/v1/nexus.proto index 3a3087716..0822b76c7 100644 --- a/temporal/api/enums/v1/nexus.proto +++ b/temporal/api/enums/v1/nexus.proto @@ -20,3 +20,32 @@ enum NexusHandlerErrorRetryBehavior { NEXUS_HANDLER_ERROR_RETRY_BEHAVIOR_NON_RETRYABLE = 2; } +// Defines whether to allow re-using a caller operation ref from a previously *completed* Nexus operation. +// If the request is denied, the server returns a `NexusOperationAlreadyStartedFailure` error. +// +// See `NexusCallerOperationRefConflictPolicy` for handling caller operation ref duplication with a *running* operation. +enum NexusCallerOperationRefReusePolicy { + NEXUS_CALLER_OPERATION_REF_REUSE_POLICY_UNSPECIFIED = 0; + // Allow starting an operation using the same caller operation reference. + NEXUS_CALLER_OPERATION_REF_REUSE_POLICY_ALLOW_DUPLICATE = 1; + // Allow starting an operation using the same caller operation ref, only when the last + // operation's final state is one of [terminated, cancelled, timed out, failed]. + NEXUS_CALLER_OPERATION_REF_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY = 2; + // Do not permit re-use of the caller operation ref for this operation. Future start operation requests + // could potentially change the policy, allowing re-use of the caller operation ref. + NEXUS_CALLER_OPERATION_REF_REUSE_POLICY_REJECT_DUPLICATE = 3; +} + +// Defines what to do when trying to start a Nexus operation with the same caller operation ref as a *running* operation. +// Note that it is *never* valid to have two actively running instances of the same caller operation ref. +// +// See `NexusCallerOperationRefReusePolicy` for handling operation ref duplication with a *completed* operation. +enum NexusCallerOperationRefConflictPolicy { + NEXUS_CALLER_OPERATION_REF_CONFLICT_POLICY_UNSPECIFIED = 0; + // Don't start a new operation; instead return `NexusOperationAlreadyStartedFailure`. + NEXUS_CALLER_OPERATION_REF_CONFLICT_POLICY_FAIL = 1; + // Don't start a new operation; instead return an operation handle for the running operation. + NEXUS_CALLER_OPERATION_REF_CONFLICT_POLICY_USE_EXISTING = 2; + // Terminate the running operation before starting a new one. + NEXUS_CALLER_OPERATION_REF_CONFLICT_POLICY_TERMINATE_EXISTING = 3; +} diff --git a/temporal/api/nexus/v1/message.proto b/temporal/api/nexus/v1/message.proto index bfad6102a..b3eb0d45a 100644 --- a/temporal/api/nexus/v1/message.proto +++ b/temporal/api/nexus/v1/message.proto @@ -198,3 +198,13 @@ message EndpointTarget { External external = 2; } } + +// Identifies a specific Nexus operation in the caller (i.e. initiating) namespace ONLY. This reference is NOT sent to +// the operation handler which may be in a different namespace. Because run_id is a UUID, a caller operation reference +// is unique within the calling namespace. +message CallerOperationReference { + // operation_ref is a business ID which can be used to reference durable Nexus operations within the caller namespace. + string operation_ref = 1; + // run_id is a UUID referring to a specific execution of the operation. Optional. Defaults to latest run. + string run_id = 2; +} diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index e2e05d3d9..3a5266eac 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -13,6 +13,7 @@ import "temporal/api/enums/v1/batch_operation.proto"; import "temporal/api/enums/v1/common.proto"; import "temporal/api/enums/v1/workflow.proto"; import "temporal/api/enums/v1/namespace.proto"; +import "temporal/api/enums/v1/nexus.proto"; import "temporal/api/enums/v1/failed_cause.proto"; import "temporal/api/enums/v1/query.proto"; import "temporal/api/enums/v1/reset.proto"; @@ -1112,7 +1113,7 @@ message DescribeTaskQueueResponse { temporal.api.taskqueue.v1.TaskQueueVersioningInfo versioning_info = 4; // Only populated if report_task_queue_config is set to true. - temporal.api.taskqueue.v1.TaskQueueConfig config = 6; + temporal.api.taskqueue.v1.TaskQueueConfig config = 6; message EffectiveRateLimit { // The effective rate limit for the task queue. @@ -1144,7 +1145,7 @@ message GetClusterInfoRequest { message GetClusterInfoResponse { // Key is client name i.e "temporal-go", "temporal-java", or "temporal-cli". // Value is ranges of supported versions of this client i.e ">1.1.1 <=1.4.0 || ^5.0.0". - map supported_clients = 1; + map supported_clients = 1; string server_version = 2; string cluster_id = 3; temporal.api.version.v1.VersionInfo version_info = 4; @@ -2321,12 +2322,12 @@ message SetWorkerDeploymentManagerRequest { string deployment_name = 2; oneof new_manager_identity { - // Arbitrary value for `manager_identity`. - // Empty will unset the field. - string manager_identity = 3; + // Arbitrary value for `manager_identity`. + // Empty will unset the field. + string manager_identity = 3; - // True will set `manager_identity` to `identity`. - bool self = 4; + // True will set `manager_identity` to `identity`. + bool self = 4; } // Optional. This can be the value of conflict_token from a Describe, or another Worker @@ -2595,3 +2596,266 @@ message DescribeWorkerRequest { message DescribeWorkerResponse { temporal.api.worker.v1.WorkerInfo worker_info = 1; } + +message StartNexusOperationRequest { + // The identity of the client who initiated this request. + string identity = 1; + // The caller namespace. The endpoint below may point to a different namespace. + string namespace = 2; + + // A registered endpoint name. Indicates where the requests affecting this operation should be routed. + string endpoint = 3; + // Service name. + string service = 4; + // Operation name. + string operation = 5; + + // Input to the operation. + temporal.api.common.v1.Payload payload = 6; + // Request headers to forward to the operation Handler. + map header = 7; + + // A UUID used for deduplicating client retries. The request ID sent to the operation handler will be different. + string request_id = 8; + // An optional reference for addressing this durable operation in the caller namespace. If unset, request_id will be used. + // NB: This is for the CALLER namespace ONLY. This reference is not passed to the operation handler. + temporal.api.nexus.v1.CallerOperationReference operation_ref = 9; + + // Defines whether to allow re-using the caller operation ref from a previously *completed* operation. + // The default policy is NEXUS_CALLER_OPERATION_REF_REUSE_POLICY_ALLOW_DUPLICATE. + // See `operation_ref_conflict_policy` for handling a caller operation ref duplication with a *running* operation. + temporal.api.enums.v1.NexusCallerOperationRefReusePolicy operation_ref_reuse_policy = 10; + // Defines how to resolve a caller operation ref conflict with a *running* operation. + // The default policy is NEXUS_CALLER_OPERATION_REF_CONFLICT_POLICY_FAIL. + // See `operation_ref_reuse_policy` for handling a caller operation ref duplication with a *completed* operation. + temporal.api.enums.v1.WorkflowIdConflictPolicy operation_ref_conflict_policy = 11; + + // Total time for the operation to complete. + google.protobuf.Duration operation_timeout = 12; + // The retry policy for the start operation request. Will never exceed `operation_timeout`. + temporal.api.common.v1.RetryPolicy retry_policy = 13; + + // Callback URL to call upon completion if the started operation is async. + string callback_url = 14; + // Serialized object containing information about how to route the callback and metadata to send with it. + bytes callback_context = 15; + + // Links contain caller information and can be attached to the operations started by the handler. + repeated temporal.api.nexus.v1.Link links = 16; +} + +message StartNexusOperationResponse { + // An operation ref which can be used to reference this operation in the caller namespace. + temporal.api.nexus.v1.CallerOperationReference caller_operation_ref = 1; +} + +message RequestCancelNexusOperationRequest { + // The identity of the client who initiated this request. + string identity = 1; + // The caller namespace. + string namespace = 2; + + // A UUID used for deduplicating client retries. The request ID sent to the operation handler will be different. + string request_id = 3; + // Caller operation reference as returned in the StartNexusOperationResponse. `run_id` is optional and defaults to latest run. + temporal.api.nexus.v1.CallerOperationReference caller_operation_ref = 4; + + // The retry policy for the cancellation request. Will never exceed the original `operation_timeout`. + temporal.api.common.v1.RetryPolicy retry_policy = 5; + + // Request headers to forward to the operation handler. + map header = 6; + // Links to be associated with the cancellation in the handler namespace. + repeated temporal.api.nexus.v1.Link links = 7; +} + +// If this response is returned, the cancellation request was successfully recorded in the caller namespace for this +// operation and the server guarantees the cancellation request will be delivered to the operation handler. The +// operation handler may ignore the cancellation request and the operation may end up in any terminal state. +message RequestCancelNexusOperationResponse { +} + +message FetchNexusOperationResultRequest { + // The identity of the client who initiated this request. + string identity = 1; + // The caller namespace. + string namespace = 2; + + // Caller operation reference as returned in the StartNexusOperationResponse. `run_id` is optional and defaults to latest run. + temporal.api.nexus.v1.CallerOperationReference caller_operation_ref = 3; + + // If true, the caller has indicated that it wants to wait for operation completion, turning the request into a long poll. + // The server will wait the minimum duration from among the operation timeout, the request context deadline, and the + // servers configured maximum long poll request timeout. + bool wait = 4; +} + +message FetchNexusOperationResultResponse { + message Successful { + temporal.api.common.v1.Payload result = 1; + } + + message Unsuccessful { + temporal.api.nexus.v1.UnsuccessfulOperationError operation_error = 1; + } + + message StillRunning { + } + + oneof variant { + // The operation has finished successfully. + Successful successful = 1; + // The operation has finished unsuccessfully. + Unsuccessful unsuccessful = 2; + // The operation is still running, When waiting for completion, the caller may re-issue this request to start a + // new long poll. + StillRunning still_running = 3; + } +} + +message TerminateNexusOperationRequest { + // The identity of the client who initiated this request. + string identity = 1; + // The caller namespace. + string namespace = 2; + + // A UUID used for deduplicating client retries. The request ID sent to the operation handler will be different. + string request_id = 3; + // Caller operation reference as returned in the StartNexusOperationResponse. `run_id` is optional and defaults to latest run. + temporal.api.nexus.v1.CallerOperationReference caller_operation_ref = 4; + + // An optional reason for terminating this operation. + string reason = 5; + // Serialized additional information to attach to the termination. + temporal.api.common.v1.Payloads details = 6; +} + +// If this response is returned, the termination request was successfully processed by the caller server. +// The server will propagate a cancellation request to the operation handler. Regardless of whether the handler +// respects that cancellation request, the caller server will record the operation as Terminated and will +// ignore any future completion requests. +message TerminateNexusOperationResponse { +} + +message DeleteNexusOperationRequest { + // The identity of the client who initiated this request. + string identity = 1; + // The caller namespace. + string namespace = 2; + + // A UUID used for deduplicating client retries. The request ID sent to the operation handler will be different. + string request_id = 3; + // Caller operation reference as returned in the StartNexusOperationResponse. `run_id` is optional and defaults to latest run. + temporal.api.nexus.v1.CallerOperationReference caller_operation_ref = 4; +} + +// If this response is returned, the deletion request was successfully processed by the caller server. +message DeleteNexusOperationResponse { +} + +message CompleteNexusOperationRequest { + // The identity of the client who initiated this request. + string identity = 1; + // The operation handler namespace. + string namespace = 2; + + // A UUID used to deduplicate client requests. + string request_id = 3; + // The callback token as provided in the StartOperation call. + bytes callback_token = 4; + + oneof outcome { + // The operation completed successfully. + temporal.api.common.v1.Payload result = 5; + // The operation completed unsuccessfully (failed or canceled). + temporal.api.nexus.v1.UnsuccessfulOperationError operation_error = 6; + } + + // Request headers to send with the completion request. + map header = 7; + // Links to be associated with the completion in the caller namespace. + repeated temporal.api.nexus.v1.Link links = 8; + + // Total time for the operation callback to complete. + google.protobuf.Duration callback_timeout = 9; + // The retry policy for the complete operation request. Will never exceed `callback_timeout`. + temporal.api.common.v1.RetryPolicy retry_policy = 10; +} + +message CompleteNexusOperationResponse { +} + +message FetchCallbackResultRequest { + // The identity of the client who initiated this request. + string identity = 1; + // The namespace that invoked the callback. + string namespace = 2; + + // The token referencing this callback as originally generated by the server. + bytes callback_token = 3; + + // If true, the caller has indicated that it wants to wait for callback completion, turning the request + // into a long poll. The server will wait the minimum duration from among the callback timeout, the request context + // deadline, and the servers configured maximum long poll request timeout. + bool wait = 4; +} + +message FetchCallbackResultResponse { + message Successful { + } + + message Unsuccessful { + temporal.api.failure.v1.Failure failure = 1; + } + + message StillRunning { + } + + oneof variant { + // The callback has finished successfully. + Successful successful = 1; + // The callback has finished unsuccessfully. + Unsuccessful unsuccessful = 2; + // The operation is still running, When waiting for completion, the caller may re-issue this request to start a + // new long poll. + StillRunning still_running = 3; + } +} + +message TerminateCallbackRequest { + // The identity of the client who initiated this request. + string identity = 1; + // The namespace that invoked the callback. + string namespace = 2; + + // A UUID used to deduplicate client requests. + string request_id = 3; + // The token referencing this callback as originally generated by the server. + string callback_token = 4; + + // An optional reason for terminating this Callback. + string reason = 5; + // Serialized additional information to attach to the termination. + temporal.api.common.v1.Payloads details = 6; +} + +// If this response is returned, the server successfully processed the termination request and no more attempts to +// deliver the callback will be made. +message TerminateCallbackResponse { +} + +message DeleteCallbackRequest { + // The identity of the client who initiated this request. + string identity = 1; + // The namespace that invoked the callback. + string namespace = 2; + + // A UUID used to deduplicate client requests. + string request_id = 3; + // The token referencing this callback as originally generated by the server. + string callback_token = 4; +} + +// If this response is returned, the server successfully processed the deletion request. +message DeleteCallbackResponse { +} diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index dc33b84ef..0717f1419 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1259,4 +1259,86 @@ service WorkflowService { } }; } + + // Start an arbitrary length Nexus operation. The result of the operation may be retrieved using the + // FetchNexusOperationResult method. + // + // (-- api-linter: core::0127::http-annotation=disabled + // aip.dev/not-precedent: Nexus has a separately defined HTTP API. --) + rpc StartNexusOperation (StartNexusOperationRequest) returns (StartNexusOperationResponse) { + } + + // Request to cancel a Nexus operation. The operation may later complete as canceled or any other outcome. Handlers + // should ignore multiple cancellations of the same operation and return successfully if cancellation was already + // requested. + // + // (-- api-linter: core::0127::http-annotation=disabled + // aip.dev/not-precedent: Nexus has a separately defined HTTP API. --) + rpc RequestCancelNexusOperation (RequestCancelNexusOperationRequest) returns (RequestCancelNexusOperationResponse) { + } + + // Retrieve the result of a Nexus operation. Optionally specify a wait period to turn this request into a long poll. + rpc FetchNexusOperationResult (FetchNexusOperationResultRequest) returns (FetchNexusOperationResultResponse) { + option (google.api.http) = { + get: "/namespaces/{namespace}/nexus/operations/{caller_operation_ref.operation_ref}/result" + additional_bindings { + get: "/api/v1/namespaces/{namespace}/nexus/operations/{caller_operation_ref.operation_ref}/result" + } + }; + } + + // + rpc TerminateNexusOperation (TerminateNexusOperationRequest) returns (TerminateNexusOperationResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/nexus/operations/{caller_operation_ref.operation_ref}/terminate" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/nexus/operations/{caller_operation_ref.operation_ref}/terminate" + body: "*" + } + }; + } + + // + // + // (-- api-linter: core::0127::http-annotation=disabled + // aip.dev/not-precedent: Nexus operation deletion not exposed to HTTP, users should use cancel or terminate. --) + rpc DeleteNexusOperation (DeleteNexusOperationRequest) returns (DeleteNexusOperationResponse) { + } + + // Complete a Nexus operation, using a callback to deliver the result back to the original caller. + // + // (-- api-linter: core::0127::http-annotation=disabled + // aip.dev/not-precedent: Nexus has a separately defined HTTP API. --) + rpc CompleteNexusOperation (CompleteNexusOperationRequest) returns (CompleteNexusOperationResponse) { + } + + // + rpc FetchCallbackResult (FetchCallbackResultRequest) returns (FetchCallbackResultResponse) { + option (google.api.http) = { + get: "/namespaces/{namespace}/callbacks/{callback_token}/result" + additional_bindings { + get: "/api/v1/namespaces/{namespace}/callbacks/{callback_token}/result" + } + }; + } + + // + rpc TerminateCallback (TerminateCallbackRequest) returns (TerminateCallbackResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/callbacks/{callback_token}/terminate" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/callbacks/{callback_token}/terminate" + body: "*" + } + }; + } + + // + // + // (-- api-linter: core::0127::http-annotation=disabled + // aip.dev/not-precedent: Callback deletion not exposed to HTTP, users should use terminate. --) + rpc DeleteCallback (DeleteCallbackRequest) returns (DeleteCallbackResponse) { + } }