execution-plane-client 0.1.8__tar.gz → 0.1.10__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.8 → execution_plane_client-0.1.10}/PKG-INFO +1 -1
- {execution_plane_client-0.1.8 → execution_plane_client-0.1.10}/_version.py +2 -2
- {execution_plane_client-0.1.8 → execution_plane_client-0.1.10}/commands/__init__.py +1 -8
- {execution_plane_client-0.1.8 → execution_plane_client-0.1.10}/commands/clusters.py +20 -18
- {execution_plane_client-0.1.8 → execution_plane_client-0.1.10}/.gitignore +0 -0
- {execution_plane_client-0.1.8 → execution_plane_client-0.1.10}/LICENSE +0 -0
- {execution_plane_client-0.1.8 → execution_plane_client-0.1.10}/README.md +0 -0
- {execution_plane_client-0.1.8 → execution_plane_client-0.1.10}/__init__.py +0 -0
- {execution_plane_client-0.1.8 → execution_plane_client-0.1.10}/catalog.py +0 -0
- {execution_plane_client-0.1.8 → execution_plane_client-0.1.10}/commands/base.py +0 -0
- {execution_plane_client-0.1.8 → execution_plane_client-0.1.10}/commands/control.py +0 -0
- {execution_plane_client-0.1.8 → execution_plane_client-0.1.10}/commands/credentials.py +0 -0
- {execution_plane_client-0.1.8 → execution_plane_client-0.1.10}/commands/targets.py +0 -0
- {execution_plane_client-0.1.8 → execution_plane_client-0.1.10}/commands/work.py +0 -0
- {execution_plane_client-0.1.8 → execution_plane_client-0.1.10}/errors.py +0 -0
- {execution_plane_client-0.1.8 → execution_plane_client-0.1.10}/handlers.py +0 -0
- {execution_plane_client-0.1.8 → execution_plane_client-0.1.10}/protocol.py +0 -0
- {execution_plane_client-0.1.8 → execution_plane_client-0.1.10}/py.typed +0 -0
- {execution_plane_client-0.1.8 → execution_plane_client-0.1.10}/pyproject.toml +0 -0
- {execution_plane_client-0.1.8 → execution_plane_client-0.1.10}/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.10'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 1, 10)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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,
|
|
29
|
-
"""Create or replace
|
|
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
|
|
57
|
+
"""Require a resolvable credential reference for enabled clusters."""
|
|
54
58
|
if self.enabled and self.credential_ref == UUID(int=0):
|
|
55
|
-
message = "Enabled
|
|
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
|
|
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(
|
|
67
|
-
"""Disable an existing
|
|
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(
|
|
73
|
-
"""Patch a
|
|
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"
|
|
94
|
-
message = "Required
|
|
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
|
|
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
|