Skip to content

Commit 4199ff3

Browse files
committed
0.60.1
1 parent 0fedbd7 commit 4199ff3

10 files changed

Lines changed: 259 additions & 14 deletions

File tree

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SHELL := /bin/bash
77
PROJECT_NAME ?= $(shell basename $(CURDIR))
88

99
# Version for code generation (can be overridden)
10-
VERSION ?= 0.55.14
10+
VERSION ?= 0.55.15
1111

1212
help: ## Show this help message
1313
@echo 'Usage: make [target]'
@@ -59,6 +59,7 @@ publish: clean build ## Publish to PyPI
5959
uv run twine upload dist/*
6060

6161
generate: ## Run the code generation script
62+
cd mist_openapi && git pull && cd ..
6263
uv run python generate_from_openapi.py $(VERSION)
6364

6465
deps: ## Show dependency tree

mist_openapi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit 8b2fa496b791c036aa0a75de17d557d000ef06a8
1+
Subproject commit ecd89b3aa048555fe82f47338a14dc45e1141518

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "mistapi"
7-
version = "0.56.0"
7+
version = "0.56.1"
88
authors = [{ name = "Thomas Munzer", email = "tmunzer@juniper.net" }]
99
description = "Python package to simplify the Mist System APIs usage"
1010
keywords = ["Mist", "Juniper", "API"]

src/.DS_Store

6 KB
Binary file not shown.

src/mistapi/__version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = "0.56.0"
1+
__version__ = "0.56.1"
22
__author__ = "Thomas Munzer <tmunzer@juniper.net>"

src/mistapi/api/v1/orgs/clients.py

Lines changed: 85 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,91 @@ def countOrgWirelessClients(
101101
return resp
102102

103103

104+
def countOrgWirelessClientEvents(
105+
mist_session: _APISession,
106+
org_id: str,
107+
distinct: str | None = None,
108+
type: str | None = None,
109+
reason_code: int | None = None,
110+
ssid: str | None = None,
111+
ap: str | None = None,
112+
proto: str | None = None,
113+
band: str | None = None,
114+
wlan_id: str | None = None,
115+
site_id: str | None = None,
116+
start: int | None = None,
117+
end: int | None = None,
118+
duration: str = "1d",
119+
limit: int = 100,
120+
) -> _APIResponse:
121+
"""
122+
API doc: https://www.juniper.net/documentation/us/en/software/mist/api/http/api/orgs/clients/wireless/count-org-wireless-client-events
123+
124+
PARAMS
125+
-----------
126+
mistapi.APISession : mist_session
127+
mistapi session including authentication and Mist host information
128+
129+
PATH PARAMS
130+
-----------
131+
org_id : str
132+
133+
QUERY PARAMS
134+
------------
135+
distinct : str{'band', 'channel', 'proto', 'ssid', 'type', 'wlan_id'}
136+
type : str
137+
reason_code : int
138+
ssid : str
139+
ap : str
140+
proto : str{'a', 'ac', 'ax', 'b', 'g', 'n'}
141+
a / b / g / n / ac / ax
142+
band : str{'24', '5', '6'}
143+
802.11 Band
144+
wlan_id : str
145+
site_id : str
146+
start : int
147+
end : int
148+
duration : str, default: 1d
149+
limit : int, default: 100
150+
151+
RETURN
152+
-----------
153+
mistapi.APIResponse
154+
response from the API call
155+
"""
156+
157+
uri = f"/api/v1/orgs/{org_id}/clients/events/count"
158+
query_params: dict[str, str] = {}
159+
if distinct:
160+
query_params["distinct"] = str(distinct)
161+
if type:
162+
query_params["type"] = str(type)
163+
if reason_code:
164+
query_params["reason_code"] = str(reason_code)
165+
if ssid:
166+
query_params["ssid"] = str(ssid)
167+
if ap:
168+
query_params["ap"] = str(ap)
169+
if proto:
170+
query_params["proto"] = str(proto)
171+
if band:
172+
query_params["band"] = str(band)
173+
if wlan_id:
174+
query_params["wlan_id"] = str(wlan_id)
175+
if site_id:
176+
query_params["site_id"] = str(site_id)
177+
if start:
178+
query_params["start"] = str(start)
179+
if end:
180+
query_params["end"] = str(end)
181+
if duration:
182+
query_params["duration"] = str(duration)
183+
if limit:
184+
query_params["limit"] = str(limit)
185+
resp = mist_session.mist_get(uri=uri, query=query_params)
186+
return resp
187+
188+
104189
def searchOrgWirelessClientEvents(
105190
mist_session: _APISession,
106191
org_id: str,
@@ -112,7 +197,6 @@ def searchOrgWirelessClientEvents(
112197
band: str | None = None,
113198
wlan_id: str | None = None,
114199
nacrule_id: str | None = None,
115-
limit: int = 100,
116200
start: int | None = None,
117201
end: int | None = None,
118202
duration: str = "1d",
@@ -141,7 +225,6 @@ def searchOrgWirelessClientEvents(
141225
802.11 Band
142226
wlan_id : str
143227
nacrule_id : str
144-
limit : int, default: 100
145228
start : int
146229
end : int
147230
duration : str, default: 1d
@@ -170,8 +253,6 @@ def searchOrgWirelessClientEvents(
170253
query_params["wlan_id"] = str(wlan_id)
171254
if nacrule_id:
172255
query_params["nacrule_id"] = str(nacrule_id)
173-
if limit:
174-
query_params["limit"] = str(limit)
175256
if start:
176257
query_params["start"] = str(start)
177258
if end:

src/mistapi/api/v1/orgs/events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def searchOrgEvents(
2424
limit: int = 100,
2525
) -> _APIResponse:
2626
"""
27-
API doc: https://www.juniper.net/documentation/us/en/software/mist/api/http/api/orgs/search-org-events
27+
API doc: https://www.juniper.net/documentation/us/en/software/mist/api/http/api/orgs/events/search-org-events
2828
2929
PARAMS
3030
-----------

src/mistapi/api/v1/orgs/stats.py

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,164 @@ def getOrgOtherDeviceStats(
572572
return resp
573573

574574

575+
def countOrgSwOrGwPorts(
576+
mist_session: _APISession,
577+
org_id: str,
578+
distinct: str = "mac",
579+
full_duplex: bool | None = None,
580+
mac: str | None = None,
581+
neighbor_mac: str | None = None,
582+
neighbor_port_desc: str | None = None,
583+
neighbor_system_name: str | None = None,
584+
poe_disabled: bool | None = None,
585+
poe_mode: str | None = None,
586+
poe_on: bool | None = None,
587+
port_id: str | None = None,
588+
port_mac: str | None = None,
589+
power_draw: float | None = None,
590+
tx_pkts: int | None = None,
591+
rx_pkts: int | None = None,
592+
rx_bytes: int | None = None,
593+
tx_bps: int | None = None,
594+
rx_bps: int | None = None,
595+
tx_mcast_pkts: int | None = None,
596+
tx_bcast_pkts: int | None = None,
597+
rx_mcast_pkts: int | None = None,
598+
rx_bcast_pkts: int | None = None,
599+
speed: int | None = None,
600+
stp_state: str | None = None,
601+
stp_role: str | None = None,
602+
auth_state: str | None = None,
603+
up: bool | None = None,
604+
site_id: str | None = None,
605+
start: int | None = None,
606+
end: int | None = None,
607+
duration: str = "1d",
608+
limit: int = 100,
609+
) -> _APIResponse:
610+
"""
611+
API doc: https://www.juniper.net/documentation/us/en/software/mist/api/http/api/orgs/stats/ports/count-org-sw-or-gw-ports
612+
613+
PARAMS
614+
-----------
615+
mistapi.APISession : mist_session
616+
mistapi session including authentication and Mist host information
617+
618+
PATH PARAMS
619+
-----------
620+
org_id : str
621+
622+
QUERY PARAMS
623+
------------
624+
distinct : str{'full_duplex', 'mac', 'neighbor_mac', 'neighbor_port_desc', 'neighbor_system_name', 'poe_disabled', 'poe_mode', 'poe_on', 'port_id', 'port_mac', 'speed', 'up'}, default: mac
625+
full_duplex : bool
626+
mac : str
627+
neighbor_mac : str
628+
neighbor_port_desc : str
629+
neighbor_system_name : str
630+
poe_disabled : bool
631+
poe_mode : str
632+
poe_on : bool
633+
port_id : str
634+
port_mac : str
635+
power_draw : float
636+
tx_pkts : int
637+
rx_pkts : int
638+
rx_bytes : int
639+
tx_bps : int
640+
rx_bps : int
641+
tx_mcast_pkts : int
642+
tx_bcast_pkts : int
643+
rx_mcast_pkts : int
644+
rx_bcast_pkts : int
645+
speed : int
646+
stp_state : str{'blocking', 'disabled', 'forwarding', 'learning', 'listening'}
647+
If `up`==`true`
648+
stp_role : str{'alternate', 'backup', 'designated', 'root', 'root-prevented'}
649+
If `up`==`true`
650+
auth_state : str{'authenticated', 'authenticating', 'held', 'init'}
651+
If `up`==`true` && has Authenticator role
652+
up : bool
653+
site_id : str
654+
start : int
655+
end : int
656+
duration : str, default: 1d
657+
limit : int, default: 100
658+
659+
RETURN
660+
-----------
661+
mistapi.APIResponse
662+
response from the API call
663+
"""
664+
665+
uri = f"/api/v1/orgs/{org_id}/stats/ports/count"
666+
query_params: dict[str, str] = {}
667+
if distinct:
668+
query_params["distinct"] = str(distinct)
669+
if full_duplex:
670+
query_params["full_duplex"] = str(full_duplex)
671+
if mac:
672+
query_params["mac"] = str(mac)
673+
if neighbor_mac:
674+
query_params["neighbor_mac"] = str(neighbor_mac)
675+
if neighbor_port_desc:
676+
query_params["neighbor_port_desc"] = str(neighbor_port_desc)
677+
if neighbor_system_name:
678+
query_params["neighbor_system_name"] = str(neighbor_system_name)
679+
if poe_disabled:
680+
query_params["poe_disabled"] = str(poe_disabled)
681+
if poe_mode:
682+
query_params["poe_mode"] = str(poe_mode)
683+
if poe_on:
684+
query_params["poe_on"] = str(poe_on)
685+
if port_id:
686+
query_params["port_id"] = str(port_id)
687+
if port_mac:
688+
query_params["port_mac"] = str(port_mac)
689+
if power_draw:
690+
query_params["power_draw"] = str(power_draw)
691+
if tx_pkts:
692+
query_params["tx_pkts"] = str(tx_pkts)
693+
if rx_pkts:
694+
query_params["rx_pkts"] = str(rx_pkts)
695+
if rx_bytes:
696+
query_params["rx_bytes"] = str(rx_bytes)
697+
if tx_bps:
698+
query_params["tx_bps"] = str(tx_bps)
699+
if rx_bps:
700+
query_params["rx_bps"] = str(rx_bps)
701+
if tx_mcast_pkts:
702+
query_params["tx_mcast_pkts"] = str(tx_mcast_pkts)
703+
if tx_bcast_pkts:
704+
query_params["tx_bcast_pkts"] = str(tx_bcast_pkts)
705+
if rx_mcast_pkts:
706+
query_params["rx_mcast_pkts"] = str(rx_mcast_pkts)
707+
if rx_bcast_pkts:
708+
query_params["rx_bcast_pkts"] = str(rx_bcast_pkts)
709+
if speed:
710+
query_params["speed"] = str(speed)
711+
if stp_state:
712+
query_params["stp_state"] = str(stp_state)
713+
if stp_role:
714+
query_params["stp_role"] = str(stp_role)
715+
if auth_state:
716+
query_params["auth_state"] = str(auth_state)
717+
if up:
718+
query_params["up"] = str(up)
719+
if site_id:
720+
query_params["site_id"] = str(site_id)
721+
if start:
722+
query_params["start"] = str(start)
723+
if end:
724+
query_params["end"] = str(end)
725+
if duration:
726+
query_params["duration"] = str(duration)
727+
if limit:
728+
query_params["limit"] = str(limit)
729+
resp = mist_session.mist_get(uri=uri, query=query_params)
730+
return resp
731+
732+
575733
def searchOrgSwOrGwPorts(
576734
mist_session: _APISession,
577735
org_id: str,
@@ -604,6 +762,7 @@ def searchOrgSwOrGwPorts(
604762
stp_state: str | None = None,
605763
stp_role: str | None = None,
606764
auth_state: str | None = None,
765+
type: str = "all",
607766
limit: int = 100,
608767
start: int | None = None,
609768
end: int | None = None,
@@ -655,6 +814,8 @@ def searchOrgSwOrGwPorts(
655814
If `up`==`true`
656815
auth_state : str{'authenticated', 'authenticating', 'held', 'init'}
657816
If `up`==`true` && has Authenticator role
817+
type : str{'switch', 'gateway', 'all'}, default: all
818+
Type of device. enum: `switch`, `gateway`, `all`
658819
limit : int, default: 100
659820
start : int
660821
end : int
@@ -726,6 +887,8 @@ def searchOrgSwOrGwPorts(
726887
query_params["stp_role"] = str(stp_role)
727888
if auth_state:
728889
query_params["auth_state"] = str(auth_state)
890+
if type:
891+
query_params["type"] = str(type)
729892
if limit:
730893
query_params["limit"] = str(limit)
731894
if start:

src/mistapi/api/v1/sites/stats.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,8 @@ def countSiteCalls(
516516
distinct: str = "mac",
517517
rating: int | None = None,
518518
app: str | None = None,
519-
start: str | None = None,
520-
end: str | None = None,
519+
start: int | None = None,
520+
end: int | None = None,
521521
limit: int = 100,
522522
) -> _APIResponse:
523523
"""
@@ -537,8 +537,8 @@ def countSiteCalls(
537537
distinct : str{'mac'}, default: mac
538538
rating : int
539539
app : str
540-
start : str
541-
end : str
540+
start : int
541+
end : int
542542
limit : int, default: 100
543543
544544
RETURN

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)