Skip to content

Commit 9882696

Browse files
committed
feat(inventory): enhance searchOrgInventory with additional filtering options
1 parent 21c936a commit 9882696

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

‎src/mistapi/api/v1/orgs/inventory.py‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,8 @@ def searchOrgInventory(
355355
org_id: str,
356356
type: str | None = None,
357357
mac: str | None = None,
358+
vc_mac: str | None = None,
359+
master_mac: str | None = None,
358360
model: str | None = None,
359361
name: str | None = None,
360362
site_id: str | None = None,
@@ -365,6 +367,8 @@ def searchOrgInventory(
365367
version: str | None = None,
366368
status: str | None = None,
367369
text: str | None = None,
370+
modified_after: int | None = None,
371+
disconnected_before: int | None = None,
368372
limit: int | None = None,
369373
sort: str | None = None,
370374
search_after: str | None = None,
@@ -387,6 +391,10 @@ def searchOrgInventory(
387391
Filter results by type. enum: `ap`, `gateway`, `switch`
388392
mac : str
389393
Filter by MAC address. Partial matches may use `*` wildcards (e.g. `*5b35*` matches `5c5b350e0001` and `5c5b35000301`). Accepts multiple comma-separated values.
394+
vc_mac : str
395+
Virtual Chassis MAC address. Accepts multiple comma-separated values.
396+
master_mac : str
397+
MAC address of the Virtual Chassis master device. Accepts multiple comma-separated values.
390398
model : str
391399
Partial / full Device model. Use `prefix*` for prefix search or `*substring*` for contains search (e.g. `AP4*` and `*P4*` match `AP43`). Suffix-only wildcards (e.g. `*43`) are not supported. Accepts multiple comma-separated values.
392400
name : str
@@ -407,6 +415,10 @@ def searchOrgInventory(
407415
Device status. enum: `connected`, `disconnected`. Accepts multiple comma-separated values.
408416
text : str
409417
Wildcards for name, mac, serial
418+
modified_after : int
419+
Filter on inventory last modified time, in epoch
420+
disconnected_before : int
421+
Filter results to devices that were last disconnected before this time, in epoch seconds
410422
limit : int, default: 100
411423
Maximum number of results to return per page
412424
sort : str, default: timestamp
@@ -426,6 +438,10 @@ def searchOrgInventory(
426438
query_params["type"] = str(type)
427439
if mac:
428440
query_params["mac"] = str(mac)
441+
if vc_mac:
442+
query_params["vc_mac"] = str(vc_mac)
443+
if master_mac:
444+
query_params["master_mac"] = str(master_mac)
429445
if model:
430446
query_params["model"] = str(model)
431447
if name:
@@ -446,6 +462,10 @@ def searchOrgInventory(
446462
query_params["status"] = str(status)
447463
if text:
448464
query_params["text"] = str(text)
465+
if modified_after:
466+
query_params["modified_after"] = str(modified_after)
467+
if disconnected_before:
468+
query_params["disconnected_before"] = str(disconnected_before)
449469
if limit:
450470
query_params["limit"] = str(limit)
451471
if sort:

0 commit comments

Comments
 (0)