diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index c1871518..78bc842d 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -477,16 +477,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/pause-by-id": { + "/api/v1/namespaces/{namespace}/activities/pause": { "post": { - "summary": "PauseActivityById pauses the execution of an activity specified by its ID.\nReturns a `NotFound` error if there is no pending activity with the provided ID.", - "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n- The activity should respond to the cancellation accordingly.", - "operationId": "PauseActivityById2", + "summary": "PauseActivity pauses the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be paused", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n- The activity should respond to the cancellation accordingly.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type", + "operationId": "PauseActivity2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PauseActivityByIdResponse" + "$ref": "#/definitions/v1PauseActivityResponse" } }, "default": { @@ -509,7 +509,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServicePauseActivityByIdBody" + "$ref": "#/definitions/WorkflowServicePauseActivityBody" } } ], @@ -518,15 +518,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/reset-by-id": { + "/api/v1/namespaces/{namespace}/activities/reset": { "post": { - "summary": "ResetActivityById unpauses the execution of an activity specified by its ID.\nReturns a `NotFound` error if there is no pending activity with the provided ID.\nResetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be resetted.\nIf the activity currently running:\n* if 'no_wait' flag is provided, a new instance of the activity will be scheduled immediately.\n* if 'no_wait' flag is not provided, a new instance of the activity will be scheduled after current instance completes if needed.\nIf 'reset_heartbeats' flag is set, the activity heartbeat timer and heartbeats will be reset.", - "operationId": "ResetActivityById2", + "summary": "ResetActivity resets the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be reset.", + "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag),\n\nFlags:\n\n'jitter': the activity will be scheduled at a random time within the jitter duration.\nIf the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided.\n'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset.\n'keep_paused': if the activity is paused, it will remain paused.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", + "operationId": "ResetActivity2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ResetActivityByIdResponse" + "$ref": "#/definitions/v1ResetActivityResponse" } }, "default": { @@ -549,7 +550,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceResetActivityByIdBody" + "$ref": "#/definitions/WorkflowServiceResetActivityBody" } } ], @@ -558,15 +559,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/unpause-by-id": { + "/api/v1/namespaces/{namespace}/activities/unpause": { "post": { - "summary": "UnpauseActivityById unpauses the execution of an activity specified by its ID.\nReturns a `NotFound` error if there is no pending activity with the provided ID.\nThere are two 'modes' of unpausing an activity:\n'resume' - If the activity is paused, it will be resumed and scheduled for execution.\n * If the activity is currently running Unpause with 'resume' has no effect.\n * if 'no_wait' flag is set and the activity is waiting, the activity will be scheduled immediately.\n'reset' - If the activity is paused, it will be reset to its initial state and (depending on parameters) scheduled for execution.\n * If the activity is currently running, Unpause with 'reset' will reset the number of attempts.\n * if 'no_wait' flag is set, the activity will be scheduled immediately.\n * if 'reset_heartbeats' flag is set, the activity heartbeat timer and heartbeats will be reset.\nIf the activity is in waiting for retry and past it retry timeout, it will be scheduled immediately.\nOnce the activity is unpaused, all timeout timers will be regenerated.", - "operationId": "UnpauseActivityById2", + "summary": "UnpauseActivity unpauses the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be unpaused.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nFlags:\n'jitter': the activity will be scheduled at a random time within the jitter duration.\n'reset_attempts': the number of attempts will be reset.\n'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type", + "operationId": "UnpauseActivity2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UnpauseActivityByIdResponse" + "$ref": "#/definitions/v1UnpauseActivityResponse" } }, "default": { @@ -589,7 +591,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUnpauseActivityByIdBody" + "$ref": "#/definitions/WorkflowServiceUnpauseActivityBody" } } ], @@ -598,15 +600,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/update-options-by-id": { + "/api/v1/namespaces/{namespace}/activities/update-options": { "post": { - "summary": "UpdateActivityOptionsById is called by the client to update the options of an activity", - "operationId": "UpdateActivityOptionsById2", + "summary": "UpdateActivityOptions is called by the client to update the options of an activity by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be updated.", + "operationId": "UpdateActivityOptions2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateActivityOptionsByIdResponse" + "$ref": "#/definitions/v1UpdateActivityOptionsResponse" } }, "default": { @@ -629,7 +631,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateActivityOptionsByIdBody" + "$ref": "#/definitions/WorkflowServiceUpdateActivityOptionsBody" } } ], @@ -3477,16 +3479,16 @@ ] } }, - "/namespaces/{namespace}/activities/pause-by-id": { + "/namespaces/{namespace}/activities/pause": { "post": { - "summary": "PauseActivityById pauses the execution of an activity specified by its ID.\nReturns a `NotFound` error if there is no pending activity with the provided ID.", - "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n- The activity should respond to the cancellation accordingly.", - "operationId": "PauseActivityById", + "summary": "PauseActivity pauses the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be paused", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n- The activity should respond to the cancellation accordingly.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type", + "operationId": "PauseActivity", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PauseActivityByIdResponse" + "$ref": "#/definitions/v1PauseActivityResponse" } }, "default": { @@ -3509,7 +3511,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServicePauseActivityByIdBody" + "$ref": "#/definitions/WorkflowServicePauseActivityBody" } } ], @@ -3518,15 +3520,16 @@ ] } }, - "/namespaces/{namespace}/activities/reset-by-id": { + "/namespaces/{namespace}/activities/reset": { "post": { - "summary": "ResetActivityById unpauses the execution of an activity specified by its ID.\nReturns a `NotFound` error if there is no pending activity with the provided ID.\nResetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be resetted.\nIf the activity currently running:\n* if 'no_wait' flag is provided, a new instance of the activity will be scheduled immediately.\n* if 'no_wait' flag is not provided, a new instance of the activity will be scheduled after current instance completes if needed.\nIf 'reset_heartbeats' flag is set, the activity heartbeat timer and heartbeats will be reset.", - "operationId": "ResetActivityById", + "summary": "ResetActivity resets the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be reset.", + "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag),\n\nFlags:\n\n'jitter': the activity will be scheduled at a random time within the jitter duration.\nIf the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided.\n'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset.\n'keep_paused': if the activity is paused, it will remain paused.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", + "operationId": "ResetActivity", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ResetActivityByIdResponse" + "$ref": "#/definitions/v1ResetActivityResponse" } }, "default": { @@ -3549,7 +3552,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceResetActivityByIdBody" + "$ref": "#/definitions/WorkflowServiceResetActivityBody" } } ], @@ -3558,15 +3561,16 @@ ] } }, - "/namespaces/{namespace}/activities/unpause-by-id": { + "/namespaces/{namespace}/activities/unpause": { "post": { - "summary": "UnpauseActivityById unpauses the execution of an activity specified by its ID.\nReturns a `NotFound` error if there is no pending activity with the provided ID.\nThere are two 'modes' of unpausing an activity:\n'resume' - If the activity is paused, it will be resumed and scheduled for execution.\n * If the activity is currently running Unpause with 'resume' has no effect.\n * if 'no_wait' flag is set and the activity is waiting, the activity will be scheduled immediately.\n'reset' - If the activity is paused, it will be reset to its initial state and (depending on parameters) scheduled for execution.\n * If the activity is currently running, Unpause with 'reset' will reset the number of attempts.\n * if 'no_wait' flag is set, the activity will be scheduled immediately.\n * if 'reset_heartbeats' flag is set, the activity heartbeat timer and heartbeats will be reset.\nIf the activity is in waiting for retry and past it retry timeout, it will be scheduled immediately.\nOnce the activity is unpaused, all timeout timers will be regenerated.", - "operationId": "UnpauseActivityById", + "summary": "UnpauseActivity unpauses the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be unpaused.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nFlags:\n'jitter': the activity will be scheduled at a random time within the jitter duration.\n'reset_attempts': the number of attempts will be reset.\n'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type", + "operationId": "UnpauseActivity", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UnpauseActivityByIdResponse" + "$ref": "#/definitions/v1UnpauseActivityResponse" } }, "default": { @@ -3589,7 +3593,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUnpauseActivityByIdBody" + "$ref": "#/definitions/WorkflowServiceUnpauseActivityBody" } } ], @@ -3598,15 +3602,15 @@ ] } }, - "/namespaces/{namespace}/activities/update-options-by-id": { + "/namespaces/{namespace}/activities/update-options": { "post": { - "summary": "UpdateActivityOptionsById is called by the client to update the options of an activity", - "operationId": "UpdateActivityOptionsById", + "summary": "UpdateActivityOptions is called by the client to update the options of an activity by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be updated.", + "operationId": "UpdateActivityOptions", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateActivityOptionsByIdResponse" + "$ref": "#/definitions/v1UpdateActivityOptionsResponse" } }, "default": { @@ -3629,7 +3633,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateActivityOptionsByIdBody" + "$ref": "#/definitions/WorkflowServiceUpdateActivityOptionsBody" } } ], @@ -5684,28 +5688,6 @@ }, "description": "An operation completed successfully." }, - "UnpauseActivityByIdRequestResetOperation": { - "type": "object", - "properties": { - "noWait": { - "type": "boolean", - "description": "Indicates that the activity should be scheduled immediately.\nNote that this may run simultaneously with any existing executions of the activity." - }, - "resetHeartbeat": { - "type": "boolean", - "title": "If set, the Heartbeat Details will be cleared out to make the Activity start over from the beginning" - } - } - }, - "UnpauseActivityByIdRequestResumeOperation": { - "type": "object", - "properties": { - "noWait": { - "type": "boolean", - "description": "Indicates that if the activity is waiting to retry, it will be scheduled immediately." - } - } - }, "UpdateWorkerBuildIdCompatibilityRequestAddNewCompatibleVersion": { "type": "object", "properties": { @@ -5888,28 +5870,24 @@ } } }, - "WorkflowServicePauseActivityByIdBody": { + "WorkflowServicePauseActivityBody": { "type": "object", "properties": { - "workflowId": { - "type": "string", - "description": "ID of the workflow which scheduled this activity." - }, - "runId": { - "type": "string", - "description": "Run ID of the workflow which scheduled this activity.\nIf empty - latest workflow is used." - }, - "activityId": { - "type": "string", - "description": "ID of the activity we're updating." + "execution": { + "$ref": "#/definitions/v1WorkflowExecution", + "title": "Execution info of the workflow which scheduled this activity" }, "identity": { "type": "string", "description": "The identity of the client who initiated this request." }, - "requestId": { + "id": { "type": "string", - "description": "Used to de-dupe requests." + "description": "Only the activity with this ID will be paused." + }, + "type": { + "type": "string", + "description": "Pause all running activities of this type." } } }, @@ -6026,36 +6004,36 @@ } } }, - "WorkflowServiceResetActivityByIdBody": { + "WorkflowServiceResetActivityBody": { "type": "object", "properties": { - "workflowId": { - "type": "string", - "description": "ID of the workflow which scheduled this activity." - }, - "runId": { - "type": "string", - "description": "Run ID of the workflow which scheduled this activity.\nIf empty - latest workflow is used." - }, - "activityId": { - "type": "string", - "description": "ID of the activity we're updating." + "execution": { + "$ref": "#/definitions/v1WorkflowExecution", + "title": "Execution info of the workflow which scheduled this activity" }, "identity": { "type": "string", "description": "The identity of the client who initiated this request." }, - "requestId": { + "id": { "type": "string", - "description": "Used to de-dupe requests." + "description": "Only activity with this ID will be reset." }, - "noWait": { - "type": "boolean", - "description": "Indicates that activity should be scheduled immediately.\nIf this flag doesn't set, and activity currently running - temporal will wait until activity is completed." + "type": { + "type": "string", + "description": "Reset all running activities with of this type." }, "resetHeartbeat": { "type": "boolean", "description": "Indicates that activity should reset heartbeat details.\nThis flag will be applied only to the new instance of the activity." + }, + "keepPaused": { + "type": "boolean", + "title": "if activity is paused, it will remain paused after reset" + }, + "jitter": { + "type": "string", + "title": "If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration.\n(unless it is paused and keep_paused is set)" } } }, @@ -6608,51 +6586,49 @@ } } }, - "WorkflowServiceUnpauseActivityByIdBody": { + "WorkflowServiceUnpauseActivityBody": { "type": "object", "properties": { - "workflowId": { - "type": "string", - "description": "ID of the workflow which scheduled this activity." + "execution": { + "$ref": "#/definitions/v1WorkflowExecution", + "title": "Execution info of the workflow which scheduled this activity" }, - "runId": { + "identity": { "type": "string", - "description": "Run ID of the workflow which scheduled this activity.\nIf empty - latest workflow is used." + "description": "The identity of the client who initiated this request." }, - "activityId": { + "id": { "type": "string", - "description": "ID of the activity we're updating." + "description": "Only the activity with this ID will be unpaused." }, - "identity": { + "type": { "type": "string", - "description": "The identity of the client who initiated this request." + "description": "Unpause all running activities with of this type." }, - "requestId": { - "type": "string", - "description": "Used to de-dupe requests." + "unpauseAll": { + "type": "boolean", + "description": "Unpause all running activities." + }, + "resetAttempts": { + "type": "boolean", + "description": "Providing this flag will also reset the number of attempts." }, - "resume": { - "$ref": "#/definitions/UnpauseActivityByIdRequestResumeOperation" + "resetHeartbeat": { + "type": "boolean", + "description": "Providing this flag will also reset the heartbeat details." }, - "reset": { - "$ref": "#/definitions/UnpauseActivityByIdRequestResetOperation" + "jitter": { + "type": "string", + "description": "If set, the activity will start at a random time within the specified jitter duration." } } }, - "WorkflowServiceUpdateActivityOptionsByIdBody": { + "WorkflowServiceUpdateActivityOptionsBody": { "type": "object", "properties": { - "workflowId": { - "type": "string", - "title": "ID of the workflow which scheduled this activity" - }, - "runId": { - "type": "string", - "title": "Run ID of the workflow which scheduled this activity\nif empty - latest workflow is used" - }, - "activityId": { - "type": "string", - "title": "ID of the activity we're updating" + "execution": { + "$ref": "#/definitions/v1WorkflowExecution", + "title": "Execution info of the workflow which scheduled this activity" }, "identity": { "type": "string", @@ -6666,9 +6642,13 @@ "type": "string", "title": "Controls which fields from `activity_options` will be applied" }, - "requestId": { + "id": { + "type": "string", + "description": "Only activity with this ID will be updated." + }, + "type": { "type": "string", - "title": "Used to de-dupe requests" + "description": "Update all running activities of this type." } } }, @@ -10033,7 +10013,7 @@ "v1PatchScheduleResponse": { "type": "object" }, - "v1PauseActivityByIdResponse": { + "v1PauseActivityResponse": { "type": "object" }, "v1Payload": { @@ -10809,7 +10789,7 @@ "v1RequestCancelWorkflowExecutionResponse": { "type": "object" }, - "v1ResetActivityByIdResponse": { + "v1ResetActivityResponse": { "type": "object" }, "v1ResetOptions": { @@ -12468,7 +12448,7 @@ } } }, - "v1UnpauseActivityByIdResponse": { + "v1UnpauseActivityResponse": { "type": "object" }, "v1UnsuccessfulOperationError": { @@ -12483,7 +12463,7 @@ } } }, - "v1UpdateActivityOptionsByIdResponse": { + "v1UpdateActivityOptionsResponse": { "type": "object", "properties": { "activityOptions": { diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 4da26b90..94fc362c 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -416,13 +416,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/pause-by-id: + /api/v1/namespaces/{namespace}/activities/pause: post: tags: - WorkflowService description: |- - PauseActivityById pauses the execution of an activity specified by its ID. - Returns a `NotFound` error if there is no pending activity with the provided ID. + PauseActivity pauses the execution of an activity specified by its ID or type. + If there are multiple pending activities of the provided type - all of them will be paused Pausing an activity means: - If the activity is currently waiting for a retry or is running and subsequently fails, @@ -435,9 +435,9 @@ paths: For long-running activities: - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. - The activity should respond to the cancellation accordingly. - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: PauseActivityById + + Returns a `NotFound` error if there is no pending activity with the provided ID or type + operationId: PauseActivity parameters: - name: namespace in: path @@ -449,7 +449,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseActivityByIdRequest' + $ref: '#/components/schemas/PauseActivityRequest' required: true responses: "200": @@ -457,30 +457,36 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseActivityByIdResponse' + $ref: '#/components/schemas/PauseActivityResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/reset-by-id: + /api/v1/namespaces/{namespace}/activities/reset: post: tags: - WorkflowService description: |- - ResetActivityById unpauses the execution of an activity specified by its ID. - Returns a `NotFound` error if there is no pending activity with the provided ID. + ResetActivity resets the execution of an activity specified by its ID or type. + If there are multiple pending activities of the provided type - all of them will be reset. + Resetting an activity means: * number of attempts will be reset to 0. - * activity timeouts will be resetted. - If the activity currently running: - * if 'no_wait' flag is provided, a new instance of the activity will be scheduled immediately. - * if 'no_wait' flag is not provided, a new instance of the activity will be scheduled after current instance completes if needed. - If 'reset_heartbeats' flag is set, the activity heartbeat timer and heartbeats will be reset. - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: ResetActivityById + * activity timeouts will be reset. + * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: + it will be scheduled immediately (* see 'jitter' flag), + + Flags: + + 'jitter': the activity will be scheduled at a random time within the jitter duration. + If the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided. + 'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset. + 'keep_paused': if the activity is paused, it will remain paused. + + Returns a `NotFound` error if there is no pending activity with the provided ID or type. + operationId: ResetActivity parameters: - name: namespace in: path @@ -492,7 +498,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ResetActivityByIdRequest' + $ref: '#/components/schemas/ResetActivityRequest' required: true responses: "200": @@ -500,33 +506,32 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ResetActivityByIdResponse' + $ref: '#/components/schemas/ResetActivityResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/unpause-by-id: + /api/v1/namespaces/{namespace}/activities/unpause: post: tags: - WorkflowService description: |- - UnpauseActivityById unpauses the execution of an activity specified by its ID. - Returns a `NotFound` error if there is no pending activity with the provided ID. - There are two 'modes' of unpausing an activity: - 'resume' - If the activity is paused, it will be resumed and scheduled for execution. - * If the activity is currently running Unpause with 'resume' has no effect. - * if 'no_wait' flag is set and the activity is waiting, the activity will be scheduled immediately. - 'reset' - If the activity is paused, it will be reset to its initial state and (depending on parameters) scheduled for execution. - * If the activity is currently running, Unpause with 'reset' will reset the number of attempts. - * if 'no_wait' flag is set, the activity will be scheduled immediately. - * if 'reset_heartbeats' flag is set, the activity heartbeat timer and heartbeats will be reset. - If the activity is in waiting for retry and past it retry timeout, it will be scheduled immediately. + UnpauseActivity unpauses the execution of an activity specified by its ID or type. + If there are multiple pending activities of the provided type - all of them will be unpaused. + + If activity is not paused, this call will have no effect. + If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). Once the activity is unpaused, all timeout timers will be regenerated. - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: UnpauseActivityById + + Flags: + 'jitter': the activity will be scheduled at a random time within the jitter duration. + 'reset_attempts': the number of attempts will be reset. + 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. + + Returns a `NotFound` error if there is no pending activity with the provided ID or type + operationId: UnpauseActivity parameters: - name: namespace in: path @@ -538,7 +543,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UnpauseActivityByIdRequest' + $ref: '#/components/schemas/UnpauseActivityRequest' required: true responses: "200": @@ -546,22 +551,21 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UnpauseActivityByIdResponse' + $ref: '#/components/schemas/UnpauseActivityResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/update-options-by-id: + /api/v1/namespaces/{namespace}/activities/update-options: post: tags: - WorkflowService description: |- - UpdateActivityOptionsById is called by the client to update the options of an activity - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: UpdateActivityOptionsById + UpdateActivityOptions is called by the client to update the options of an activity by its ID or type. + If there are multiple pending activities of the provided type - all of them will be updated. + operationId: UpdateActivityOptions parameters: - name: namespace in: path @@ -573,7 +577,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UpdateActivityOptionsByIdRequest' + $ref: '#/components/schemas/UpdateActivityOptionsRequest' required: true responses: "200": @@ -581,7 +585,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UpdateActivityOptionsByIdResponse' + $ref: '#/components/schemas/UpdateActivityOptionsResponse' default: description: Default error response content: @@ -3079,13 +3083,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/pause-by-id: + /namespaces/{namespace}/activities/pause: post: tags: - WorkflowService description: |- - PauseActivityById pauses the execution of an activity specified by its ID. - Returns a `NotFound` error if there is no pending activity with the provided ID. + PauseActivity pauses the execution of an activity specified by its ID or type. + If there are multiple pending activities of the provided type - all of them will be paused Pausing an activity means: - If the activity is currently waiting for a retry or is running and subsequently fails, @@ -3098,9 +3102,9 @@ paths: For long-running activities: - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. - The activity should respond to the cancellation accordingly. - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: PauseActivityById + + Returns a `NotFound` error if there is no pending activity with the provided ID or type + operationId: PauseActivity parameters: - name: namespace in: path @@ -3112,7 +3116,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseActivityByIdRequest' + $ref: '#/components/schemas/PauseActivityRequest' required: true responses: "200": @@ -3120,30 +3124,36 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseActivityByIdResponse' + $ref: '#/components/schemas/PauseActivityResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/reset-by-id: + /namespaces/{namespace}/activities/reset: post: tags: - WorkflowService description: |- - ResetActivityById unpauses the execution of an activity specified by its ID. - Returns a `NotFound` error if there is no pending activity with the provided ID. + ResetActivity resets the execution of an activity specified by its ID or type. + If there are multiple pending activities of the provided type - all of them will be reset. + Resetting an activity means: * number of attempts will be reset to 0. - * activity timeouts will be resetted. - If the activity currently running: - * if 'no_wait' flag is provided, a new instance of the activity will be scheduled immediately. - * if 'no_wait' flag is not provided, a new instance of the activity will be scheduled after current instance completes if needed. - If 'reset_heartbeats' flag is set, the activity heartbeat timer and heartbeats will be reset. - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: ResetActivityById + * activity timeouts will be reset. + * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: + it will be scheduled immediately (* see 'jitter' flag), + + Flags: + + 'jitter': the activity will be scheduled at a random time within the jitter duration. + If the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided. + 'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset. + 'keep_paused': if the activity is paused, it will remain paused. + + Returns a `NotFound` error if there is no pending activity with the provided ID or type. + operationId: ResetActivity parameters: - name: namespace in: path @@ -3155,7 +3165,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ResetActivityByIdRequest' + $ref: '#/components/schemas/ResetActivityRequest' required: true responses: "200": @@ -3163,33 +3173,32 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ResetActivityByIdResponse' + $ref: '#/components/schemas/ResetActivityResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/unpause-by-id: + /namespaces/{namespace}/activities/unpause: post: tags: - WorkflowService description: |- - UnpauseActivityById unpauses the execution of an activity specified by its ID. - Returns a `NotFound` error if there is no pending activity with the provided ID. - There are two 'modes' of unpausing an activity: - 'resume' - If the activity is paused, it will be resumed and scheduled for execution. - * If the activity is currently running Unpause with 'resume' has no effect. - * if 'no_wait' flag is set and the activity is waiting, the activity will be scheduled immediately. - 'reset' - If the activity is paused, it will be reset to its initial state and (depending on parameters) scheduled for execution. - * If the activity is currently running, Unpause with 'reset' will reset the number of attempts. - * if 'no_wait' flag is set, the activity will be scheduled immediately. - * if 'reset_heartbeats' flag is set, the activity heartbeat timer and heartbeats will be reset. - If the activity is in waiting for retry and past it retry timeout, it will be scheduled immediately. + UnpauseActivity unpauses the execution of an activity specified by its ID or type. + If there are multiple pending activities of the provided type - all of them will be unpaused. + + If activity is not paused, this call will have no effect. + If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). Once the activity is unpaused, all timeout timers will be regenerated. - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: UnpauseActivityById + + Flags: + 'jitter': the activity will be scheduled at a random time within the jitter duration. + 'reset_attempts': the number of attempts will be reset. + 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. + + Returns a `NotFound` error if there is no pending activity with the provided ID or type + operationId: UnpauseActivity parameters: - name: namespace in: path @@ -3201,7 +3210,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UnpauseActivityByIdRequest' + $ref: '#/components/schemas/UnpauseActivityRequest' required: true responses: "200": @@ -3209,22 +3218,21 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UnpauseActivityByIdResponse' + $ref: '#/components/schemas/UnpauseActivityResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/update-options-by-id: + /namespaces/{namespace}/activities/update-options: post: tags: - WorkflowService description: |- - UpdateActivityOptionsById is called by the client to update the options of an activity - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: UpdateActivityOptionsById + UpdateActivityOptions is called by the client to update the options of an activity by its ID or type. + If there are multiple pending activities of the provided type - all of them will be updated. + operationId: UpdateActivityOptions parameters: - name: namespace in: path @@ -3236,7 +3244,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UpdateActivityOptionsByIdRequest' + $ref: '#/components/schemas/UpdateActivityOptionsRequest' required: true responses: "200": @@ -3244,7 +3252,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UpdateActivityOptionsByIdResponse' + $ref: '#/components/schemas/UpdateActivityOptionsResponse' default: description: Default error response content: @@ -7494,30 +7502,26 @@ components: PatchScheduleResponse: type: object properties: {} - PauseActivityByIdRequest: + PauseActivityRequest: type: object properties: namespace: type: string description: Namespace of the workflow which scheduled this activity. - workflowId: - type: string - description: ID of the workflow which scheduled this activity. - runId: - type: string - description: |- - Run ID of the workflow which scheduled this activity. - If empty - latest workflow is used. - activityId: - type: string - description: ID of the activity we're updating. + execution: + allOf: + - $ref: '#/components/schemas/WorkflowExecution' + description: Execution info of the workflow which scheduled this activity identity: type: string description: The identity of the client who initiated this request. - requestId: + id: type: string - description: Used to de-dupe requests. - PauseActivityByIdResponse: + description: Only the activity with this ID will be paused. + type: + type: string + description: Pause all running activities of this type. + PauseActivityResponse: type: object properties: {} Payload: @@ -8114,40 +8118,40 @@ components: RequestCancelWorkflowExecutionResponse: type: object properties: {} - ResetActivityByIdRequest: + ResetActivityRequest: type: object properties: namespace: type: string description: Namespace of the workflow which scheduled this activity. - workflowId: - type: string - description: ID of the workflow which scheduled this activity. - runId: - type: string - description: |- - Run ID of the workflow which scheduled this activity. - If empty - latest workflow is used. - activityId: - type: string - description: ID of the activity we're updating. + execution: + allOf: + - $ref: '#/components/schemas/WorkflowExecution' + description: Execution info of the workflow which scheduled this activity identity: type: string description: The identity of the client who initiated this request. - requestId: + id: type: string - description: Used to de-dupe requests. - noWait: - type: boolean - description: |- - Indicates that activity should be scheduled immediately. - If this flag doesn't set, and activity currently running - temporal will wait until activity is completed. + description: Only activity with this ID will be reset. + type: + type: string + description: Reset all running activities with of this type. resetHeartbeat: type: boolean description: |- Indicates that activity should reset heartbeat details. This flag will be applied only to the new instance of the activity. - ResetActivityByIdResponse: + keepPaused: + type: boolean + description: if activity is paused, it will remain paused after reset + jitter: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: |- + If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration. + (unless it is paused and keep_paused is set) + ResetActivityResponse: type: object properties: {} ResetOptions: @@ -9791,70 +9795,51 @@ components: type: string description: If set, override overlap policy for this one request. format: enum - UnpauseActivityByIdRequest: + UnpauseActivityRequest: type: object properties: namespace: type: string description: Namespace of the workflow which scheduled this activity. - workflowId: - type: string - description: ID of the workflow which scheduled this activity. - runId: - type: string - description: |- - Run ID of the workflow which scheduled this activity. - If empty - latest workflow is used. - activityId: - type: string - description: ID of the activity we're updating. + execution: + allOf: + - $ref: '#/components/schemas/WorkflowExecution' + description: Execution info of the workflow which scheduled this activity identity: type: string description: The identity of the client who initiated this request. - requestId: + id: type: string - description: Used to de-dupe requests. - resume: - $ref: '#/components/schemas/UnpauseActivityByIdRequest_ResumeOperation' - reset: - $ref: '#/components/schemas/UnpauseActivityByIdRequest_ResetOperation' - UnpauseActivityByIdRequest_ResetOperation: - type: object - properties: - noWait: + description: Only the activity with this ID will be unpaused. + type: + type: string + description: Unpause all running activities with of this type. + unpauseAll: type: boolean - description: |- - Indicates that the activity should be scheduled immediately. - Note that this may run simultaneously with any existing executions of the activity. - resetHeartbeat: + description: Unpause all running activities. + resetAttempts: type: boolean - description: If set, the Heartbeat Details will be cleared out to make the Activity start over from the beginning - UnpauseActivityByIdRequest_ResumeOperation: - type: object - properties: - noWait: + description: Providing this flag will also reset the number of attempts. + resetHeartbeat: type: boolean - description: Indicates that if the activity is waiting to retry, it will be scheduled immediately. - UnpauseActivityByIdResponse: + description: Providing this flag will also reset the heartbeat details. + jitter: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: If set, the activity will start at a random time within the specified jitter duration. + UnpauseActivityResponse: type: object properties: {} - UpdateActivityOptionsByIdRequest: + UpdateActivityOptionsRequest: type: object properties: namespace: type: string description: Namespace of the workflow which scheduled this activity - workflowId: - type: string - description: ID of the workflow which scheduled this activity - runId: - type: string - description: |- - Run ID of the workflow which scheduled this activity - if empty - latest workflow is used - activityId: - type: string - description: ID of the activity we're updating + execution: + allOf: + - $ref: '#/components/schemas/WorkflowExecution' + description: Execution info of the workflow which scheduled this activity identity: type: string description: The identity of the client who initiated this request @@ -9866,10 +9851,13 @@ components: type: string description: Controls which fields from `activity_options` will be applied format: field-mask - requestId: + id: + type: string + description: Only activity with this ID will be updated. + type: type: string - description: Used to de-dupe requests - UpdateActivityOptionsByIdResponse: + description: Update all running activities of this type. + UpdateActivityOptionsResponse: type: object properties: activityOptions: diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index c9bcebae..2367996d 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -1748,123 +1748,119 @@ message ExecuteMultiOperationResponse { } } -message UpdateActivityOptionsByIdRequest { +message UpdateActivityOptionsRequest { // Namespace of the workflow which scheduled this activity string namespace = 1; - // ID of the workflow which scheduled this activity - string workflow_id = 2; - // Run ID of the workflow which scheduled this activity - // if empty - latest workflow is used - string run_id = 3; - // ID of the activity we're updating - string activity_id = 4; + // Execution info of the workflow which scheduled this activity + temporal.api.common.v1.WorkflowExecution execution = 2; // The identity of the client who initiated this request - string identity = 5; + string identity = 3; // Activity options. Partial updates are accepted and controlled by update_mask - temporal.api.activity.v1.ActivityOptions activity_options = 6; + temporal.api.activity.v1.ActivityOptions activity_options = 4; // Controls which fields from `activity_options` will be applied - google.protobuf.FieldMask update_mask = 7; - - // Used to de-dupe requests - string request_id = 8; + google.protobuf.FieldMask update_mask = 5; + + // either activity id or activity type must be provided + oneof activity { + // Only activity with this ID will be updated. + string id = 6; + // Update all running activities of this type. + string type = 7; + } } -message UpdateActivityOptionsByIdResponse { +message UpdateActivityOptionsResponse { // Activity options after an update temporal.api.activity.v1.ActivityOptions activity_options = 1; } -message PauseActivityByIdRequest { +message PauseActivityRequest { // Namespace of the workflow which scheduled this activity. string namespace = 1; - // ID of the workflow which scheduled this activity. - string workflow_id = 2; - // Run ID of the workflow which scheduled this activity. - // If empty - latest workflow is used. - string run_id = 3; - // ID of the activity we're updating. - string activity_id = 4; + // Execution info of the workflow which scheduled this activity + temporal.api.common.v1.WorkflowExecution execution = 2; // The identity of the client who initiated this request. - string identity = 5; + string identity = 3; - // Used to de-dupe requests. - string request_id = 6; -} + // either activity id or activity type must be provided + oneof activity { + // Only the activity with this ID will be paused. + string id = 4; + // Pause all running activities of this type. + string type = 5; + } -message PauseActivityByIdResponse { } -message UnpauseActivityByIdRequest { - message ResumeOperation { - // Indicates that if the activity is waiting to retry, it will be scheduled immediately. - bool no_wait = 1; - } - - message ResetOperation { - // Indicates that the activity should be scheduled immediately. - // Note that this may run simultaneously with any existing executions of the activity. - bool no_wait = 1; - // If set, the Heartbeat Details will be cleared out to make the Activity start over from the beginning - bool reset_heartbeat = 2; - } +message PauseActivityResponse { +} +message UnpauseActivityRequest { // Namespace of the workflow which scheduled this activity. string namespace = 1; - // ID of the workflow which scheduled this activity. - string workflow_id = 2; - // Run ID of the workflow which scheduled this activity. - // If empty - latest workflow is used. - string run_id = 3; - // ID of the activity we're updating. - string activity_id = 4; + // Execution info of the workflow which scheduled this activity + temporal.api.common.v1.WorkflowExecution execution = 2; // The identity of the client who initiated this request. - string identity = 5; - - // Used to de-dupe requests. - string request_id = 6; + string identity = 3; - // There are two options to resume the activity - with 'resume' or with 'reset'. - oneof operation{ - ResumeOperation resume = 7; - ResetOperation reset = 8; + // either activity id or activity type must be provided + oneof activity { + // Only the activity with this ID will be unpaused. + string id = 4; + // Unpause all running activities with of this type. + string type = 5; + // Unpause all running activities. + bool unpause_all = 6; } + + // Providing this flag will also reset the number of attempts. + bool reset_attempts = 7; + + // Providing this flag will also reset the heartbeat details. + bool reset_heartbeat = 8; + + // If set, the activity will start at a random time within the specified jitter duration. + google.protobuf.Duration jitter = 9; } -message UnpauseActivityByIdResponse { +message UnpauseActivityResponse { } -message ResetActivityByIdRequest { +message ResetActivityRequest { // Namespace of the workflow which scheduled this activity. string namespace = 1; - // ID of the workflow which scheduled this activity. - string workflow_id = 2; - // Run ID of the workflow which scheduled this activity. - // If empty - latest workflow is used. - string run_id = 3; - // ID of the activity we're updating. - string activity_id = 4; + // Execution info of the workflow which scheduled this activity + temporal.api.common.v1.WorkflowExecution execution = 2; // The identity of the client who initiated this request. - string identity = 5; - - // Used to de-dupe requests. - string request_id = 6; + string identity = 3; - // Indicates that activity should be scheduled immediately. - // If this flag doesn't set, and activity currently running - temporal will wait until activity is completed. - bool no_wait = 7; + // either activity id or activity type must be provided + oneof activity { + // Only activity with this ID will be reset. + string id = 4; + // Reset all running activities with of this type. + string type = 5; + } // Indicates that activity should reset heartbeat details. // This flag will be applied only to the new instance of the activity. - bool reset_heartbeat = 8; + bool reset_heartbeat = 6; + + // if activity is paused, it will remain paused after reset + bool keep_paused = 7; + + // If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration. + // (unless it is paused and keep_paused is set) + google.protobuf.Duration jitter = 8; } -message ResetActivityByIdResponse { +message ResetActivityResponse { } message UpdateWorkflowExecutionOptionsRequest { diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 0a6c8308..f60b1027 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -920,15 +920,14 @@ service WorkflowService { rpc RespondNexusTaskFailed(RespondNexusTaskFailedRequest) returns (RespondNexusTaskFailedResponse) { } - // UpdateActivityOptionsById is called by the client to update the options of an activity - // (-- api-linter: core::0136::prepositions=disabled - // aip.dev/not-precedent: "By" is used to indicate request type. --) - rpc UpdateActivityOptionsById (UpdateActivityOptionsByIdRequest) returns (UpdateActivityOptionsByIdResponse) { + // UpdateActivityOptions is called by the client to update the options of an activity by its ID or type. + // If there are multiple pending activities of the provided type - all of them will be updated. + rpc UpdateActivityOptions (UpdateActivityOptionsRequest) returns (UpdateActivityOptionsResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/activities/update-options-by-id" + post: "/namespaces/{namespace}/activities/update-options" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/activities/update-options-by-id" + post: "/api/v1/namespaces/{namespace}/activities/update-options" body: "*" } }; @@ -946,8 +945,8 @@ service WorkflowService { }; } - // PauseActivityById pauses the execution of an activity specified by its ID. - // Returns a `NotFound` error if there is no pending activity with the provided ID. + // PauseActivity pauses the execution of an activity specified by its ID or type. + // If there are multiple pending activities of the provided type - all of them will be paused // // Pausing an activity means: // - If the activity is currently waiting for a retry or is running and subsequently fails, @@ -960,64 +959,68 @@ service WorkflowService { // For long-running activities: // - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. // - The activity should respond to the cancellation accordingly. - // (-- api-linter: core::0136::prepositions=disabled - // aip.dev/not-precedent: "By" is used to indicate request type. --) - rpc PauseActivityById (PauseActivityByIdRequest) returns (PauseActivityByIdResponse) { + // + // Returns a `NotFound` error if there is no pending activity with the provided ID or type + rpc PauseActivity (PauseActivityRequest) returns (PauseActivityResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/activities/pause-by-id" + post: "/namespaces/{namespace}/activities/pause" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/activities/pause-by-id" + post: "/api/v1/namespaces/{namespace}/activities/pause" body: "*" } }; } - // UnpauseActivityById unpauses the execution of an activity specified by its ID. - // Returns a `NotFound` error if there is no pending activity with the provided ID. - // There are two 'modes' of unpausing an activity: - // 'resume' - If the activity is paused, it will be resumed and scheduled for execution. - // * If the activity is currently running Unpause with 'resume' has no effect. - // * if 'no_wait' flag is set and the activity is waiting, the activity will be scheduled immediately. - // 'reset' - If the activity is paused, it will be reset to its initial state and (depending on parameters) scheduled for execution. - // * If the activity is currently running, Unpause with 'reset' will reset the number of attempts. - // * if 'no_wait' flag is set, the activity will be scheduled immediately. - // * if 'reset_heartbeats' flag is set, the activity heartbeat timer and heartbeats will be reset. - // If the activity is in waiting for retry and past it retry timeout, it will be scheduled immediately. + // UnpauseActivity unpauses the execution of an activity specified by its ID or type. + // If there are multiple pending activities of the provided type - all of them will be unpaused. + // + // If activity is not paused, this call will have no effect. + // If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). // Once the activity is unpaused, all timeout timers will be regenerated. - // (-- api-linter: core::0136::prepositions=disabled - // aip.dev/not-precedent: "By" is used to indicate request type. --) - rpc UnpauseActivityById (UnpauseActivityByIdRequest) returns (UnpauseActivityByIdResponse) { + // + // Flags: + // 'jitter': the activity will be scheduled at a random time within the jitter duration. + // 'reset_attempts': the number of attempts will be reset. + // 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. + // + // Returns a `NotFound` error if there is no pending activity with the provided ID or type + rpc UnpauseActivity (UnpauseActivityRequest) returns (UnpauseActivityResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/activities/unpause-by-id" + post: "/namespaces/{namespace}/activities/unpause" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/activities/unpause-by-id" + post: "/api/v1/namespaces/{namespace}/activities/unpause" body: "*" } }; } - // ResetActivityById unpauses the execution of an activity specified by its ID. - // Returns a `NotFound` error if there is no pending activity with the provided ID. + // ResetActivity resets the execution of an activity specified by its ID or type. + // If there are multiple pending activities of the provided type - all of them will be reset. + // // Resetting an activity means: // * number of attempts will be reset to 0. - // * activity timeouts will be resetted. - // If the activity currently running: - // * if 'no_wait' flag is provided, a new instance of the activity will be scheduled immediately. - // * if 'no_wait' flag is not provided, a new instance of the activity will be scheduled after current instance completes if needed. - // If 'reset_heartbeats' flag is set, the activity heartbeat timer and heartbeats will be reset. - // (-- api-linter: core::0136::prepositions=disabled - // aip.dev/not-precedent: "By" is used to indicate request type. --) - rpc ResetActivityById (ResetActivityByIdRequest) returns (ResetActivityByIdResponse) { + // * activity timeouts will be reset. + // * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: + // it will be scheduled immediately (* see 'jitter' flag), + // + // Flags: + // + // 'jitter': the activity will be scheduled at a random time within the jitter duration. + // If the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided. + // 'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset. + // 'keep_paused': if the activity is paused, it will remain paused. + // + // Returns a `NotFound` error if there is no pending activity with the provided ID or type. + rpc ResetActivity (ResetActivityRequest) returns (ResetActivityResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/activities/reset-by-id" + post: "/namespaces/{namespace}/activities/reset" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/activities/reset-by-id" + post: "/api/v1/namespaces/{namespace}/activities/reset" body: "*" } }; } } -