Models¶
Plain dataclasses for API entities. Every entity keeps the original API
payload in .raw, so unknown fields are never silently dropped.
barbara.models.Node
dataclass
¶
Node(
id: str,
node_name: str,
status: Optional[Dict[str, Any]] = None,
cluster_id: Optional[str] = None,
raw: Dict[str, Any] = dict(),
)
barbara.models.Application
dataclass
¶
Application(
id: str, name: str, raw: Dict[str, Any] = dict()
)
barbara.models.Config
dataclass
¶
Config(
id: str,
name: str,
config_type: str,
raw: Dict[str, Any] = dict(),
)
A reusable, named config document from the Config Repository —
referenced by id (config_id) from a workload's/node's/cluster's own
App Config or Global Config, rather than being one itself.
barbara.models.Group
dataclass
¶
Group(
id: str,
name: str,
node_ids: List[str] = list(),
raw: Dict[str, Any] = dict(),
)
barbara.models.User
dataclass
¶
User(
id: str,
email: str,
role: Optional[UserRole] = None,
enabled: Optional[bool] = None,
raw: Dict[str, Any] = dict(),
)
barbara.models.UserRole ¶
Bases: str, Enum
Matches the labels Panel shows in the Organization view — not the
raw JWT/API claim names, which use a different, undocumented casing
(role_company_admin, etc.) for the same four levels.
barbara.models.Alert
dataclass
¶
Alert(
id: str,
title: Optional[str],
severity: Optional[int],
active: Optional[bool],
node_id: Optional[str] = None,
raw: Dict[str, Any] = dict(),
)
barbara.models.AlertEvent
dataclass
¶
AlertEvent(
id: str,
event_type: Optional[int],
node_id: Optional[str] = None,
alert_id: Optional[str] = None,
raw: Dict[str, Any] = dict(),
)
barbara.models.Workload
dataclass
¶
Workload(id: str, raw: Dict[str, Any] = dict())
A workload (deviceSpace): a Docker app, Marketplace app, or Model
deployed on a single node, or (when returned by
ClusterWorkloadsResource) across every node in a cluster — same
dataclass for both, since the cluster-level API mirrors the node-level
one. Unlike most entities, the API doesn't return its own top-level id —
it's the workload_id the caller already knows, kept here for
symmetry with the other dataclasses.
barbara.models.GlobalSecret
dataclass
¶
GlobalSecret(
id: str, name: str, raw: Dict[str, Any] = dict()
)
A Barbara-managed node or cluster secret reference (name only — value is never returned unencrypted unless the caller has permission and asks for it). Shared by every workload on the node/cluster — distinct from a Marketplace app's own App Secrets, and from Docker-native Swarm Secrets.
name is decoded from base64, matching Barbara's convention for
secret/credential names throughout the API.
barbara.models.DockerCredential
dataclass
¶
DockerCredential(
id: str,
server: Optional[str] = None,
user: Optional[str] = None,
raw: Dict[str, Any] = dict(),
)
server/user are decoded from base64, matching Barbara's
convention for docker credential fields throughout the API. password
is deliberately not a field here — Panel never stores it once sent to
the node, so the API never returns it, under any role.
barbara.models.ModelVersion
dataclass
¶
ModelVersion(
id: str, name: str, raw: Dict[str, Any] = dict()
)
barbara.models.Page
dataclass
¶
Page(items: List[Any], total: Optional[int] = None)
Generic page wrapper for list endpoints.