This commit is contained in:
+7
-1
@@ -219,7 +219,7 @@ per-resource filters:
|
||||
| Group check | `/radgroupcheck` | GET, POST, PUT, DELETE | `groupname`, `attribute` |
|
||||
| Group reply | `/radgroupreply` | GET, POST, PUT, DELETE | `groupname`, `attribute` |
|
||||
| **VLANs** | `/vlan` | see below | — |
|
||||
| **Clients** | `/client` | see below | — |
|
||||
| **Clients** | `/client` | see below | `search`, `status` |
|
||||
| **Devices** | `/device` | GET (list), PUT (alias) | — |
|
||||
| User↔group | `/radusergroup` | GET, POST, PUT, DELETE | `username`, `groupname` |
|
||||
| Accounting | `/radacct` | GET (read-only) | `username`, `nasipaddress`, `active` |
|
||||
@@ -263,6 +263,7 @@ at client creation.
|
||||
| Action | Request |
|
||||
|------------------|-----------------------------------------------------|
|
||||
| List clients | `GET /client/` → `{total,limit,offset,items:[{mac_address,group,status,name,phone,alias}]}` |
|
||||
| Search / filter | `GET /client/?search=<term>&status=<new\|paid\|unpaid>` |
|
||||
| Get one client | `GET /client/{mac_address}` |
|
||||
| Add a client | `POST /client/add` body `{"mac_address":"14-99-3E-74-CB-7F","group":"staff","name":"Ali Hassan","phone":"7712345","alias":"Living Room TV"}` |
|
||||
| Edit a client | `POST /client/edit` body `{"mac_address":"...", group?, status?, name?, phone?, alias?}` |
|
||||
@@ -283,6 +284,11 @@ response.
|
||||
`unpaid`. In the DB the group is stored in the `radusergroup.groupname` column,
|
||||
`status` in `customers.status`, and `name`/`phone`/`alias` in `radadmin_clients`.
|
||||
- Adding a client whose MAC already exists → `409`.
|
||||
- **List** accepts two optional filters (both applied before pagination, so
|
||||
`total` reflects the filtered set): `search` is a case-insensitive substring
|
||||
matched across `mac_address`, `name`, `phone`, and `alias`; `status` is an exact
|
||||
match on `new` / `paid` / `unpaid`. Combine them freely, e.g.
|
||||
`GET /client/?search=ali&status=unpaid`.
|
||||
- **Import** validates each row with the same rules as `add`; with `dry_run:true`
|
||||
nothing is written and it returns `{total, valid, created:0, dry_run, errors:[{row,
|
||||
mac, detail}]}` for a preview. With `dry_run:false` the valid rows are inserted
|
||||
|
||||
Reference in New Issue
Block a user