Skip to content

Commit 57803a3

Browse files
authored
batch: add operations for reset and update-options activities (#615)
<!-- Describe what has changed in this PR --> Description: Add an operation for batch reset and update-options of activities <!-- Tell your future self why have you made these changes --> Why: To support batching these changes <!-- Are there any breaking changes on binary or code level? --> No breaking changes [Server PR](https://github.com/temporalio/temporal/pull/8061/files)
1 parent 79a8358 commit 57803a3

File tree

5 files changed

+244
-14
lines changed

5 files changed

+244
-14
lines changed

openapi/openapiv2.json

Lines changed: 89 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7804,13 +7804,17 @@
78047804
"type": "string",
78057805
"description": "Reset all running activities with of this type."
78067806
},
7807+
"matchAll": {
7808+
"type": "boolean",
7809+
"description": "Reset all running activities."
7810+
},
78077811
"resetHeartbeat": {
78087812
"type": "boolean",
78097813
"description": "Indicates that activity should reset heartbeat details.\nThis flag will be applied only to the new instance of the activity."
78107814
},
78117815
"keepPaused": {
78127816
"type": "boolean",
7813-
"title": "if activity is paused, it will remain paused after reset"
7817+
"title": "If activity is paused, it will remain paused after reset"
78147818
},
78157819
"jitter": {
78167820
"type": "string",
@@ -7820,7 +7824,8 @@
78207824
"type": "boolean",
78217825
"description": "If set, the activity options will be restored to the defaults.\nDefault options are then options activity was created with.\nThey are part of the first SCHEDULE event."
78227826
}
7823-
}
7827+
},
7828+
"title": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities"
78247829
},
78257830
"WorkflowServiceResetWorkflowExecutionBody": {
78267831
"type": "object",
@@ -8312,6 +8317,12 @@
83128317
},
83138318
"unpauseActivitiesOperation": {
83148319
"$ref": "#/definitions/v1BatchOperationUnpauseActivities"
8320+
},
8321+
"resetActivitiesOperation": {
8322+
"$ref": "#/definitions/v1BatchOperationResetActivities"
8323+
},
8324+
"updateActivityOptionsOperation": {
8325+
"$ref": "#/definitions/v1BatchOperationUpdateActivityOptions"
83158326
}
83168327
}
83178328
},
@@ -8561,11 +8572,16 @@
85618572
"type": "string",
85628573
"description": "Update all running activities of this type."
85638574
},
8575+
"matchAll": {
8576+
"type": "boolean",
8577+
"description": "Update all running activities."
8578+
},
85648579
"restoreOriginal": {
85658580
"type": "boolean",
85668581
"description": "If set, the activity options will be restored to the default.\nDefault options are then options activity was created with.\nThey are part of the first SCHEDULE event.\nThis flag cannot be combined with any other option; if you supply\nrestore_original together with other options, the request will be rejected."
85678582
}
8568-
}
8583+
},
8584+
"title": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions"
85698585
},
85708586
"WorkflowServiceUpdateNamespaceBody": {
85718587
"type": "object",
@@ -9377,6 +9393,42 @@
93779393
},
93789394
"description": "BatchOperationReset sends reset requests to batch workflows.\nKeep the parameter in sync with temporal.api.workflowservice.v1.ResetWorkflowExecutionRequest."
93799395
},
9396+
"v1BatchOperationResetActivities": {
9397+
"type": "object",
9398+
"properties": {
9399+
"identity": {
9400+
"type": "string",
9401+
"description": "The identity of the worker/client."
9402+
},
9403+
"type": {
9404+
"type": "string"
9405+
},
9406+
"matchAll": {
9407+
"type": "boolean"
9408+
},
9409+
"resetAttempts": {
9410+
"type": "boolean",
9411+
"description": "Setting this flag will also reset the number of attempts."
9412+
},
9413+
"resetHeartbeat": {
9414+
"type": "boolean",
9415+
"description": "Setting this flag will also reset the heartbeat details."
9416+
},
9417+
"keepPaused": {
9418+
"type": "boolean",
9419+
"title": "If activity is paused, it will remain paused after reset"
9420+
},
9421+
"jitter": {
9422+
"type": "string",
9423+
"description": "If set, the activity will start at a random time within the specified jitter\nduration, introducing variability to the start time."
9424+
},
9425+
"restoreOriginalOptions": {
9426+
"type": "boolean",
9427+
"description": "If set, the activity options will be restored to the defaults.\nDefault options are then options activity was created with.\nThey are part of the first ActivityTaskScheduled event."
9428+
}
9429+
},
9430+
"title": "BatchOperationResetActivities sends activity reset requests in a batch.\nNOTE: keep in sync with temporal.api.workflowservice.v1.ResetActivityRequest"
9431+
},
93809432
"v1BatchOperationSignal": {
93819433
"type": "object",
93829434
"properties": {
@@ -9432,7 +9484,10 @@
94329484
"BATCH_OPERATION_TYPE_SIGNAL",
94339485
"BATCH_OPERATION_TYPE_DELETE",
94349486
"BATCH_OPERATION_TYPE_RESET",
9435-
"BATCH_OPERATION_TYPE_UPDATE_EXECUTION_OPTIONS"
9487+
"BATCH_OPERATION_TYPE_UPDATE_EXECUTION_OPTIONS",
9488+
"BATCH_OPERATION_TYPE_UNPAUSE_ACTIVITY",
9489+
"BATCH_OPERATION_TYPE_UPDATE_ACTIVITY_OPTIONS",
9490+
"BATCH_OPERATION_TYPE_RESET_ACTIVITY"
94369491
],
94379492
"default": "BATCH_OPERATION_TYPE_UNSPECIFIED"
94389493
},
@@ -9451,11 +9506,11 @@
94519506
},
94529507
"resetAttempts": {
94539508
"type": "boolean",
9454-
"description": "Providing this flag will also reset the number of attempts."
9509+
"description": "Setting this flag will also reset the number of attempts."
94559510
},
94569511
"resetHeartbeat": {
94579512
"type": "boolean",
9458-
"description": "Providing this flag will also reset the heartbeat details."
9513+
"description": "Setting this flag will also reset the heartbeat details."
94599514
},
94609515
"jitter": {
94619516
"type": "string",
@@ -9464,6 +9519,34 @@
94649519
},
94659520
"description": "BatchOperationUnpauseActivities sends unpause requests to batch workflows."
94669521
},
9522+
"v1BatchOperationUpdateActivityOptions": {
9523+
"type": "object",
9524+
"properties": {
9525+
"identity": {
9526+
"type": "string",
9527+
"description": "The identity of the worker/client."
9528+
},
9529+
"type": {
9530+
"type": "string"
9531+
},
9532+
"matchAll": {
9533+
"type": "boolean"
9534+
},
9535+
"activityOptions": {
9536+
"$ref": "#/definitions/v1ActivityOptions",
9537+
"description": "Update Activity options. Partial updates are accepted and controlled by update_mask."
9538+
},
9539+
"updateMask": {
9540+
"type": "string",
9541+
"title": "Controls which fields from `activity_options` will be applied"
9542+
},
9543+
"restoreOriginal": {
9544+
"type": "boolean",
9545+
"description": "If set, the activity options will be restored to the default.\nDefault options are then options activity was created with.\nThey are part of the first ActivityTaskScheduled event.\nThis flag cannot be combined with any other option; if you supply\nrestore_original together with other options, the request will be rejected."
9546+
}
9547+
},
9548+
"title": "BatchOperationUpdateActivityOptions sends an update-activity-options requests in a batch.\nNOTE: keep in sync with temporal.api.workflowservice.v1.UpdateActivityRequest"
9549+
},
94679550
"v1BatchOperationUpdateWorkflowExecutionOptions": {
94689551
"type": "object",
94699552
"properties": {

openapi/openapiv3.yaml

Lines changed: 81 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6715,6 +6715,40 @@ components:
67156715
description: |-
67166716
BatchOperationReset sends reset requests to batch workflows.
67176717
Keep the parameter in sync with temporal.api.workflowservice.v1.ResetWorkflowExecutionRequest.
6718+
BatchOperationResetActivities:
6719+
type: object
6720+
properties:
6721+
identity:
6722+
type: string
6723+
description: The identity of the worker/client.
6724+
type:
6725+
type: string
6726+
matchAll:
6727+
type: boolean
6728+
resetAttempts:
6729+
type: boolean
6730+
description: Setting this flag will also reset the number of attempts.
6731+
resetHeartbeat:
6732+
type: boolean
6733+
description: Setting this flag will also reset the heartbeat details.
6734+
keepPaused:
6735+
type: boolean
6736+
description: If activity is paused, it will remain paused after reset
6737+
jitter:
6738+
pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
6739+
type: string
6740+
description: |-
6741+
If set, the activity will start at a random time within the specified jitter
6742+
duration, introducing variability to the start time.
6743+
restoreOriginalOptions:
6744+
type: boolean
6745+
description: |-
6746+
If set, the activity options will be restored to the defaults.
6747+
Default options are then options activity was created with.
6748+
They are part of the first ActivityTaskScheduled event.
6749+
description: |-
6750+
BatchOperationResetActivities sends activity reset requests in a batch.
6751+
NOTE: keep in sync with temporal.api.workflowservice.v1.ResetActivityRequest
67186752
BatchOperationSignal:
67196753
type: object
67206754
properties:
@@ -6763,17 +6797,46 @@ components:
67636797
type: boolean
67646798
resetAttempts:
67656799
type: boolean
6766-
description: Providing this flag will also reset the number of attempts.
6800+
description: Setting this flag will also reset the number of attempts.
67676801
resetHeartbeat:
67686802
type: boolean
6769-
description: Providing this flag will also reset the heartbeat details.
6803+
description: Setting this flag will also reset the heartbeat details.
67706804
jitter:
67716805
pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
67726806
type: string
67736807
description: |-
67746808
If set, the activity will start at a random time within the specified jitter
67756809
duration, introducing variability to the start time.
67766810
description: BatchOperationUnpauseActivities sends unpause requests to batch workflows.
6811+
BatchOperationUpdateActivityOptions:
6812+
type: object
6813+
properties:
6814+
identity:
6815+
type: string
6816+
description: The identity of the worker/client.
6817+
type:
6818+
type: string
6819+
matchAll:
6820+
type: boolean
6821+
activityOptions:
6822+
allOf:
6823+
- $ref: '#/components/schemas/ActivityOptions'
6824+
description: Update Activity options. Partial updates are accepted and controlled by update_mask.
6825+
updateMask:
6826+
type: string
6827+
description: Controls which fields from `activity_options` will be applied
6828+
format: field-mask
6829+
restoreOriginal:
6830+
type: boolean
6831+
description: |-
6832+
If set, the activity options will be restored to the default.
6833+
Default options are then options activity was created with.
6834+
They are part of the first ActivityTaskScheduled event.
6835+
This flag cannot be combined with any other option; if you supply
6836+
restore_original together with other options, the request will be rejected.
6837+
description: |-
6838+
BatchOperationUpdateActivityOptions sends an update-activity-options requests in a batch.
6839+
NOTE: keep in sync with temporal.api.workflowservice.v1.UpdateActivityRequest
67776840
BatchOperationUpdateWorkflowExecutionOptions:
67786841
type: object
67796842
properties:
@@ -7503,6 +7566,9 @@ components:
75037566
- BATCH_OPERATION_TYPE_DELETE
75047567
- BATCH_OPERATION_TYPE_RESET
75057568
- BATCH_OPERATION_TYPE_UPDATE_EXECUTION_OPTIONS
7569+
- BATCH_OPERATION_TYPE_UNPAUSE_ACTIVITY
7570+
- BATCH_OPERATION_TYPE_UPDATE_ACTIVITY_OPTIONS
7571+
- BATCH_OPERATION_TYPE_RESET_ACTIVITY
75067572
type: string
75077573
description: Batch operation type
75087574
format: enum
@@ -10128,14 +10194,17 @@ components:
1012810194
type:
1012910195
type: string
1013010196
description: Reset all running activities with of this type.
10197+
matchAll:
10198+
type: boolean
10199+
description: Reset all running activities.
1013110200
resetHeartbeat:
1013210201
type: boolean
1013310202
description: |-
1013410203
Indicates that activity should reset heartbeat details.
1013510204
This flag will be applied only to the new instance of the activity.
1013610205
keepPaused:
1013710206
type: boolean
10138-
description: if activity is paused, it will remain paused after reset
10207+
description: If activity is paused, it will remain paused after reset
1013910208
jitter:
1014010209
pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
1014110210
type: string
@@ -10148,6 +10217,7 @@ components:
1014810217
If set, the activity options will be restored to the defaults.
1014910218
Default options are then options activity was created with.
1015010219
They are part of the first SCHEDULE event.
10220+
description: 'NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities'
1015110221
ResetActivityResponse:
1015210222
type: object
1015310223
properties: {}
@@ -11401,6 +11471,10 @@ components:
1140111471
$ref: '#/components/schemas/BatchOperationUpdateWorkflowExecutionOptions'
1140211472
unpauseActivitiesOperation:
1140311473
$ref: '#/components/schemas/BatchOperationUnpauseActivities'
11474+
resetActivitiesOperation:
11475+
$ref: '#/components/schemas/BatchOperationResetActivities'
11476+
updateActivityOptionsOperation:
11477+
$ref: '#/components/schemas/BatchOperationUpdateActivityOptions'
1140411478
StartBatchOperationResponse:
1140511479
type: object
1140611480
properties: {}
@@ -12191,6 +12265,9 @@ components:
1219112265
type:
1219212266
type: string
1219312267
description: Update all running activities of this type.
12268+
matchAll:
12269+
type: boolean
12270+
description: Update all running activities.
1219412271
restoreOriginal:
1219512272
type: boolean
1219612273
description: |-
@@ -12199,6 +12276,7 @@ components:
1219912276
They are part of the first SCHEDULE event.
1220012277
This flag cannot be combined with any other option; if you supply
1220112278
restore_original together with other options, the request will be rejected.
12279+
description: 'NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions'
1220212280
UpdateActivityOptionsResponse:
1220312281
type: object
1220412282
properties:

0 commit comments

Comments
 (0)