Page 1 of 1

EVE-NG REST API – GET /networks returns `data: []` immediately after successful POST /networks (bridge created but unver

Posted: Wed Apr 08, 2026 1:07 am
by Hanyh
**Environment:**
- EVE-NG Version: 6.2.0-4 (amd64)
- Node type: viosl2 (QEMU / vIOS L2)
- Lab: STP_Lab.unl (3-switch topology)
- Automation: Python + httpx against the REST API

---

**The Problem**

I'm building a Python tool to set-up EVE-NG topologies programmatically. When my code tries to create a bridge and connect two nodes, the `POST /networks` call succeeds with `201 Created`, but the immediately following `GET /networks` returns an empty data field:

```
{'code': 200, 'status': 'success', 'message': 'Successfully listed networks (60004).', 'data': []}
```

Because `data` is an empty list `[]` instead of a dict keyed by network ID (e.g. `{"1": {...}}`), my code can't locate the newly created bridge by name and fails before ever attempting to assign it to a node interface.

The warning logged is:
```
[BRIDGE] Bridge 'p2p_1_0_2_0' created but could not verify its ID
```
And the operation fails with:
```
❌ Failed to create backing bridge for the link
```

---

**What my code does (and where it breaks)**

1. ✅ `GET /api/labs/{lab}/nodes/{id}/interfaces` — resolves interface slot correctly (e.g. index 0 → Gi0/0)
2. ✅ `POST /api/labs/{lab}/networks` — returns `201 Created` (bridge appears to be made)
3. ❌ `GET /api/labs/{lab}/networks` — returns `200 OK` but `data: []` — bridge is invisible
4. ✗ `PUT /api/labs/{lab}/nodes/{id}/interfaces` — **never reached**, code aborts at step 3

---

**Key observation**

Wiring nodes manually in the EVE-NG web GUI works perfectly — interfaces get assigned valid, low network IDs (e.g. `network_id=1`). So the endpoint works, but `GET /networks` after a fresh API-created bridge consistently returns an empty list rather than the expected dict format.

This happens both with nodes stopped and with nodes running (confirmed 3 QEMU VMs running at time of attempts).

---

Any help appreciated

Thanks!