|
| 1 | +# Rebirth Button in Admin UI |
| 2 | + |
| 3 | +Date: 2026-04-09 |
| 4 | +Author: Alex Godbehere |
| 5 | + |
| 6 | +## Problem |
| 7 | + |
| 8 | +There is no way to trigger a Sparkplug Rebirth (NBIRTH/DBIRTH) from the |
| 9 | +Admin UI. When edge agents get stuck (e.g. after a ConfigDB migration |
| 10 | +changes device UUIDs), the only option is to manually restart pods or |
| 11 | +use kubectl. A Rebirth button in the UI would let operators force a |
| 12 | +re-publish of the birth certificate without restarting the agent. |
| 13 | + |
| 14 | +## Solution |
| 15 | + |
| 16 | +Add a per-row "Rebirth" button to the Node list and Device list views |
| 17 | +in the Edge Manager. The button is only shown if the current user has |
| 18 | +the Rebirth CCL permission on that specific node/device. |
| 19 | + |
| 20 | +### Key UUIDs |
| 21 | + |
| 22 | +- **Rebirth CCL permission**: `fbb9c25d-386d-4966-a325-f16471d9f7be` |
| 23 | +- **Command Definition app**: `60e99f28-67fe-4344-a6ab-b1edb8b8e810` |
| 24 | +- **CmdEsc permission set group**: `9584ee09-a35a-4278-bc13-21a8be1f007c` |
| 25 | + |
| 26 | +### How Rebirth works |
| 27 | + |
| 28 | +The `CmdEsc.rebirth(address)` method in `lib/js-service-client/lib/service/cmdesc.js` |
| 29 | +sends a Sparkplug NCMD/DCMD via the Command Escalation service: |
| 30 | + |
| 31 | +- For nodes: `Node Control/Rebirth` (Boolean, true) |
| 32 | +- For devices: `Device Control/Rebirth` (Boolean, true) |
| 33 | + |
| 34 | +The CmdEsc service validates the user's ACL before forwarding the |
| 35 | +command. The edge agent handles the NCMD at |
| 36 | +`acs-edge/lib/sparkplugNode.ts:339-341` and re-publishes its birth |
| 37 | +certificate. |
| 38 | + |
| 39 | +### Changes |
| 40 | + |
| 41 | +#### 1. Node store - add Sparkplug address |
| 42 | + |
| 43 | +**File:** `acs-admin/src/store/useNodeStore.js` |
| 44 | + |
| 45 | +Add `sparkplugAddress: UUIDs.App.SparkplugAddress` to the loaded |
| 46 | +configs. The device store already loads this; the node store does not. |
| 47 | + |
| 48 | +#### 2. ACL check composable |
| 49 | + |
| 50 | +**File:** `acs-admin/src/composables/useCanRebirth.js` (new) |
| 51 | + |
| 52 | +A Vue composable that, given a list of node/device UUIDs, checks |
| 53 | +whether the current user has the Rebirth permission |
| 54 | +(`fbb9c25d-386d-4966-a325-f16471d9f7be`) on each target via |
| 55 | +`client.Auth.check_acl()`. |
| 56 | + |
| 57 | +Returns a reactive `Map<uuid, boolean>` so the template can look up |
| 58 | +each row. |
| 59 | + |
| 60 | +The current user's principal is resolved from `serviceClientStore.username` |
| 61 | +(a Kerberos principal name) which `Auth.fetch_acl()` accepts directly. |
| 62 | + |
| 63 | +Calls are made per target UUID. Results are cached for the lifetime of |
| 64 | +the composable. |
| 65 | + |
| 66 | +#### 3. Node list - Rebirth column |
| 67 | + |
| 68 | +**File:** `acs-admin/src/pages/EdgeManager/EdgeClusters/EdgeCluster.vue` |
| 69 | +**File:** `acs-admin/src/pages/EdgeManager/EdgeClusters/nodeColumns.ts` |
| 70 | + |
| 71 | +Add a new column to the node DataTable with a Rebirth button per row. |
| 72 | +The column uses a custom cell renderer (Vue `h()` function or inline |
| 73 | +component) that: |
| 74 | + |
| 75 | +- Checks `canRebirth.get(row.original.uuid)` to show/hide the button |
| 76 | +- On click, calls `client.CmdEsc.rebirth(address)` where `address` is |
| 77 | + built from the node's `sparkplugAddress` config |
| 78 | +- Shows a loading spinner on the button while the request is in flight |
| 79 | +- Shows a success toast on completion, error toast on failure |
| 80 | + |
| 81 | +#### 4. Device list - Rebirth column |
| 82 | + |
| 83 | +**File:** `acs-admin/src/pages/EdgeManager/Nodes/Node.vue` |
| 84 | +**File:** `acs-admin/src/pages/EdgeManager/Nodes/deviceColumns.ts` |
| 85 | + |
| 86 | +Same pattern as the node list. The device's Sparkplug address is already |
| 87 | +available in the device store. |
| 88 | + |
| 89 | +### UX |
| 90 | + |
| 91 | +- Button style: small ghost/secondary button with a refresh icon |
| 92 | +- Loading: spinner replaces the icon while the request is in flight |
| 93 | +- Success: toast "Rebirth sent to {name}" |
| 94 | +- Error (403): toast "Permission denied: cannot rebirth {name}" |
| 95 | +- Error (other): toast "Failed to rebirth {name}" |
| 96 | +- Button hidden entirely if user lacks permission on that target |
| 97 | + |
| 98 | +### What this doesn't change |
| 99 | + |
| 100 | +- No backend changes - CmdEsc and the edge agent already support Rebirth |
| 101 | +- No new permissions - the Rebirth CCL already exists |
| 102 | +- No changes to the Sparkplug protocol handling |
0 commit comments