execution-plane-client 0.1.9__tar.gz → 0.1.11__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.
Files changed (22) hide show
  1. {execution_plane_client-0.1.9 → execution_plane_client-0.1.11}/PKG-INFO +3 -3
  2. {execution_plane_client-0.1.9 → execution_plane_client-0.1.11}/README.md +2 -2
  3. {execution_plane_client-0.1.9 → execution_plane_client-0.1.11}/_version.py +2 -2
  4. {execution_plane_client-0.1.9 → execution_plane_client-0.1.11}/catalog.py +2 -1
  5. {execution_plane_client-0.1.9 → execution_plane_client-0.1.11}/commands/__init__.py +1 -8
  6. {execution_plane_client-0.1.9 → execution_plane_client-0.1.11}/commands/clusters.py +20 -18
  7. execution_plane_client-0.1.11/commands/credentials.py +15 -0
  8. execution_plane_client-0.1.11/commands/results.py +43 -0
  9. {execution_plane_client-0.1.9 → execution_plane_client-0.1.11}/commands/targets.py +6 -0
  10. {execution_plane_client-0.1.9 → execution_plane_client-0.1.11}/handlers.py +2 -0
  11. {execution_plane_client-0.1.9 → execution_plane_client-0.1.11}/protocol.py +0 -8
  12. execution_plane_client-0.1.9/commands/credentials.py +0 -25
  13. {execution_plane_client-0.1.9 → execution_plane_client-0.1.11}/.gitignore +0 -0
  14. {execution_plane_client-0.1.9 → execution_plane_client-0.1.11}/LICENSE +0 -0
  15. {execution_plane_client-0.1.9 → execution_plane_client-0.1.11}/__init__.py +0 -0
  16. {execution_plane_client-0.1.9 → execution_plane_client-0.1.11}/commands/base.py +0 -0
  17. {execution_plane_client-0.1.9 → execution_plane_client-0.1.11}/commands/control.py +0 -0
  18. {execution_plane_client-0.1.9 → execution_plane_client-0.1.11}/commands/work.py +0 -0
  19. {execution_plane_client-0.1.9 → execution_plane_client-0.1.11}/errors.py +0 -0
  20. {execution_plane_client-0.1.9 → execution_plane_client-0.1.11}/py.typed +0 -0
  21. {execution_plane_client-0.1.9 → execution_plane_client-0.1.11}/pyproject.toml +0 -0
  22. {execution_plane_client-0.1.9 → execution_plane_client-0.1.11}/registry.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: execution-plane-client
3
- Version: 0.1.9
3
+ Version: 0.1.11
4
4
  Summary: Shared execution-plane command contracts and handler registry
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE
@@ -45,8 +45,8 @@ message = ClusterRegister(
45
45
  body = message.model_dump(mode="json") # Send using your application's HTTP client.
46
46
  ```
47
47
 
48
- Every concrete command supports this method, including `ClusterDelete` and
49
- `TargetDelete`. Partial updates serialize only supplied fields, retaining explicit
48
+ Every concrete command supports this method, including `ClusterDelete`,
49
+ `TargetDelete` and `TargetHealth`. Partial updates serialize only supplied fields, retaining explicit
50
50
  nulls and placement discriminators without resetting omitted configuration.
51
51
 
52
52
  By default, each call generates a command UUID and UTC timestamp; `message_id`
@@ -35,8 +35,8 @@ message = ClusterRegister(
35
35
  body = message.model_dump(mode="json") # Send using your application's HTTP client.
36
36
  ```
37
37
 
38
- Every concrete command supports this method, including `ClusterDelete` and
39
- `TargetDelete`. Partial updates serialize only supplied fields, retaining explicit
38
+ Every concrete command supports this method, including `ClusterDelete`,
39
+ `TargetDelete` and `TargetHealth`. Partial updates serialize only supplied fields, retaining explicit
40
40
  nulls and placement discriminators without resetting omitted configuration.
41
41
 
42
42
  By default, each call generates a command UUID and UTC timestamp; `message_id`
@@ -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.9'
22
- __version_tuple__ = version_tuple = (0, 1, 9)
21
+ __version__ = version = '0.1.11'
22
+ __version_tuple__ = version_tuple = (0, 1, 11)
23
23
 
24
24
  __commit_id__ = commit_id = None
@@ -6,7 +6,7 @@ from execution_plane_client.commands.base import CommandPayload
6
6
  from execution_plane_client.commands.clusters import ClusterDelete, ClusterProvision, ClusterRegister, ClusterUpdate
7
7
  from execution_plane_client.commands.control import CancelCommand, Completion
8
8
  from execution_plane_client.commands.credentials import CredentialResolve
9
- from execution_plane_client.commands.targets import TargetDelete, TargetRegister, TargetUpdate
9
+ from execution_plane_client.commands.targets import TargetDelete, TargetHealth, TargetRegister, TargetUpdate
10
10
  from execution_plane_client.commands.work import WorkExecute
11
11
  from execution_plane_client.errors import UnsupportedCommand
12
12
  from execution_plane_client.protocol import MessageEnvelope
@@ -37,6 +37,7 @@ class CommandCatalog:
37
37
  TargetRegister,
38
38
  TargetUpdate,
39
39
  TargetDelete,
40
+ TargetHealth,
40
41
  CancelCommand,
41
42
  )
42
43
  self._definitions = {
@@ -3,7 +3,7 @@
3
3
  from urllib.parse import urlsplit
4
4
  from uuid import UUID
5
5
 
6
- from execution_plane_client.protocol import PositiveInt, WireModel
6
+ from execution_plane_client.protocol import WireModel
7
7
 
8
8
 
9
9
  class ResourceIdentity(WireModel):
@@ -12,13 +12,6 @@ class ResourceIdentity(WireModel):
12
12
  resource_id: UUID
13
13
 
14
14
 
15
- class ResourceRevision(WireModel):
16
- """Stable cluster integration identity and desired-state revision."""
17
-
18
- resource_key: UUID
19
- desired_revision: PositiveInt
20
-
21
-
22
15
  def validate_endpoint(value: str) -> str:
23
16
  """Require HTTPS without embedded credentials, queries or fragments."""
24
17
  parsed = urlsplit(value)
@@ -1,4 +1,10 @@
1
- """Cluster-binding desired state, independent of EP persistence models."""
1
+ """Cluster desired state, addressed by a caller-supplied physical id.
2
+
3
+ The cluster's primary key is supplied by the caller as ``resource_id`` and shared
4
+ with the owning Automation Orchestrator ``Integration`` (same UUID), mirroring the
5
+ WorkItem/ActivityExecution correlation. There is no configuration revision and no
6
+ separate correlation key.
7
+ """
2
8
 
3
9
  import ssl
4
10
  from typing import Annotated, ClassVar, Self
@@ -6,27 +12,25 @@ from uuid import UUID
6
12
 
7
13
  from pydantic import Field, StrictBool, StrictStr, field_validator, model_validator
8
14
 
9
- from execution_plane_client.commands import ResourceRevision, validate_endpoint
15
+ from execution_plane_client.commands import ResourceIdentity, validate_endpoint
10
16
  from execution_plane_client.commands.base import CommandPayload
11
17
  from execution_plane_client.protocol import WireModel
12
18
 
13
19
 
14
20
  class ClusterConfigBase(WireModel):
15
- """Registration configuration fields used by handlers to copy and compare bindings."""
21
+ """Registration configuration fields used by handlers to copy and compare clusters."""
16
22
 
17
23
  name: Annotated[StrictStr, Field(min_length=1, max_length=255)]
18
24
  endpoint: Annotated[StrictStr, Field(max_length=2048)]
19
- namespace: Annotated[StrictStr, Field(min_length=1, max_length=63, pattern=r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?$")]
20
25
  credential_ref: UUID
21
26
  ca_certificate: Annotated[StrictStr, Field(max_length=65536)] | None = Field(default=None, repr=False)
22
- project_ids: list[UUID] | None = None
23
27
  labels: dict[str, str] = Field(default_factory=dict)
24
28
  enabled: StrictBool = True
25
29
  is_default: StrictBool = False
26
30
 
27
31
 
28
- class ClusterRegister(ClusterConfigBase, ResourceRevision, CommandPayload):
29
- """Create or replace the complete desired configuration of a binding."""
32
+ class ClusterRegister(ClusterConfigBase, ResourceIdentity, CommandPayload):
33
+ """Create or idempotently replace a cluster's desired configuration by id."""
30
34
 
31
35
  command_type: ClassVar[str] = "cluster.register"
32
36
 
@@ -50,36 +54,34 @@ class ClusterRegister(ClusterConfigBase, ResourceRevision, CommandPayload):
50
54
 
51
55
  @model_validator(mode="after")
52
56
  def check_credential_ref(self) -> Self:
53
- """Require a resolvable credential reference for enabled bindings."""
57
+ """Require a resolvable credential reference for enabled clusters."""
54
58
  if self.enabled and self.credential_ref == UUID(int=0):
55
- message = "Enabled cluster bindings require a credential_ref"
59
+ message = "Enabled clusters require a credential_ref"
56
60
  raise ValueError(message)
57
61
  return self
58
62
 
59
63
 
60
64
  class ClusterProvision(ClusterRegister):
61
- """Provision through the same binding and default-target reconciler."""
65
+ """Provision through the same cluster and default-target reconciler."""
62
66
 
63
67
  command_type: ClassVar[str] = "cluster.provision"
64
68
 
65
69
 
66
- class ClusterDelete(ResourceRevision, CommandPayload):
67
- """Disable an existing binding at the requested desired-state revision."""
70
+ class ClusterDelete(ResourceIdentity, CommandPayload):
71
+ """Disable and drain an existing cluster addressed by id."""
68
72
 
69
73
  command_type: ClassVar[str] = "cluster.delete"
70
74
 
71
75
 
72
- class ClusterUpdate(ResourceRevision, CommandPayload):
73
- """Patch a binding; only CA and project grants support explicit null."""
76
+ class ClusterUpdate(ResourceIdentity, CommandPayload):
77
+ """Patch a cluster by id; only CA supports explicit null."""
74
78
 
75
79
  command_type: ClassVar[str] = "cluster.update"
76
80
 
77
81
  name: StrictStr | None = None
78
82
  endpoint: StrictStr | None = None
79
- namespace: StrictStr | None = None
80
83
  credential_ref: UUID | None = None
81
84
  ca_certificate: StrictStr | None = Field(default=None, repr=False)
82
- project_ids: list[UUID] | None = None
83
85
  labels: dict[str, str] | None = None
84
86
  enabled: StrictBool | None = None
85
87
  is_default: StrictBool | None = None
@@ -90,7 +92,7 @@ class ClusterUpdate(ResourceRevision, CommandPayload):
90
92
  @model_validator(mode="after")
91
93
  def check_nulls(self) -> Self:
92
94
  """Preserve omitted values but reject clearing required fields."""
93
- if any(getattr(self, key) is None for key in self.model_fields_set - {"ca_certificate", "project_ids"}):
94
- message = "Required binding fields cannot be null"
95
+ if any(getattr(self, key) is None for key in self.model_fields_set - {"ca_certificate"}):
96
+ message = "Required cluster fields cannot be null"
95
97
  raise ValueError(message)
96
98
  return self
@@ -0,0 +1,15 @@
1
+ """Credential-reference resolution commands."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import ClassVar
6
+ from uuid import UUID # noqa: TC003 - Pydantic evaluates fields.
7
+
8
+ from execution_plane_client.commands.base import CommandPayload
9
+
10
+
11
+ class CredentialResolve(CommandPayload):
12
+ """Resolve an opaque credential reference into a short-lived value."""
13
+
14
+ command_type: ClassVar[str] = "credential.resolve"
15
+ credential_ref: UUID
@@ -0,0 +1,43 @@
1
+ """Typed command results and transport receipts."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Annotated, Literal
6
+ from uuid import UUID # noqa: TC003 - Pydantic resolves this model field at runtime.
7
+
8
+ from pydantic import Field, StrictBool, StrictStr
9
+
10
+ from execution_plane_client.protocol import ResourceReference, WireModel
11
+
12
+
13
+ class CredentialResolveCommandResult(WireModel):
14
+ """Typed result returned for a credential-resolution command."""
15
+
16
+ command_type: Literal["credential.resolve"] = "credential.resolve"
17
+ command_revision: Literal[1] = 1
18
+ credential: Annotated[StrictStr, Field(min_length=1, max_length=65536, repr=False)]
19
+
20
+
21
+ class TargetHealthCommandResult(WireModel):
22
+ """Typed result returned for an execution-target health command."""
23
+
24
+ command_type: Literal["execution_target.health"] = "execution_target.health"
25
+ command_revision: Literal[1] = 1
26
+ healthy: StrictBool
27
+ message: StrictStr | None = None
28
+ skipped: StrictBool = False
29
+
30
+
31
+ CommandResult = Annotated[
32
+ CredentialResolveCommandResult | TargetHealthCommandResult,
33
+ Field(discriminator="command_type"),
34
+ ]
35
+
36
+
37
+ class TransportReceipt(WireModel):
38
+ """Receipt of a handled request, without a persisted command record."""
39
+
40
+ received: Literal[True] = True
41
+ message_id: UUID
42
+ resource: ResourceReference | None = None
43
+ result: CommandResult | None = None
@@ -150,3 +150,9 @@ class TargetUpdate(ResourceIdentity, CommandPayload):
150
150
  def check_endpoint(cls, value: str | None) -> str | None:
151
151
  """Validate explicit endpoint updates before applying them."""
152
152
  return None if value is None else validate_endpoint(value)
153
+
154
+
155
+ class TargetHealth(ResourceIdentity, CommandPayload):
156
+ """Query the current health of one ExecutionTarget."""
157
+
158
+ command_type: ClassVar[str] = "execution_target.health"
@@ -4,6 +4,7 @@ from dataclasses import dataclass
4
4
  from typing import Protocol
5
5
 
6
6
  from execution_plane_client.commands.base import CommandPayload
7
+ from execution_plane_client.commands.results import CommandResult
7
8
  from execution_plane_client.protocol import MessageEnvelope, ResourceReference
8
9
 
9
10
 
@@ -12,6 +13,7 @@ class HandlingResult:
12
13
  """Optional resource created or affected by a command."""
13
14
 
14
15
  resource: ResourceReference | None = None
16
+ result: CommandResult | None = None
15
17
 
16
18
 
17
19
  class CommandHandler[ContextT](Protocol):
@@ -123,11 +123,3 @@ class CapabilitiesRead(WireModel):
123
123
 
124
124
  protocol_revision: Literal[1] = 1
125
125
  commands: dict[str, list[int]]
126
-
127
-
128
- class TransportReceipt(WireModel):
129
- """Receipt of a handled request, without a persisted command record."""
130
-
131
- received: Literal[True] = True
132
- message_id: UUID
133
- resource: ResourceReference | None = None
@@ -1,25 +0,0 @@
1
- """Credential-reference resolution commands and responses."""
2
-
3
- from __future__ import annotations
4
-
5
- from typing import Annotated, ClassVar
6
- from uuid import UUID # noqa: TC003 - Pydantic evaluates fields.
7
-
8
- from pydantic import Field, StrictStr
9
-
10
- from execution_plane_client.commands.base import CommandPayload
11
- from execution_plane_client.protocol import WireModel
12
-
13
-
14
- class CredentialResolve(CommandPayload):
15
- """Resolve an opaque credential reference into a short-lived value."""
16
-
17
- command_type: ClassVar[str] = "credential.resolve"
18
- credential_ref: UUID
19
-
20
-
21
- class CredentialResolution(WireModel):
22
- """The resolved credential value for one submitted command."""
23
-
24
- message_id: UUID
25
- credential: Annotated[StrictStr, Field(min_length=1, max_length=65536, repr=False)]