hatchet-sdk 1.0.0__py3-none-any.whl → 1.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of hatchet-sdk might be problematic. Click here for more details.
- hatchet_sdk/__init__.py +32 -16
- hatchet_sdk/client.py +25 -63
- hatchet_sdk/clients/admin.py +203 -142
- hatchet_sdk/clients/dispatcher/action_listener.py +42 -42
- hatchet_sdk/clients/dispatcher/dispatcher.py +18 -16
- hatchet_sdk/clients/durable_event_listener.py +327 -0
- hatchet_sdk/clients/rest/__init__.py +12 -1
- hatchet_sdk/clients/rest/api/log_api.py +258 -0
- hatchet_sdk/clients/rest/api/task_api.py +32 -6
- hatchet_sdk/clients/rest/api/workflow_runs_api.py +626 -0
- hatchet_sdk/clients/rest/models/__init__.py +12 -1
- hatchet_sdk/clients/rest/models/v1_log_line.py +94 -0
- hatchet_sdk/clients/rest/models/v1_log_line_level.py +39 -0
- hatchet_sdk/clients/rest/models/v1_log_line_list.py +110 -0
- hatchet_sdk/clients/rest/models/v1_task_summary.py +80 -64
- hatchet_sdk/clients/rest/models/v1_trigger_workflow_run_request.py +95 -0
- hatchet_sdk/clients/rest/models/v1_workflow_run_display_name.py +98 -0
- hatchet_sdk/clients/rest/models/v1_workflow_run_display_name_list.py +114 -0
- hatchet_sdk/clients/rest/models/workflow_run_shape_item_for_workflow_run_details.py +9 -4
- hatchet_sdk/clients/rest/models/workflow_runs_metrics.py +5 -1
- hatchet_sdk/clients/run_event_listener.py +0 -1
- hatchet_sdk/clients/v1/api_client.py +81 -0
- hatchet_sdk/context/context.py +86 -159
- hatchet_sdk/contracts/dispatcher_pb2_grpc.py +1 -1
- hatchet_sdk/contracts/events_pb2.py +2 -2
- hatchet_sdk/contracts/events_pb2_grpc.py +1 -1
- hatchet_sdk/contracts/v1/dispatcher_pb2.py +36 -0
- hatchet_sdk/contracts/v1/dispatcher_pb2.pyi +38 -0
- hatchet_sdk/contracts/v1/dispatcher_pb2_grpc.py +145 -0
- hatchet_sdk/contracts/v1/shared/condition_pb2.py +39 -0
- hatchet_sdk/contracts/v1/shared/condition_pb2.pyi +72 -0
- hatchet_sdk/contracts/v1/shared/condition_pb2_grpc.py +29 -0
- hatchet_sdk/contracts/v1/workflows_pb2.py +67 -0
- hatchet_sdk/contracts/v1/workflows_pb2.pyi +228 -0
- hatchet_sdk/contracts/v1/workflows_pb2_grpc.py +234 -0
- hatchet_sdk/contracts/workflows_pb2_grpc.py +1 -1
- hatchet_sdk/features/cron.py +91 -121
- hatchet_sdk/features/logs.py +16 -0
- hatchet_sdk/features/metrics.py +75 -0
- hatchet_sdk/features/rate_limits.py +45 -0
- hatchet_sdk/features/runs.py +221 -0
- hatchet_sdk/features/scheduled.py +114 -131
- hatchet_sdk/features/workers.py +41 -0
- hatchet_sdk/features/workflows.py +55 -0
- hatchet_sdk/hatchet.py +463 -165
- hatchet_sdk/opentelemetry/instrumentor.py +8 -13
- hatchet_sdk/rate_limit.py +33 -39
- hatchet_sdk/runnables/contextvars.py +12 -0
- hatchet_sdk/runnables/standalone.py +192 -0
- hatchet_sdk/runnables/task.py +144 -0
- hatchet_sdk/runnables/types.py +138 -0
- hatchet_sdk/runnables/workflow.py +771 -0
- hatchet_sdk/utils/aio_utils.py +0 -79
- hatchet_sdk/utils/proto_enums.py +0 -7
- hatchet_sdk/utils/timedelta_to_expression.py +23 -0
- hatchet_sdk/utils/typing.py +2 -2
- hatchet_sdk/v0/clients/rest_client.py +9 -0
- hatchet_sdk/v0/worker/action_listener_process.py +18 -2
- hatchet_sdk/waits.py +120 -0
- hatchet_sdk/worker/action_listener_process.py +64 -30
- hatchet_sdk/worker/runner/run_loop_manager.py +35 -26
- hatchet_sdk/worker/runner/runner.py +72 -55
- hatchet_sdk/worker/runner/utils/capture_logs.py +3 -11
- hatchet_sdk/worker/worker.py +155 -118
- hatchet_sdk/workflow_run.py +4 -5
- {hatchet_sdk-1.0.0.dist-info → hatchet_sdk-1.0.1.dist-info}/METADATA +1 -2
- {hatchet_sdk-1.0.0.dist-info → hatchet_sdk-1.0.1.dist-info}/RECORD +69 -43
- {hatchet_sdk-1.0.0.dist-info → hatchet_sdk-1.0.1.dist-info}/entry_points.txt +2 -0
- hatchet_sdk/clients/rest_client.py +0 -636
- hatchet_sdk/semver.py +0 -30
- hatchet_sdk/worker/runner/utils/error_with_traceback.py +0 -6
- hatchet_sdk/workflow.py +0 -527
- {hatchet_sdk-1.0.0.dist-info → hatchet_sdk-1.0.1.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
from google.protobuf import timestamp_pb2 as _timestamp_pb2
|
|
2
|
+
from hatchet_sdk.contracts.v1.shared import condition_pb2 as _condition_pb2
|
|
3
|
+
from google.protobuf.internal import containers as _containers
|
|
4
|
+
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
|
|
5
|
+
from google.protobuf import descriptor as _descriptor
|
|
6
|
+
from google.protobuf import message as _message
|
|
7
|
+
from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
|
|
8
|
+
|
|
9
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
10
|
+
|
|
11
|
+
class StickyStrategy(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
12
|
+
__slots__ = ()
|
|
13
|
+
SOFT: _ClassVar[StickyStrategy]
|
|
14
|
+
HARD: _ClassVar[StickyStrategy]
|
|
15
|
+
|
|
16
|
+
class RateLimitDuration(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
17
|
+
__slots__ = ()
|
|
18
|
+
SECOND: _ClassVar[RateLimitDuration]
|
|
19
|
+
MINUTE: _ClassVar[RateLimitDuration]
|
|
20
|
+
HOUR: _ClassVar[RateLimitDuration]
|
|
21
|
+
DAY: _ClassVar[RateLimitDuration]
|
|
22
|
+
WEEK: _ClassVar[RateLimitDuration]
|
|
23
|
+
MONTH: _ClassVar[RateLimitDuration]
|
|
24
|
+
YEAR: _ClassVar[RateLimitDuration]
|
|
25
|
+
|
|
26
|
+
class ConcurrencyLimitStrategy(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
27
|
+
__slots__ = ()
|
|
28
|
+
CANCEL_IN_PROGRESS: _ClassVar[ConcurrencyLimitStrategy]
|
|
29
|
+
DROP_NEWEST: _ClassVar[ConcurrencyLimitStrategy]
|
|
30
|
+
QUEUE_NEWEST: _ClassVar[ConcurrencyLimitStrategy]
|
|
31
|
+
GROUP_ROUND_ROBIN: _ClassVar[ConcurrencyLimitStrategy]
|
|
32
|
+
CANCEL_NEWEST: _ClassVar[ConcurrencyLimitStrategy]
|
|
33
|
+
|
|
34
|
+
class WorkerLabelComparator(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
35
|
+
__slots__ = ()
|
|
36
|
+
EQUAL: _ClassVar[WorkerLabelComparator]
|
|
37
|
+
NOT_EQUAL: _ClassVar[WorkerLabelComparator]
|
|
38
|
+
GREATER_THAN: _ClassVar[WorkerLabelComparator]
|
|
39
|
+
GREATER_THAN_OR_EQUAL: _ClassVar[WorkerLabelComparator]
|
|
40
|
+
LESS_THAN: _ClassVar[WorkerLabelComparator]
|
|
41
|
+
LESS_THAN_OR_EQUAL: _ClassVar[WorkerLabelComparator]
|
|
42
|
+
SOFT: StickyStrategy
|
|
43
|
+
HARD: StickyStrategy
|
|
44
|
+
SECOND: RateLimitDuration
|
|
45
|
+
MINUTE: RateLimitDuration
|
|
46
|
+
HOUR: RateLimitDuration
|
|
47
|
+
DAY: RateLimitDuration
|
|
48
|
+
WEEK: RateLimitDuration
|
|
49
|
+
MONTH: RateLimitDuration
|
|
50
|
+
YEAR: RateLimitDuration
|
|
51
|
+
CANCEL_IN_PROGRESS: ConcurrencyLimitStrategy
|
|
52
|
+
DROP_NEWEST: ConcurrencyLimitStrategy
|
|
53
|
+
QUEUE_NEWEST: ConcurrencyLimitStrategy
|
|
54
|
+
GROUP_ROUND_ROBIN: ConcurrencyLimitStrategy
|
|
55
|
+
CANCEL_NEWEST: ConcurrencyLimitStrategy
|
|
56
|
+
EQUAL: WorkerLabelComparator
|
|
57
|
+
NOT_EQUAL: WorkerLabelComparator
|
|
58
|
+
GREATER_THAN: WorkerLabelComparator
|
|
59
|
+
GREATER_THAN_OR_EQUAL: WorkerLabelComparator
|
|
60
|
+
LESS_THAN: WorkerLabelComparator
|
|
61
|
+
LESS_THAN_OR_EQUAL: WorkerLabelComparator
|
|
62
|
+
|
|
63
|
+
class CancelTasksRequest(_message.Message):
|
|
64
|
+
__slots__ = ("externalIds", "filter")
|
|
65
|
+
EXTERNALIDS_FIELD_NUMBER: _ClassVar[int]
|
|
66
|
+
FILTER_FIELD_NUMBER: _ClassVar[int]
|
|
67
|
+
externalIds: _containers.RepeatedScalarFieldContainer[str]
|
|
68
|
+
filter: TasksFilter
|
|
69
|
+
def __init__(self, externalIds: _Optional[_Iterable[str]] = ..., filter: _Optional[_Union[TasksFilter, _Mapping]] = ...) -> None: ...
|
|
70
|
+
|
|
71
|
+
class ReplayTasksRequest(_message.Message):
|
|
72
|
+
__slots__ = ("externalIds", "filter")
|
|
73
|
+
EXTERNALIDS_FIELD_NUMBER: _ClassVar[int]
|
|
74
|
+
FILTER_FIELD_NUMBER: _ClassVar[int]
|
|
75
|
+
externalIds: _containers.RepeatedScalarFieldContainer[str]
|
|
76
|
+
filter: TasksFilter
|
|
77
|
+
def __init__(self, externalIds: _Optional[_Iterable[str]] = ..., filter: _Optional[_Union[TasksFilter, _Mapping]] = ...) -> None: ...
|
|
78
|
+
|
|
79
|
+
class TasksFilter(_message.Message):
|
|
80
|
+
__slots__ = ("statuses", "since", "until", "workflow_ids", "additional_metadata")
|
|
81
|
+
STATUSES_FIELD_NUMBER: _ClassVar[int]
|
|
82
|
+
SINCE_FIELD_NUMBER: _ClassVar[int]
|
|
83
|
+
UNTIL_FIELD_NUMBER: _ClassVar[int]
|
|
84
|
+
WORKFLOW_IDS_FIELD_NUMBER: _ClassVar[int]
|
|
85
|
+
ADDITIONAL_METADATA_FIELD_NUMBER: _ClassVar[int]
|
|
86
|
+
statuses: _containers.RepeatedScalarFieldContainer[str]
|
|
87
|
+
since: _timestamp_pb2.Timestamp
|
|
88
|
+
until: _timestamp_pb2.Timestamp
|
|
89
|
+
workflow_ids: _containers.RepeatedScalarFieldContainer[str]
|
|
90
|
+
additional_metadata: _containers.RepeatedScalarFieldContainer[str]
|
|
91
|
+
def __init__(self, statuses: _Optional[_Iterable[str]] = ..., since: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., until: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., workflow_ids: _Optional[_Iterable[str]] = ..., additional_metadata: _Optional[_Iterable[str]] = ...) -> None: ...
|
|
92
|
+
|
|
93
|
+
class CancelTasksResponse(_message.Message):
|
|
94
|
+
__slots__ = ("cancelled_tasks",)
|
|
95
|
+
CANCELLED_TASKS_FIELD_NUMBER: _ClassVar[int]
|
|
96
|
+
cancelled_tasks: _containers.RepeatedScalarFieldContainer[str]
|
|
97
|
+
def __init__(self, cancelled_tasks: _Optional[_Iterable[str]] = ...) -> None: ...
|
|
98
|
+
|
|
99
|
+
class ReplayTasksResponse(_message.Message):
|
|
100
|
+
__slots__ = ("replayed_tasks",)
|
|
101
|
+
REPLAYED_TASKS_FIELD_NUMBER: _ClassVar[int]
|
|
102
|
+
replayed_tasks: _containers.RepeatedScalarFieldContainer[str]
|
|
103
|
+
def __init__(self, replayed_tasks: _Optional[_Iterable[str]] = ...) -> None: ...
|
|
104
|
+
|
|
105
|
+
class TriggerWorkflowRunRequest(_message.Message):
|
|
106
|
+
__slots__ = ("workflow_name", "input", "additional_metadata")
|
|
107
|
+
WORKFLOW_NAME_FIELD_NUMBER: _ClassVar[int]
|
|
108
|
+
INPUT_FIELD_NUMBER: _ClassVar[int]
|
|
109
|
+
ADDITIONAL_METADATA_FIELD_NUMBER: _ClassVar[int]
|
|
110
|
+
workflow_name: str
|
|
111
|
+
input: bytes
|
|
112
|
+
additional_metadata: bytes
|
|
113
|
+
def __init__(self, workflow_name: _Optional[str] = ..., input: _Optional[bytes] = ..., additional_metadata: _Optional[bytes] = ...) -> None: ...
|
|
114
|
+
|
|
115
|
+
class TriggerWorkflowRunResponse(_message.Message):
|
|
116
|
+
__slots__ = ("external_id",)
|
|
117
|
+
EXTERNAL_ID_FIELD_NUMBER: _ClassVar[int]
|
|
118
|
+
external_id: str
|
|
119
|
+
def __init__(self, external_id: _Optional[str] = ...) -> None: ...
|
|
120
|
+
|
|
121
|
+
class CreateWorkflowVersionRequest(_message.Message):
|
|
122
|
+
__slots__ = ("name", "description", "version", "event_triggers", "cron_triggers", "tasks", "concurrency", "cron_input", "on_failure_task", "sticky")
|
|
123
|
+
NAME_FIELD_NUMBER: _ClassVar[int]
|
|
124
|
+
DESCRIPTION_FIELD_NUMBER: _ClassVar[int]
|
|
125
|
+
VERSION_FIELD_NUMBER: _ClassVar[int]
|
|
126
|
+
EVENT_TRIGGERS_FIELD_NUMBER: _ClassVar[int]
|
|
127
|
+
CRON_TRIGGERS_FIELD_NUMBER: _ClassVar[int]
|
|
128
|
+
TASKS_FIELD_NUMBER: _ClassVar[int]
|
|
129
|
+
CONCURRENCY_FIELD_NUMBER: _ClassVar[int]
|
|
130
|
+
CRON_INPUT_FIELD_NUMBER: _ClassVar[int]
|
|
131
|
+
ON_FAILURE_TASK_FIELD_NUMBER: _ClassVar[int]
|
|
132
|
+
STICKY_FIELD_NUMBER: _ClassVar[int]
|
|
133
|
+
name: str
|
|
134
|
+
description: str
|
|
135
|
+
version: str
|
|
136
|
+
event_triggers: _containers.RepeatedScalarFieldContainer[str]
|
|
137
|
+
cron_triggers: _containers.RepeatedScalarFieldContainer[str]
|
|
138
|
+
tasks: _containers.RepeatedCompositeFieldContainer[CreateTaskOpts]
|
|
139
|
+
concurrency: Concurrency
|
|
140
|
+
cron_input: str
|
|
141
|
+
on_failure_task: CreateTaskOpts
|
|
142
|
+
sticky: StickyStrategy
|
|
143
|
+
def __init__(self, name: _Optional[str] = ..., description: _Optional[str] = ..., version: _Optional[str] = ..., event_triggers: _Optional[_Iterable[str]] = ..., cron_triggers: _Optional[_Iterable[str]] = ..., tasks: _Optional[_Iterable[_Union[CreateTaskOpts, _Mapping]]] = ..., concurrency: _Optional[_Union[Concurrency, _Mapping]] = ..., cron_input: _Optional[str] = ..., on_failure_task: _Optional[_Union[CreateTaskOpts, _Mapping]] = ..., sticky: _Optional[_Union[StickyStrategy, str]] = ...) -> None: ...
|
|
144
|
+
|
|
145
|
+
class Concurrency(_message.Message):
|
|
146
|
+
__slots__ = ("expression", "max_runs", "limit_strategy")
|
|
147
|
+
EXPRESSION_FIELD_NUMBER: _ClassVar[int]
|
|
148
|
+
MAX_RUNS_FIELD_NUMBER: _ClassVar[int]
|
|
149
|
+
LIMIT_STRATEGY_FIELD_NUMBER: _ClassVar[int]
|
|
150
|
+
expression: str
|
|
151
|
+
max_runs: int
|
|
152
|
+
limit_strategy: ConcurrencyLimitStrategy
|
|
153
|
+
def __init__(self, expression: _Optional[str] = ..., max_runs: _Optional[int] = ..., limit_strategy: _Optional[_Union[ConcurrencyLimitStrategy, str]] = ...) -> None: ...
|
|
154
|
+
|
|
155
|
+
class DesiredWorkerLabels(_message.Message):
|
|
156
|
+
__slots__ = ("strValue", "intValue", "required", "comparator", "weight")
|
|
157
|
+
STRVALUE_FIELD_NUMBER: _ClassVar[int]
|
|
158
|
+
INTVALUE_FIELD_NUMBER: _ClassVar[int]
|
|
159
|
+
REQUIRED_FIELD_NUMBER: _ClassVar[int]
|
|
160
|
+
COMPARATOR_FIELD_NUMBER: _ClassVar[int]
|
|
161
|
+
WEIGHT_FIELD_NUMBER: _ClassVar[int]
|
|
162
|
+
strValue: str
|
|
163
|
+
intValue: int
|
|
164
|
+
required: bool
|
|
165
|
+
comparator: WorkerLabelComparator
|
|
166
|
+
weight: int
|
|
167
|
+
def __init__(self, strValue: _Optional[str] = ..., intValue: _Optional[int] = ..., required: bool = ..., comparator: _Optional[_Union[WorkerLabelComparator, str]] = ..., weight: _Optional[int] = ...) -> None: ...
|
|
168
|
+
|
|
169
|
+
class CreateTaskOpts(_message.Message):
|
|
170
|
+
__slots__ = ("readable_id", "action", "timeout", "inputs", "parents", "retries", "rate_limits", "worker_labels", "backoff_factor", "backoff_max_seconds", "concurrency", "conditions", "schedule_timeout")
|
|
171
|
+
class WorkerLabelsEntry(_message.Message):
|
|
172
|
+
__slots__ = ("key", "value")
|
|
173
|
+
KEY_FIELD_NUMBER: _ClassVar[int]
|
|
174
|
+
VALUE_FIELD_NUMBER: _ClassVar[int]
|
|
175
|
+
key: str
|
|
176
|
+
value: DesiredWorkerLabels
|
|
177
|
+
def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[DesiredWorkerLabels, _Mapping]] = ...) -> None: ...
|
|
178
|
+
READABLE_ID_FIELD_NUMBER: _ClassVar[int]
|
|
179
|
+
ACTION_FIELD_NUMBER: _ClassVar[int]
|
|
180
|
+
TIMEOUT_FIELD_NUMBER: _ClassVar[int]
|
|
181
|
+
INPUTS_FIELD_NUMBER: _ClassVar[int]
|
|
182
|
+
PARENTS_FIELD_NUMBER: _ClassVar[int]
|
|
183
|
+
RETRIES_FIELD_NUMBER: _ClassVar[int]
|
|
184
|
+
RATE_LIMITS_FIELD_NUMBER: _ClassVar[int]
|
|
185
|
+
WORKER_LABELS_FIELD_NUMBER: _ClassVar[int]
|
|
186
|
+
BACKOFF_FACTOR_FIELD_NUMBER: _ClassVar[int]
|
|
187
|
+
BACKOFF_MAX_SECONDS_FIELD_NUMBER: _ClassVar[int]
|
|
188
|
+
CONCURRENCY_FIELD_NUMBER: _ClassVar[int]
|
|
189
|
+
CONDITIONS_FIELD_NUMBER: _ClassVar[int]
|
|
190
|
+
SCHEDULE_TIMEOUT_FIELD_NUMBER: _ClassVar[int]
|
|
191
|
+
readable_id: str
|
|
192
|
+
action: str
|
|
193
|
+
timeout: str
|
|
194
|
+
inputs: str
|
|
195
|
+
parents: _containers.RepeatedScalarFieldContainer[str]
|
|
196
|
+
retries: int
|
|
197
|
+
rate_limits: _containers.RepeatedCompositeFieldContainer[CreateTaskRateLimit]
|
|
198
|
+
worker_labels: _containers.MessageMap[str, DesiredWorkerLabels]
|
|
199
|
+
backoff_factor: float
|
|
200
|
+
backoff_max_seconds: int
|
|
201
|
+
concurrency: _containers.RepeatedCompositeFieldContainer[Concurrency]
|
|
202
|
+
conditions: _condition_pb2.TaskConditions
|
|
203
|
+
schedule_timeout: str
|
|
204
|
+
def __init__(self, readable_id: _Optional[str] = ..., action: _Optional[str] = ..., timeout: _Optional[str] = ..., inputs: _Optional[str] = ..., parents: _Optional[_Iterable[str]] = ..., retries: _Optional[int] = ..., rate_limits: _Optional[_Iterable[_Union[CreateTaskRateLimit, _Mapping]]] = ..., worker_labels: _Optional[_Mapping[str, DesiredWorkerLabels]] = ..., backoff_factor: _Optional[float] = ..., backoff_max_seconds: _Optional[int] = ..., concurrency: _Optional[_Iterable[_Union[Concurrency, _Mapping]]] = ..., conditions: _Optional[_Union[_condition_pb2.TaskConditions, _Mapping]] = ..., schedule_timeout: _Optional[str] = ...) -> None: ...
|
|
205
|
+
|
|
206
|
+
class CreateTaskRateLimit(_message.Message):
|
|
207
|
+
__slots__ = ("key", "units", "key_expr", "units_expr", "limit_values_expr", "duration")
|
|
208
|
+
KEY_FIELD_NUMBER: _ClassVar[int]
|
|
209
|
+
UNITS_FIELD_NUMBER: _ClassVar[int]
|
|
210
|
+
KEY_EXPR_FIELD_NUMBER: _ClassVar[int]
|
|
211
|
+
UNITS_EXPR_FIELD_NUMBER: _ClassVar[int]
|
|
212
|
+
LIMIT_VALUES_EXPR_FIELD_NUMBER: _ClassVar[int]
|
|
213
|
+
DURATION_FIELD_NUMBER: _ClassVar[int]
|
|
214
|
+
key: str
|
|
215
|
+
units: int
|
|
216
|
+
key_expr: str
|
|
217
|
+
units_expr: str
|
|
218
|
+
limit_values_expr: str
|
|
219
|
+
duration: RateLimitDuration
|
|
220
|
+
def __init__(self, key: _Optional[str] = ..., units: _Optional[int] = ..., key_expr: _Optional[str] = ..., units_expr: _Optional[str] = ..., limit_values_expr: _Optional[str] = ..., duration: _Optional[_Union[RateLimitDuration, str]] = ...) -> None: ...
|
|
221
|
+
|
|
222
|
+
class CreateWorkflowVersionResponse(_message.Message):
|
|
223
|
+
__slots__ = ("id", "workflow_id")
|
|
224
|
+
ID_FIELD_NUMBER: _ClassVar[int]
|
|
225
|
+
WORKFLOW_ID_FIELD_NUMBER: _ClassVar[int]
|
|
226
|
+
id: str
|
|
227
|
+
workflow_id: str
|
|
228
|
+
def __init__(self, id: _Optional[str] = ..., workflow_id: _Optional[str] = ...) -> None: ...
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
|
+
import grpc
|
|
4
|
+
import warnings
|
|
5
|
+
|
|
6
|
+
from hatchet_sdk.contracts.v1 import workflows_pb2 as v1_dot_workflows__pb2
|
|
7
|
+
|
|
8
|
+
GRPC_GENERATED_VERSION = '1.64.1'
|
|
9
|
+
GRPC_VERSION = grpc.__version__
|
|
10
|
+
EXPECTED_ERROR_RELEASE = '1.65.0'
|
|
11
|
+
SCHEDULED_RELEASE_DATE = 'June 25, 2024'
|
|
12
|
+
_version_not_supported = False
|
|
13
|
+
|
|
14
|
+
try:
|
|
15
|
+
from grpc._utilities import first_version_is_lower
|
|
16
|
+
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
|
|
17
|
+
except ImportError:
|
|
18
|
+
_version_not_supported = True
|
|
19
|
+
|
|
20
|
+
if _version_not_supported:
|
|
21
|
+
warnings.warn(
|
|
22
|
+
f'The grpc package installed is at version {GRPC_VERSION},'
|
|
23
|
+
+ f' but the generated code in v1/workflows_pb2_grpc.py depends on'
|
|
24
|
+
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
|
|
25
|
+
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
|
|
26
|
+
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
|
|
27
|
+
+ f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
|
|
28
|
+
+ f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
|
|
29
|
+
RuntimeWarning
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class AdminServiceStub(object):
|
|
34
|
+
"""AdminService represents a set of RPCs for admin management of tasks, workflows, etc.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
def __init__(self, channel):
|
|
38
|
+
"""Constructor.
|
|
39
|
+
|
|
40
|
+
Args:
|
|
41
|
+
channel: A grpc.Channel.
|
|
42
|
+
"""
|
|
43
|
+
self.PutWorkflow = channel.unary_unary(
|
|
44
|
+
'/v1.AdminService/PutWorkflow',
|
|
45
|
+
request_serializer=v1_dot_workflows__pb2.CreateWorkflowVersionRequest.SerializeToString,
|
|
46
|
+
response_deserializer=v1_dot_workflows__pb2.CreateWorkflowVersionResponse.FromString,
|
|
47
|
+
_registered_method=True)
|
|
48
|
+
self.CancelTasks = channel.unary_unary(
|
|
49
|
+
'/v1.AdminService/CancelTasks',
|
|
50
|
+
request_serializer=v1_dot_workflows__pb2.CancelTasksRequest.SerializeToString,
|
|
51
|
+
response_deserializer=v1_dot_workflows__pb2.CancelTasksResponse.FromString,
|
|
52
|
+
_registered_method=True)
|
|
53
|
+
self.ReplayTasks = channel.unary_unary(
|
|
54
|
+
'/v1.AdminService/ReplayTasks',
|
|
55
|
+
request_serializer=v1_dot_workflows__pb2.ReplayTasksRequest.SerializeToString,
|
|
56
|
+
response_deserializer=v1_dot_workflows__pb2.ReplayTasksResponse.FromString,
|
|
57
|
+
_registered_method=True)
|
|
58
|
+
self.TriggerWorkflowRun = channel.unary_unary(
|
|
59
|
+
'/v1.AdminService/TriggerWorkflowRun',
|
|
60
|
+
request_serializer=v1_dot_workflows__pb2.TriggerWorkflowRunRequest.SerializeToString,
|
|
61
|
+
response_deserializer=v1_dot_workflows__pb2.TriggerWorkflowRunResponse.FromString,
|
|
62
|
+
_registered_method=True)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class AdminServiceServicer(object):
|
|
66
|
+
"""AdminService represents a set of RPCs for admin management of tasks, workflows, etc.
|
|
67
|
+
"""
|
|
68
|
+
|
|
69
|
+
def PutWorkflow(self, request, context):
|
|
70
|
+
"""Missing associated documentation comment in .proto file."""
|
|
71
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
72
|
+
context.set_details('Method not implemented!')
|
|
73
|
+
raise NotImplementedError('Method not implemented!')
|
|
74
|
+
|
|
75
|
+
def CancelTasks(self, request, context):
|
|
76
|
+
"""Missing associated documentation comment in .proto file."""
|
|
77
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
78
|
+
context.set_details('Method not implemented!')
|
|
79
|
+
raise NotImplementedError('Method not implemented!')
|
|
80
|
+
|
|
81
|
+
def ReplayTasks(self, request, context):
|
|
82
|
+
"""Missing associated documentation comment in .proto file."""
|
|
83
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
84
|
+
context.set_details('Method not implemented!')
|
|
85
|
+
raise NotImplementedError('Method not implemented!')
|
|
86
|
+
|
|
87
|
+
def TriggerWorkflowRun(self, request, context):
|
|
88
|
+
"""Missing associated documentation comment in .proto file."""
|
|
89
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
90
|
+
context.set_details('Method not implemented!')
|
|
91
|
+
raise NotImplementedError('Method not implemented!')
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def add_AdminServiceServicer_to_server(servicer, server):
|
|
95
|
+
rpc_method_handlers = {
|
|
96
|
+
'PutWorkflow': grpc.unary_unary_rpc_method_handler(
|
|
97
|
+
servicer.PutWorkflow,
|
|
98
|
+
request_deserializer=v1_dot_workflows__pb2.CreateWorkflowVersionRequest.FromString,
|
|
99
|
+
response_serializer=v1_dot_workflows__pb2.CreateWorkflowVersionResponse.SerializeToString,
|
|
100
|
+
),
|
|
101
|
+
'CancelTasks': grpc.unary_unary_rpc_method_handler(
|
|
102
|
+
servicer.CancelTasks,
|
|
103
|
+
request_deserializer=v1_dot_workflows__pb2.CancelTasksRequest.FromString,
|
|
104
|
+
response_serializer=v1_dot_workflows__pb2.CancelTasksResponse.SerializeToString,
|
|
105
|
+
),
|
|
106
|
+
'ReplayTasks': grpc.unary_unary_rpc_method_handler(
|
|
107
|
+
servicer.ReplayTasks,
|
|
108
|
+
request_deserializer=v1_dot_workflows__pb2.ReplayTasksRequest.FromString,
|
|
109
|
+
response_serializer=v1_dot_workflows__pb2.ReplayTasksResponse.SerializeToString,
|
|
110
|
+
),
|
|
111
|
+
'TriggerWorkflowRun': grpc.unary_unary_rpc_method_handler(
|
|
112
|
+
servicer.TriggerWorkflowRun,
|
|
113
|
+
request_deserializer=v1_dot_workflows__pb2.TriggerWorkflowRunRequest.FromString,
|
|
114
|
+
response_serializer=v1_dot_workflows__pb2.TriggerWorkflowRunResponse.SerializeToString,
|
|
115
|
+
),
|
|
116
|
+
}
|
|
117
|
+
generic_handler = grpc.method_handlers_generic_handler(
|
|
118
|
+
'v1.AdminService', rpc_method_handlers)
|
|
119
|
+
server.add_generic_rpc_handlers((generic_handler,))
|
|
120
|
+
server.add_registered_method_handlers('v1.AdminService', rpc_method_handlers)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
# This class is part of an EXPERIMENTAL API.
|
|
124
|
+
class AdminService(object):
|
|
125
|
+
"""AdminService represents a set of RPCs for admin management of tasks, workflows, etc.
|
|
126
|
+
"""
|
|
127
|
+
|
|
128
|
+
@staticmethod
|
|
129
|
+
def PutWorkflow(request,
|
|
130
|
+
target,
|
|
131
|
+
options=(),
|
|
132
|
+
channel_credentials=None,
|
|
133
|
+
call_credentials=None,
|
|
134
|
+
insecure=False,
|
|
135
|
+
compression=None,
|
|
136
|
+
wait_for_ready=None,
|
|
137
|
+
timeout=None,
|
|
138
|
+
metadata=None):
|
|
139
|
+
return grpc.experimental.unary_unary(
|
|
140
|
+
request,
|
|
141
|
+
target,
|
|
142
|
+
'/v1.AdminService/PutWorkflow',
|
|
143
|
+
v1_dot_workflows__pb2.CreateWorkflowVersionRequest.SerializeToString,
|
|
144
|
+
v1_dot_workflows__pb2.CreateWorkflowVersionResponse.FromString,
|
|
145
|
+
options,
|
|
146
|
+
channel_credentials,
|
|
147
|
+
insecure,
|
|
148
|
+
call_credentials,
|
|
149
|
+
compression,
|
|
150
|
+
wait_for_ready,
|
|
151
|
+
timeout,
|
|
152
|
+
metadata,
|
|
153
|
+
_registered_method=True)
|
|
154
|
+
|
|
155
|
+
@staticmethod
|
|
156
|
+
def CancelTasks(request,
|
|
157
|
+
target,
|
|
158
|
+
options=(),
|
|
159
|
+
channel_credentials=None,
|
|
160
|
+
call_credentials=None,
|
|
161
|
+
insecure=False,
|
|
162
|
+
compression=None,
|
|
163
|
+
wait_for_ready=None,
|
|
164
|
+
timeout=None,
|
|
165
|
+
metadata=None):
|
|
166
|
+
return grpc.experimental.unary_unary(
|
|
167
|
+
request,
|
|
168
|
+
target,
|
|
169
|
+
'/v1.AdminService/CancelTasks',
|
|
170
|
+
v1_dot_workflows__pb2.CancelTasksRequest.SerializeToString,
|
|
171
|
+
v1_dot_workflows__pb2.CancelTasksResponse.FromString,
|
|
172
|
+
options,
|
|
173
|
+
channel_credentials,
|
|
174
|
+
insecure,
|
|
175
|
+
call_credentials,
|
|
176
|
+
compression,
|
|
177
|
+
wait_for_ready,
|
|
178
|
+
timeout,
|
|
179
|
+
metadata,
|
|
180
|
+
_registered_method=True)
|
|
181
|
+
|
|
182
|
+
@staticmethod
|
|
183
|
+
def ReplayTasks(request,
|
|
184
|
+
target,
|
|
185
|
+
options=(),
|
|
186
|
+
channel_credentials=None,
|
|
187
|
+
call_credentials=None,
|
|
188
|
+
insecure=False,
|
|
189
|
+
compression=None,
|
|
190
|
+
wait_for_ready=None,
|
|
191
|
+
timeout=None,
|
|
192
|
+
metadata=None):
|
|
193
|
+
return grpc.experimental.unary_unary(
|
|
194
|
+
request,
|
|
195
|
+
target,
|
|
196
|
+
'/v1.AdminService/ReplayTasks',
|
|
197
|
+
v1_dot_workflows__pb2.ReplayTasksRequest.SerializeToString,
|
|
198
|
+
v1_dot_workflows__pb2.ReplayTasksResponse.FromString,
|
|
199
|
+
options,
|
|
200
|
+
channel_credentials,
|
|
201
|
+
insecure,
|
|
202
|
+
call_credentials,
|
|
203
|
+
compression,
|
|
204
|
+
wait_for_ready,
|
|
205
|
+
timeout,
|
|
206
|
+
metadata,
|
|
207
|
+
_registered_method=True)
|
|
208
|
+
|
|
209
|
+
@staticmethod
|
|
210
|
+
def TriggerWorkflowRun(request,
|
|
211
|
+
target,
|
|
212
|
+
options=(),
|
|
213
|
+
channel_credentials=None,
|
|
214
|
+
call_credentials=None,
|
|
215
|
+
insecure=False,
|
|
216
|
+
compression=None,
|
|
217
|
+
wait_for_ready=None,
|
|
218
|
+
timeout=None,
|
|
219
|
+
metadata=None):
|
|
220
|
+
return grpc.experimental.unary_unary(
|
|
221
|
+
request,
|
|
222
|
+
target,
|
|
223
|
+
'/v1.AdminService/TriggerWorkflowRun',
|
|
224
|
+
v1_dot_workflows__pb2.TriggerWorkflowRunRequest.SerializeToString,
|
|
225
|
+
v1_dot_workflows__pb2.TriggerWorkflowRunResponse.FromString,
|
|
226
|
+
options,
|
|
227
|
+
channel_credentials,
|
|
228
|
+
insecure,
|
|
229
|
+
call_credentials,
|
|
230
|
+
compression,
|
|
231
|
+
wait_for_ready,
|
|
232
|
+
timeout,
|
|
233
|
+
metadata,
|
|
234
|
+
_registered_method=True)
|