execution-plane-client 0.1.20__tar.gz → 0.1.22__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.20 → execution_plane_client-0.1.22}/PKG-INFO +1 -1
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/_version.py +2 -2
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/catalog.py +4 -3
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/commands/credentials.py +3 -3
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/commands/results.py +28 -22
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/commands/work.py +8 -0
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/models/work_item.py +17 -1
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/.gitignore +0 -0
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/LICENSE +0 -0
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/README.md +0 -0
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/__init__.py +0 -0
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/commands/__init__.py +0 -0
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/commands/base.py +0 -0
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/commands/clusters.py +0 -0
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/commands/control.py +0 -0
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/commands/targets.py +0 -0
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/errors.py +0 -0
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/handlers.py +0 -0
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/models/__init__.py +0 -0
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/models/cluster.py +0 -0
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/models/execution_target.py +0 -0
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/models/runtime_context.py +0 -0
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/models/shared.py +0 -0
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/protocol.py +0 -0
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/py.typed +0 -0
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/pyproject.toml +0 -0
- {execution_plane_client-0.1.20 → execution_plane_client-0.1.22}/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.22'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 1, 22)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
@@ -5,9 +5,9 @@ from dataclasses import dataclass
|
|
|
5
5
|
from execution_plane_client.commands.base import CommandPayload
|
|
6
6
|
from execution_plane_client.commands.clusters import ClusterDelete, ClusterRegister, ClusterUpdate
|
|
7
7
|
from execution_plane_client.commands.control import Completion, WorkCancel
|
|
8
|
-
from execution_plane_client.commands.credentials import
|
|
8
|
+
from execution_plane_client.commands.credentials import CredentialResolveCluster, CredentialResolveWorkload
|
|
9
9
|
from execution_plane_client.commands.targets import TargetDelete, TargetHealth, TargetRegister, TargetUpdate
|
|
10
|
-
from execution_plane_client.commands.work import WorkExecute
|
|
10
|
+
from execution_plane_client.commands.work import WorkDelete, WorkExecute
|
|
11
11
|
from execution_plane_client.errors import UnsupportedCommand
|
|
12
12
|
from execution_plane_client.protocol import MessageEnvelope
|
|
13
13
|
|
|
@@ -28,8 +28,9 @@ class CommandCatalog:
|
|
|
28
28
|
"""Install supported work, resource and completion contracts."""
|
|
29
29
|
payloads = (
|
|
30
30
|
WorkExecute,
|
|
31
|
+
WorkDelete,
|
|
31
32
|
Completion,
|
|
32
|
-
|
|
33
|
+
CredentialResolveCluster,
|
|
33
34
|
CredentialResolveWorkload,
|
|
34
35
|
ClusterRegister,
|
|
35
36
|
ClusterUpdate,
|
|
@@ -12,10 +12,10 @@ from execution_plane_client.commands.work import CredentialRecipeId, StepIdentit
|
|
|
12
12
|
from execution_plane_client.protocol import Identifier # noqa: TC001
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
class
|
|
16
|
-
"""Resolve an opaque credential reference into
|
|
15
|
+
class CredentialResolveCluster(CommandPayload):
|
|
16
|
+
"""Resolve an opaque cluster credential reference into its credential document."""
|
|
17
17
|
|
|
18
|
-
command_type: ClassVar[str] = "credential.resolve"
|
|
18
|
+
command_type: ClassVar[str] = "credential.resolve.cluster"
|
|
19
19
|
credential_ref: UUID = Field(
|
|
20
20
|
repr=False,
|
|
21
21
|
description="Opaque AO credential reference.",
|
|
@@ -10,16 +10,36 @@ from pydantic import Field, StrictBool, StrictStr, field_validator
|
|
|
10
10
|
|
|
11
11
|
from execution_plane_client.protocol import ResourceReference, WireModel
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
MAX_CREDENTIAL_FIELDS = 32
|
|
14
|
+
MAX_CREDENTIAL_BYTES = 32 * 1024
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
"""
|
|
17
|
+
def validate_credential_document(value: dict[str, str]) -> dict[str, str]:
|
|
18
|
+
"""Bound credential field count and encoded response size."""
|
|
19
|
+
if not value:
|
|
20
|
+
message = "Credential document must not be empty"
|
|
21
|
+
raise ValueError(message)
|
|
22
|
+
if len(value) > MAX_CREDENTIAL_FIELDS:
|
|
23
|
+
message = "Credential document must contain at most 32 fields"
|
|
24
|
+
raise ValueError(message)
|
|
25
|
+
encoded = json.dumps(value, ensure_ascii=False, separators=(",", ":")).encode("utf-8")
|
|
26
|
+
if len(encoded) > MAX_CREDENTIAL_BYTES:
|
|
27
|
+
message = "Credential document exceeds 32 KiB"
|
|
28
|
+
raise ValueError(message)
|
|
29
|
+
return value
|
|
19
30
|
|
|
20
|
-
|
|
31
|
+
|
|
32
|
+
class CredentialResolveClusterCommandResult(WireModel):
|
|
33
|
+
"""Typed result returned for a cluster credential-resolution command."""
|
|
34
|
+
|
|
35
|
+
command_type: Literal["credential.resolve.cluster"] = "credential.resolve.cluster"
|
|
21
36
|
command_revision: Literal[1] = 1
|
|
22
|
-
credential:
|
|
37
|
+
credential: dict[
|
|
38
|
+
Annotated[StrictStr, Field(min_length=1, max_length=128)],
|
|
39
|
+
Annotated[StrictStr, Field(min_length=1, max_length=8192)],
|
|
40
|
+
] = Field(repr=False)
|
|
41
|
+
|
|
42
|
+
check_document = field_validator("credential")(validate_credential_document)
|
|
23
43
|
|
|
24
44
|
|
|
25
45
|
class CredentialResolveWorkloadCommandResult(WireModel):
|
|
@@ -34,21 +54,7 @@ class CredentialResolveWorkloadCommandResult(WireModel):
|
|
|
34
54
|
Annotated[StrictStr, Field(min_length=1, max_length=8192)],
|
|
35
55
|
] = Field(repr=False)
|
|
36
56
|
|
|
37
|
-
|
|
38
|
-
@classmethod
|
|
39
|
-
def check_document(cls, value: dict[str, str]) -> dict[str, str]:
|
|
40
|
-
"""Bound credential field count and encoded response size."""
|
|
41
|
-
if not value:
|
|
42
|
-
message = "Credential document must not be empty"
|
|
43
|
-
raise ValueError(message)
|
|
44
|
-
if len(value) > MAX_WORKLOAD_CREDENTIAL_FIELDS:
|
|
45
|
-
message = "Credential document must contain at most 32 fields"
|
|
46
|
-
raise ValueError(message)
|
|
47
|
-
encoded = json.dumps(value, ensure_ascii=False, separators=(",", ":")).encode("utf-8")
|
|
48
|
-
if len(encoded) > MAX_WORKLOAD_CREDENTIAL_BYTES:
|
|
49
|
-
message = "Credential document exceeds 32 KiB"
|
|
50
|
-
raise ValueError(message)
|
|
51
|
-
return value
|
|
57
|
+
check_document = field_validator("credential")(validate_credential_document)
|
|
52
58
|
|
|
53
59
|
|
|
54
60
|
class TargetHealthCommandResult(WireModel):
|
|
@@ -62,7 +68,7 @@ class TargetHealthCommandResult(WireModel):
|
|
|
62
68
|
|
|
63
69
|
|
|
64
70
|
CommandResult = Annotated[
|
|
65
|
-
|
|
71
|
+
CredentialResolveClusterCommandResult | CredentialResolveWorkloadCommandResult | TargetHealthCommandResult,
|
|
66
72
|
Field(discriminator="command_type"),
|
|
67
73
|
]
|
|
68
74
|
|
|
@@ -118,3 +118,11 @@ class WorkExecute(CommandPayload):
|
|
|
118
118
|
default="container",
|
|
119
119
|
description="Workload execution family; container is the only supported value.",
|
|
120
120
|
)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
class WorkDelete(CommandPayload):
|
|
124
|
+
"""Request asynchronous cancellation, resource cleanup, and removal of owned work."""
|
|
125
|
+
|
|
126
|
+
command_type: ClassVar[str] = "work.delete"
|
|
127
|
+
|
|
128
|
+
work_item_id: UUID
|
|
@@ -37,7 +37,6 @@ class WorkItemStatus(StrEnum):
|
|
|
37
37
|
CLAIMED = "claimed"
|
|
38
38
|
DISPATCHED = "dispatched"
|
|
39
39
|
RUNNING = "running"
|
|
40
|
-
CANCEL_REQUESTED = "cancel_requested"
|
|
41
40
|
RECONCILIATION_REQUIRED = "reconciliation_required"
|
|
42
41
|
COMPLETED = "completed"
|
|
43
42
|
FAILED = "failed"
|
|
@@ -58,6 +57,23 @@ class WorkItemRead(BaseModel):
|
|
|
58
57
|
)
|
|
59
58
|
runtime_context: RuntimeContext = Field(default_factory=dict)
|
|
60
59
|
status: WorkItemStatus = Field(description="Work item lifecycle status")
|
|
60
|
+
cancellation_requested: bool = Field(
|
|
61
|
+
default=False,
|
|
62
|
+
description=(
|
|
63
|
+
"Whether cancellation intent has been persisted. A true value does not confirm that execution "
|
|
64
|
+
"has stopped: status remains dispatched or running until an outcome is known. A result may "
|
|
65
|
+
"win the cancellation race. This flag remains true after completion and is also set by deletion."
|
|
66
|
+
),
|
|
67
|
+
)
|
|
68
|
+
deletion_requested: bool = Field(
|
|
69
|
+
default=False,
|
|
70
|
+
description=(
|
|
71
|
+
"Whether deletion intent has been persisted. Always implies cancellation_requested=true. "
|
|
72
|
+
"Active work is cancelled asynchronously, and the record remains readable until resource "
|
|
73
|
+
"cleanup is confirmed and the record is removed. This flag does not change an existing "
|
|
74
|
+
"terminal outcome or confirm that deletion has completed."
|
|
75
|
+
),
|
|
76
|
+
)
|
|
61
77
|
result: dict[str, Any] | None = Field(default=None, description="Work execution result payload")
|
|
62
78
|
result_omitted: bool = Field(default=False, description="Whether result was omitted due to size")
|
|
63
79
|
result_size_bytes: int | None = Field(default=None, description="Size of the result in bytes")
|
|
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
|
|
File without changes
|