k8s.cluster.snapshot ​
Cluster-wide workload snapshot (one list per kind, slim projection)
Snapshot workload resources from a cluster (one call per kind, no persistence).
Inputs:
- connection_uuid: Cloud connection UUID (required)
- namespaces: Optional list of namespaces. Omit/empty → full-cluster scan using list_X_for_all_namespaces. Saves N-1 round-trips.
- kinds: Optional list overriding the default kind set. Allowed: Deployment, StatefulSet, DaemonSet, Service, Ingress, ConfigMap, Job, CronJob, PersistentVolumeClaim, Pod, Secret, Namespace, Node.
- label_selector: Optional kubectl-style label selector applied to every list.
Outputs:
- snapshot_at: ISO-8601 timestamp the snapshot completed.
- kinds_scanned: [str]
- counts_by_kind:
- items_by_kind:
- duration_ms: wall-clock duration of the snapshot run.
Plugin required: context.get_plugin("connection").kubernetes_runner_clients(connection_uuid, organization_uuid) must expose core_v1, apps_v1, batch_v1, networking_v1.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-kubernetes |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
connection_uuid | uuid | Yes | — | UUID of the CloudConnection backing the target Kubernetes cluster, picked from the organization's connections (filtered to connection_type=kubernetes). |
namespaces | json | No | — | — |
kinds | json | No | — | — |
label_selector | string | No | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
connection_uuid | uuid | No | — | CloudConnection UUID echoed from input. |
kinds | json | No | — | — |
label_selector | string | No | — | — |
snapshot_at | string | No | — | — |
namespaces | json | No | — | — |
kinds_scanned | json | No | — | — |
counts_by_kind | json | No | — | — |
items_by_kind | json | No | — | — |
duration_ms | integer | No | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "k8s.cluster.snapshot",
"initial_data": {
"connection_uuid": "value"
}
}