mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-23 10:05:08 +02:00
feat(cli): read the workspace listeners from the control plane
This commit is contained in:
@@ -155,6 +155,29 @@ class ByName:
|
||||
DeploymentSelector = ById | ByName
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class Listener:
|
||||
id: str
|
||||
compute_id: str
|
||||
namespaces: tuple[str, ...]
|
||||
|
||||
@classmethod
|
||||
def from_resource(cls, resource: Mapping[str, object]) -> "Listener":
|
||||
compute_config = resource.get("compute_config")
|
||||
namespaces = (
|
||||
compute_config.get("k8s_namespaces")
|
||||
if isinstance(compute_config, Mapping)
|
||||
else None
|
||||
)
|
||||
return cls(
|
||||
str(resource.get("id", "")),
|
||||
str(resource.get("compute_id", "")),
|
||||
tuple(str(namespace) for namespace in namespaces)
|
||||
if isinstance(namespaces, list)
|
||||
else (),
|
||||
)
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class ExistingDeployment:
|
||||
id: str
|
||||
|
||||
Reference in New Issue
Block a user