NAS API¶
Manage NAS devices — the RADIUS clients (routers, switches, access points, BRAS) allowed to talk to
FreeRADIUS. All paths are under /api/v1.
| Method | Path | Scope | Restarts FreeRADIUS |
|---|---|---|---|
GET |
/nas |
nas.read |
|
GET |
/nas/{id} |
nas.read |
|
POST |
/nas |
nas.write |
✓ |
PUT |
/nas/{id} |
nas.write |
✓ (if anything changed) |
DELETE |
/nas/{id} |
nas.write |
✓ |
Writes restart FreeRADIUS
Creating, updating, or deleting a NAS restarts FreeRADIUS in the background so it reloads its client list. This briefly interrupts request processing — batch your NAS changes rather than looping one call per device, and avoid doing it in a tight automation during peak hours.
The NAS object¶
Reads return a summary — note the shared secret is never returned:
{
"id": 7,
"nasname": "10.0.0.1",
"shortname": "core-bras",
"type": "cisco",
"description": "Core BRAS"
}
List NAS devices¶
GET /nas — paginated (page, size, search). search
matches on the NAS address or short name.
curl -H "X-API-Key: $KEY" "https://your-host/api/v1/nas?search=bras"
Get one¶
GET /nas/{id} → the NAS object, or 404.
Create¶
POST /nas → 201 with the new NAS.
| Field | Required | Default | Notes |
|---|---|---|---|
nasname |
✓ | IP or hostname (1–128 chars); must be unique | |
secret |
✓ | Shared secret (write-only — never read back) | |
shortname |
null |
Friendly label | |
type |
other |
Vendor/type hint | |
ports |
null |
||
server, community, description |
null |
curl -X POST -H "X-API-Key: $KEY" -H "Content-Type: application/json" \
-d '{"nasname":"10.0.0.1","shortname":"core-bras","type":"cisco","secret":"sharedsecret"}' \
https://your-host/api/v1/nas
409 if nasname already exists.
Update¶
PUT /nas/{id} → the updated NAS. All fields optional; omitted fields are left unchanged. FreeRADIUS
only restarts if something actually changed. 409 if the new nasname collides with another device,
404 if the id doesn't exist.
Delete¶
DELETE /nas/{id} → 204, then a FreeRADIUS restart. 404 if there's no such device.
Related¶
- NAS (UI) — vendor presets and reachability
- NAS Manager — push config to the device over SSH/Telnet
- Sessions & CoA — disconnects go out to these NAS devices
MonsterOps