execution-plane-client 0.1.12__tar.gz → 0.1.14__tar.gz
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.
- {execution_plane_client-0.1.12 → execution_plane_client-0.1.14}/.gitignore +3 -0
- {execution_plane_client-0.1.12 → execution_plane_client-0.1.14}/PKG-INFO +1 -1
- {execution_plane_client-0.1.12 → execution_plane_client-0.1.14}/_version.py +2 -2
- execution_plane_client-0.1.14/models/cluster.py +67 -0
- {execution_plane_client-0.1.12 → execution_plane_client-0.1.14}/models/execution_target.py +61 -52
- {execution_plane_client-0.1.12 → execution_plane_client-0.1.14}/models/shared.py +7 -5
- execution_plane_client-0.1.14/models/work_item.py +81 -0
- execution_plane_client-0.1.12/models/cluster.py +0 -60
- execution_plane_client-0.1.12/models/work_item.py +0 -67
- {execution_plane_client-0.1.12 → execution_plane_client-0.1.14}/LICENSE +0 -0
- {execution_plane_client-0.1.12 → execution_plane_client-0.1.14}/README.md +0 -0
- {execution_plane_client-0.1.12 → execution_plane_client-0.1.14}/__init__.py +0 -0
- {execution_plane_client-0.1.12 → execution_plane_client-0.1.14}/catalog.py +0 -0
- {execution_plane_client-0.1.12 → execution_plane_client-0.1.14}/commands/__init__.py +0 -0
- {execution_plane_client-0.1.12 → execution_plane_client-0.1.14}/commands/base.py +0 -0
- {execution_plane_client-0.1.12 → execution_plane_client-0.1.14}/commands/clusters.py +0 -0
- {execution_plane_client-0.1.12 → execution_plane_client-0.1.14}/commands/control.py +0 -0
- {execution_plane_client-0.1.12 → execution_plane_client-0.1.14}/commands/credentials.py +0 -0
- {execution_plane_client-0.1.12 → execution_plane_client-0.1.14}/commands/results.py +0 -0
- {execution_plane_client-0.1.12 → execution_plane_client-0.1.14}/commands/targets.py +0 -0
- {execution_plane_client-0.1.12 → execution_plane_client-0.1.14}/commands/work.py +0 -0
- {execution_plane_client-0.1.12 → execution_plane_client-0.1.14}/errors.py +0 -0
- {execution_plane_client-0.1.12 → execution_plane_client-0.1.14}/handlers.py +0 -0
- {execution_plane_client-0.1.12 → execution_plane_client-0.1.14}/models/__init__.py +0 -0
- {execution_plane_client-0.1.12 → execution_plane_client-0.1.14}/protocol.py +0 -0
- {execution_plane_client-0.1.12 → execution_plane_client-0.1.14}/py.typed +0 -0
- {execution_plane_client-0.1.12 → execution_plane_client-0.1.14}/pyproject.toml +0 -0
- {execution_plane_client-0.1.12 → execution_plane_client-0.1.14}/registry.py +0 -0
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.1.
|
|
22
|
-
__version_tuple__ = version_tuple = (0, 1,
|
|
21
|
+
__version__ = version = '0.1.14'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 1, 14)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"""Shared cluster list and response contracts."""
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from uuid import UUID
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
7
|
+
|
|
8
|
+
from execution_plane_client.models.shared import EPListParams, ResourcesResponse
|
|
9
|
+
|
|
10
|
+
# Cluster query metadata - single source of truth for EP and client
|
|
11
|
+
CLUSTER_FILTERABLE_FIELDS = [
|
|
12
|
+
"id",
|
|
13
|
+
"created_at",
|
|
14
|
+
"updated_at",
|
|
15
|
+
"name",
|
|
16
|
+
"endpoint",
|
|
17
|
+
"status",
|
|
18
|
+
"status_message",
|
|
19
|
+
"enabled",
|
|
20
|
+
"is_default",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
CLUSTER_SORTABLE_FIELDS = [
|
|
24
|
+
"id",
|
|
25
|
+
"created_at",
|
|
26
|
+
"updated_at",
|
|
27
|
+
"name",
|
|
28
|
+
"endpoint",
|
|
29
|
+
"status",
|
|
30
|
+
"enabled",
|
|
31
|
+
"is_default",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class ClusterRead(BaseModel):
|
|
36
|
+
"""Provisioned cluster state, keyed by the actual cluster UUID."""
|
|
37
|
+
|
|
38
|
+
model_config = ConfigDict(from_attributes=True)
|
|
39
|
+
|
|
40
|
+
id: UUID = Field(description="Cluster unique identifier")
|
|
41
|
+
name: str = Field(description="Cluster name")
|
|
42
|
+
endpoint: str = Field(description="Cluster API endpoint URL")
|
|
43
|
+
status: str = Field(description="Cluster lifecycle status")
|
|
44
|
+
status_message: str | None = Field(default=None, description="Human-readable status message or error details")
|
|
45
|
+
enabled: bool = Field(description="Whether the cluster is enabled for use")
|
|
46
|
+
is_default: bool = Field(description="Whether this is the default cluster")
|
|
47
|
+
labels: dict[str, str] = Field(description="Key-value labels for the cluster")
|
|
48
|
+
created_at: datetime = Field(description="Creation timestamp")
|
|
49
|
+
updated_at: datetime = Field(description="Last update timestamp")
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class ClusterListParams(EPListParams):
|
|
53
|
+
"""Query parameters for listing clusters."""
|
|
54
|
+
|
|
55
|
+
id: str | None = Field(default=None, description="Filter by id")
|
|
56
|
+
name: str | None = Field(default=None, description="Filter by name")
|
|
57
|
+
endpoint: str | None = Field(default=None, description="Filter by endpoint")
|
|
58
|
+
status: str | None = Field(default=None, description="Filter by status")
|
|
59
|
+
status_message: str | None = Field(default=None, description="Filter by status_message")
|
|
60
|
+
enabled: str | None = Field(default=None, description="Filter by enabled")
|
|
61
|
+
is_default: str | None = Field(default=None, description="Filter by is_default")
|
|
62
|
+
created_at: str | None = Field(default=None, description="Filter by created_at")
|
|
63
|
+
updated_at: str | None = Field(default=None, description="Filter by updated_at")
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class ClusterListResponse(ResourcesResponse[ClusterRead]):
|
|
67
|
+
"""Paginated list response for clusters."""
|
|
@@ -10,7 +10,7 @@ from pydantic import BaseModel, ConfigDict, Field, field_validator, model_valida
|
|
|
10
10
|
from pydantic.json_schema import SkipJsonSchema
|
|
11
11
|
|
|
12
12
|
from execution_plane_client.commands.targets import KubernetesPlacement as CommandKubernetesPlacement
|
|
13
|
-
from execution_plane_client.models.shared import EPListParams
|
|
13
|
+
from execution_plane_client.models.shared import EPListParams, ResourcesResponse
|
|
14
14
|
|
|
15
15
|
_LABEL_NAME = re.compile(r"^[A-Za-z0-9]([A-Za-z0-9_.-]*[A-Za-z0-9])?$")
|
|
16
16
|
_DNS_LABEL = re.compile(r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?$")
|
|
@@ -18,6 +18,33 @@ _TOLERATION_EFFECTS = {"", "NoSchedule", "PreferNoSchedule", "NoExecute"}
|
|
|
18
18
|
_MAX_LABEL_NAME_LENGTH = 63
|
|
19
19
|
_MAX_DNS_SUBDOMAIN_LENGTH = 253
|
|
20
20
|
|
|
21
|
+
# Execution target query metadata - single source of truth for EP and client
|
|
22
|
+
EXECUTION_TARGET_FILTERABLE_FIELDS = [
|
|
23
|
+
"id",
|
|
24
|
+
"created_at",
|
|
25
|
+
"name",
|
|
26
|
+
"endpoint",
|
|
27
|
+
"status",
|
|
28
|
+
"backend_type",
|
|
29
|
+
"cluster_id",
|
|
30
|
+
"enabled",
|
|
31
|
+
"is_default",
|
|
32
|
+
"last_ran_at",
|
|
33
|
+
"status_message",
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
EXECUTION_TARGET_SORTABLE_FIELDS = [
|
|
37
|
+
"id",
|
|
38
|
+
"created_at",
|
|
39
|
+
"name",
|
|
40
|
+
"endpoint",
|
|
41
|
+
"status",
|
|
42
|
+
"backend_type",
|
|
43
|
+
"cluster_id",
|
|
44
|
+
"enabled",
|
|
45
|
+
"is_default",
|
|
46
|
+
]
|
|
47
|
+
|
|
21
48
|
|
|
22
49
|
class BackendType(StrEnum):
|
|
23
50
|
"""Supported execution target backends."""
|
|
@@ -118,62 +145,44 @@ ExecutionTargetPlacement = Annotated[
|
|
|
118
145
|
]
|
|
119
146
|
|
|
120
147
|
|
|
121
|
-
class ExecutionTargetListParams(EPListParams):
|
|
122
|
-
"""Execution-target query controls and documented filter fields."""
|
|
123
|
-
|
|
124
|
-
id: str | None = Field(default=None, description="Target UUID; id[in]=uuid1,uuid2 for membership")
|
|
125
|
-
cluster_id: str | None = Field(default=None, description="Physical cluster UUID; supports eq and in")
|
|
126
|
-
name: str | None = Field(default=None, description="Name; supports eq, in, contains, and starts_with")
|
|
127
|
-
endpoint: str | None = Field(default=None, description="Endpoint; supports eq, in, contains, and starts_with")
|
|
128
|
-
status: str | None = Field(default=None, description="Target status; supports eq and in")
|
|
129
|
-
backend_type: str | None = Field(default=None, description="Backend type; supports eq and in")
|
|
130
|
-
enabled: str | None = Field(default=None, description="Boolean; supports eq, in, and isnull")
|
|
131
|
-
is_default: str | None = Field(default=None, description="Boolean; supports eq, in, and isnull")
|
|
132
|
-
created_at: str | None = Field(
|
|
133
|
-
default=None, description="Creation time; supports eq, in, gt, gte, lt, lte, and isnull"
|
|
134
|
-
)
|
|
135
|
-
last_ran_at: str | None = Field(default=None, description="Last run time; supports ranges and isnull")
|
|
136
|
-
status_message: str | None = Field(default=None, description="Status message; supports text operators and isnull")
|
|
137
|
-
sort: Literal[
|
|
138
|
-
"id",
|
|
139
|
-
"-id",
|
|
140
|
-
"created_at",
|
|
141
|
-
"-created_at",
|
|
142
|
-
"name",
|
|
143
|
-
"-name",
|
|
144
|
-
"endpoint",
|
|
145
|
-
"-endpoint",
|
|
146
|
-
"status",
|
|
147
|
-
"-status",
|
|
148
|
-
"backend_type",
|
|
149
|
-
"-backend_type",
|
|
150
|
-
"cluster_id",
|
|
151
|
-
"-cluster_id",
|
|
152
|
-
"enabled",
|
|
153
|
-
"-enabled",
|
|
154
|
-
"is_default",
|
|
155
|
-
"-is_default",
|
|
156
|
-
] = Field(default="created_at", description="Execution-target sort field; oldest first by default.")
|
|
157
|
-
|
|
158
|
-
|
|
159
148
|
class ExecutionTargetRead(BaseModel):
|
|
160
149
|
"""Safe execution-target representation without management credentials."""
|
|
161
150
|
|
|
162
151
|
model_config = ConfigDict(from_attributes=True)
|
|
163
152
|
|
|
164
|
-
id: UUID
|
|
165
|
-
cluster_id: UUID
|
|
166
|
-
name: str
|
|
167
|
-
backend_type: BackendType
|
|
168
|
-
endpoint: str
|
|
169
|
-
placement: ExecutionTargetPlacement
|
|
170
|
-
status: TargetStatus
|
|
171
|
-
enabled: bool
|
|
172
|
-
is_default: bool
|
|
173
|
-
status_message: str | None
|
|
174
|
-
labels: dict[str, str]
|
|
175
|
-
created_at: datetime
|
|
176
|
-
last_ran_at: datetime | None
|
|
153
|
+
id: UUID = Field(description="Execution target unique identifier")
|
|
154
|
+
cluster_id: UUID = Field(description="Parent cluster identifier")
|
|
155
|
+
name: str = Field(description="Execution target name")
|
|
156
|
+
backend_type: BackendType = Field(description="Backend execution platform type")
|
|
157
|
+
endpoint: str = Field(description="Execution target API endpoint URL")
|
|
158
|
+
placement: ExecutionTargetPlacement = Field(description="Platform-specific placement configuration")
|
|
159
|
+
status: TargetStatus = Field(description="Execution target lifecycle status")
|
|
160
|
+
enabled: bool = Field(description="Whether the target is enabled for use")
|
|
161
|
+
is_default: bool = Field(description="Whether this is the default target for the cluster")
|
|
162
|
+
status_message: str | None = Field(default=None, description="Human-readable status message or error details")
|
|
163
|
+
labels: dict[str, str] = Field(description="Key-value labels for the target")
|
|
164
|
+
created_at: datetime = Field(description="Creation timestamp")
|
|
165
|
+
last_ran_at: datetime | None = Field(default=None, description="Last execution timestamp")
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
class ExecutionTargetListParams(EPListParams):
|
|
169
|
+
"""Query parameters for listing execution targets."""
|
|
170
|
+
|
|
171
|
+
id: str | None = Field(default=None, description="Filter by id")
|
|
172
|
+
cluster_id: str | None = Field(default=None, description="Filter by cluster_id")
|
|
173
|
+
name: str | None = Field(default=None, description="Filter by name")
|
|
174
|
+
backend_type: str | None = Field(default=None, description="Filter by backend_type")
|
|
175
|
+
endpoint: str | None = Field(default=None, description="Filter by endpoint")
|
|
176
|
+
status: str | None = Field(default=None, description="Filter by status")
|
|
177
|
+
enabled: str | None = Field(default=None, description="Filter by enabled")
|
|
178
|
+
is_default: str | None = Field(default=None, description="Filter by is_default")
|
|
179
|
+
status_message: str | None = Field(default=None, description="Filter by status_message")
|
|
180
|
+
created_at: str | None = Field(default=None, description="Filter by created_at")
|
|
181
|
+
last_ran_at: str | None = Field(default=None, description="Filter by last_ran_at")
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
class ExecutionTargetListResponse(ResourcesResponse[ExecutionTargetRead]):
|
|
185
|
+
"""Paginated list response for execution targets."""
|
|
177
186
|
|
|
178
187
|
|
|
179
188
|
class KubernetesTargetPlacement(CommandKubernetesPlacement):
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"""Shared list controls and pagination envelopes."""
|
|
2
2
|
|
|
3
|
-
from typing import
|
|
3
|
+
from typing import Annotated
|
|
4
4
|
|
|
5
|
-
from pydantic import BaseModel, Field
|
|
5
|
+
from pydantic import BaseModel, Field, StringConstraints
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
_SORT_PATTERN = r"^-?[a-z][a-z0-9_]*$"
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class EPListParams(BaseModel):
|
|
@@ -12,7 +12,9 @@ class EPListParams(BaseModel):
|
|
|
12
12
|
|
|
13
13
|
limit: int = Field(default=20, gt=0, le=100)
|
|
14
14
|
cursor: str | None = Field(default=None)
|
|
15
|
-
sort: str
|
|
15
|
+
sort: Annotated[str, StringConstraints(pattern=_SORT_PATTERN)] = Field(
|
|
16
|
+
default="created_at", description="Sort field; prefix with '-' for descending order."
|
|
17
|
+
)
|
|
16
18
|
include_total: bool = Field(default=False)
|
|
17
19
|
|
|
18
20
|
@property
|
|
@@ -21,7 +23,7 @@ class EPListParams(BaseModel):
|
|
|
21
23
|
return self.sort.removeprefix("-"), "desc" if self.sort.startswith("-") else "asc"
|
|
22
24
|
|
|
23
25
|
|
|
24
|
-
class ResourcesResponse
|
|
26
|
+
class ResourcesResponse[T](BaseModel):
|
|
25
27
|
"""Pagination envelope returned by all EP list endpoints."""
|
|
26
28
|
|
|
27
29
|
resources: list[T]
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"""Shared work-item list and response contracts."""
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from enum import StrEnum
|
|
5
|
+
from typing import Annotated, Any
|
|
6
|
+
from uuid import UUID
|
|
7
|
+
|
|
8
|
+
from pydantic import BaseModel, ConfigDict, Field, StringConstraints
|
|
9
|
+
|
|
10
|
+
from execution_plane_client.models.shared import _SORT_PATTERN, EPListParams, ResourcesResponse
|
|
11
|
+
|
|
12
|
+
# Work item query metadata - single source of truth for EP and client
|
|
13
|
+
WORK_ITEM_FILTERABLE_FIELDS = [
|
|
14
|
+
"id",
|
|
15
|
+
"execution_target_id",
|
|
16
|
+
"status",
|
|
17
|
+
"created_at",
|
|
18
|
+
"claimed_at",
|
|
19
|
+
"completed_at",
|
|
20
|
+
"resource_cleanup_status",
|
|
21
|
+
"resource_cleanup_error",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
WORK_ITEM_SORTABLE_FIELDS = [
|
|
25
|
+
"created_at",
|
|
26
|
+
"status",
|
|
27
|
+
"resource_cleanup_status",
|
|
28
|
+
"id",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class WorkItemStatus(StrEnum):
|
|
33
|
+
"""Lifecycle states of a dispatched work item."""
|
|
34
|
+
|
|
35
|
+
PENDING = "pending"
|
|
36
|
+
CLAIMED = "claimed"
|
|
37
|
+
DISPATCHED = "dispatched"
|
|
38
|
+
RUNNING = "running"
|
|
39
|
+
CANCEL_REQUESTED = "cancel_requested"
|
|
40
|
+
RECONCILIATION_REQUIRED = "reconciliation_required"
|
|
41
|
+
COMPLETED = "completed"
|
|
42
|
+
FAILED = "failed"
|
|
43
|
+
CANCELLED = "cancelled"
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class WorkItemRead(BaseModel):
|
|
47
|
+
"""Safe work-item representation; excludes credentials and persistence internals."""
|
|
48
|
+
|
|
49
|
+
model_config = ConfigDict(from_attributes=True)
|
|
50
|
+
|
|
51
|
+
id: UUID = Field(description="Work item unique identifier")
|
|
52
|
+
status: WorkItemStatus = Field(description="Work item lifecycle status")
|
|
53
|
+
result: dict[str, Any] | None = Field(default=None, description="Work execution result payload")
|
|
54
|
+
result_omitted: bool = Field(default=False, description="Whether result was omitted due to size")
|
|
55
|
+
result_size_bytes: int | None = Field(default=None, description="Size of the result in bytes")
|
|
56
|
+
created_at: datetime = Field(description="Creation timestamp")
|
|
57
|
+
claimed_at: datetime | None = Field(default=None, description="Claim timestamp")
|
|
58
|
+
completed_at: datetime | None = Field(default=None, description="Completion timestamp")
|
|
59
|
+
resource_cleanup_status: str = Field(description="Resource cleanup status")
|
|
60
|
+
resource_cleanup_error: str | None = Field(default=None, description="Resource cleanup error details")
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class WorkItemListParams(EPListParams):
|
|
64
|
+
"""Query parameters for listing work items."""
|
|
65
|
+
|
|
66
|
+
id: str | None = Field(default=None, description="Filter by id")
|
|
67
|
+
execution_target_id: str | None = Field(default=None, description="Filter by execution_target_id")
|
|
68
|
+
status: str | None = Field(default=None, description="Filter by status")
|
|
69
|
+
created_at: str | None = Field(default=None, description="Filter by created_at")
|
|
70
|
+
claimed_at: str | None = Field(default=None, description="Filter by claimed_at")
|
|
71
|
+
completed_at: str | None = Field(default=None, description="Filter by completed_at")
|
|
72
|
+
resource_cleanup_status: str | None = Field(default=None, description="Filter by resource_cleanup_status")
|
|
73
|
+
resource_cleanup_error: str | None = Field(default=None, description="Filter by resource_cleanup_error")
|
|
74
|
+
|
|
75
|
+
sort: Annotated[str, StringConstraints(pattern=_SORT_PATTERN)] = Field(
|
|
76
|
+
default="-created_at", description="Sort field; prefix with '-' for descending order."
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
class WorkItemListResponse(ResourcesResponse[WorkItemRead]):
|
|
81
|
+
"""Paginated list response for work items."""
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"""Shared cluster list and response contracts."""
|
|
2
|
-
|
|
3
|
-
from datetime import datetime
|
|
4
|
-
from typing import Literal
|
|
5
|
-
from uuid import UUID
|
|
6
|
-
|
|
7
|
-
from pydantic import BaseModel, ConfigDict, Field
|
|
8
|
-
|
|
9
|
-
from execution_plane_client.models.shared import EPListParams
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class ClusterListParams(EPListParams):
|
|
13
|
-
"""Cluster query controls and documented filter fields."""
|
|
14
|
-
|
|
15
|
-
id: str | None = Field(default=None, description="Cluster UUID; id[in]=uuid1,uuid2 for membership")
|
|
16
|
-
created_at: str | None = Field(
|
|
17
|
-
default=None, description="Creation time; supports eq, in, gt, gte, lt, lte, and isnull"
|
|
18
|
-
)
|
|
19
|
-
updated_at: str | None = Field(default=None, description="Update time; supports ranges and isnull")
|
|
20
|
-
name: str | None = Field(default=None, description="Name; supports eq, in, contains, and starts_with")
|
|
21
|
-
endpoint: str | None = Field(default=None, description="Endpoint; supports eq, in, contains, and starts_with")
|
|
22
|
-
status: str | None = Field(default=None, description="Cluster status; supports eq and in")
|
|
23
|
-
status_message: str | None = Field(default=None, description="Status message; supports text operators and isnull")
|
|
24
|
-
enabled: str | None = Field(default=None, description="Boolean; supports eq, in, and isnull")
|
|
25
|
-
is_default: str | None = Field(default=None, description="Boolean; supports eq, in, and isnull")
|
|
26
|
-
sort: Literal[
|
|
27
|
-
"id",
|
|
28
|
-
"-id",
|
|
29
|
-
"created_at",
|
|
30
|
-
"-created_at",
|
|
31
|
-
"name",
|
|
32
|
-
"-name",
|
|
33
|
-
"endpoint",
|
|
34
|
-
"-endpoint",
|
|
35
|
-
"status",
|
|
36
|
-
"-status",
|
|
37
|
-
"enabled",
|
|
38
|
-
"-enabled",
|
|
39
|
-
"is_default",
|
|
40
|
-
"-is_default",
|
|
41
|
-
"updated_at",
|
|
42
|
-
"-updated_at",
|
|
43
|
-
] = Field(default="created_at", description="Cluster sort field; oldest first by default.")
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
class ClusterRead(BaseModel):
|
|
47
|
-
"""Provisioned cluster state, keyed by the actual cluster UUID."""
|
|
48
|
-
|
|
49
|
-
model_config = ConfigDict(from_attributes=True)
|
|
50
|
-
|
|
51
|
-
id: UUID
|
|
52
|
-
name: str
|
|
53
|
-
endpoint: str
|
|
54
|
-
status: str
|
|
55
|
-
status_message: str | None
|
|
56
|
-
enabled: bool
|
|
57
|
-
is_default: bool
|
|
58
|
-
labels: dict[str, str]
|
|
59
|
-
created_at: datetime
|
|
60
|
-
updated_at: datetime
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"""Shared work-item list and response contracts."""
|
|
2
|
-
|
|
3
|
-
from datetime import datetime
|
|
4
|
-
from enum import StrEnum
|
|
5
|
-
from typing import Any, Literal
|
|
6
|
-
from uuid import UUID
|
|
7
|
-
|
|
8
|
-
from pydantic import BaseModel, ConfigDict, Field
|
|
9
|
-
|
|
10
|
-
from execution_plane_client.models.shared import EPListParams
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class WorkItemStatus(StrEnum):
|
|
14
|
-
"""Lifecycle states of a dispatched work item."""
|
|
15
|
-
|
|
16
|
-
PENDING = "pending"
|
|
17
|
-
CLAIMED = "claimed"
|
|
18
|
-
DISPATCHED = "dispatched"
|
|
19
|
-
RUNNING = "running"
|
|
20
|
-
CANCEL_REQUESTED = "cancel_requested"
|
|
21
|
-
RECONCILIATION_REQUIRED = "reconciliation_required"
|
|
22
|
-
COMPLETED = "completed"
|
|
23
|
-
FAILED = "failed"
|
|
24
|
-
CANCELLED = "cancelled"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class WorkItemListParams(EPListParams):
|
|
28
|
-
"""Work-item query controls and documented filter fields."""
|
|
29
|
-
|
|
30
|
-
id: str | None = Field(default=None, description="Work UUID; id[in]=uuid1,uuid2 for membership")
|
|
31
|
-
status: str | None = Field(default=None, description="Work status; supports eq and in")
|
|
32
|
-
created_at: str | None = Field(
|
|
33
|
-
default=None, description="Creation time; supports eq, in, gt, gte, lt, lte, and isnull"
|
|
34
|
-
)
|
|
35
|
-
claimed_at: str | None = Field(default=None, description="Claim time; supports ranges and isnull")
|
|
36
|
-
completed_at: str | None = Field(default=None, description="Completion time; supports ranges and isnull")
|
|
37
|
-
resource_cleanup_status: str | None = Field(default=None, description="Cleanup status; supports eq and in")
|
|
38
|
-
resource_cleanup_error: str | None = Field(
|
|
39
|
-
default=None, description="Cleanup error; supports text operators and isnull"
|
|
40
|
-
)
|
|
41
|
-
sort: Literal[
|
|
42
|
-
"created_at",
|
|
43
|
-
"-created_at",
|
|
44
|
-
"status",
|
|
45
|
-
"-status",
|
|
46
|
-
"resource_cleanup_status",
|
|
47
|
-
"-resource_cleanup_status",
|
|
48
|
-
"id",
|
|
49
|
-
"-id",
|
|
50
|
-
] = Field(default="-created_at", description="Work-item sort field; newest first by default.")
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
class WorkItemRead(BaseModel):
|
|
54
|
-
"""Safe work-item representation; excludes credentials and persistence internals."""
|
|
55
|
-
|
|
56
|
-
model_config = ConfigDict(from_attributes=True)
|
|
57
|
-
|
|
58
|
-
id: UUID
|
|
59
|
-
status: WorkItemStatus
|
|
60
|
-
result: dict[str, Any] | None
|
|
61
|
-
result_omitted: bool = False
|
|
62
|
-
result_size_bytes: int | None = None
|
|
63
|
-
created_at: datetime
|
|
64
|
-
claimed_at: datetime | None
|
|
65
|
-
completed_at: datetime | None
|
|
66
|
-
resource_cleanup_status: str
|
|
67
|
-
resource_cleanup_error: str | None
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|