Skip to content

Commit 2606713

Browse files
committed
updating OAS, adding getself error log
1 parent 0b27a54 commit 2606713

62 files changed

Lines changed: 1267 additions & 1020 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ This class accepts different parameters, all optionals:
172172
| password | str | None | used if login/password is used. Can be defined later |
173173
| apitoken | str | None | used if API Token is used. Can be defined later |
174174
| host | str | None | Mist Cloud to reach (e.g. "api.mist.com"). Can be defined later |
175+
| keyring_service | str | None | If provided, the Mist MIST_HOST, MIST_APITOKEN, MIST_USER, MIST_PASSWORD are loaded from the system keyring using this service name |
175176
| vault_url | string | https://127.0.0.1:8200 | If the Mist MIST_HOST, MIST_APITOKEN, MIST_USER, MIST_PASSWORD are stored in an HashiCorp Vault, URL of the Vault instance |
176177
| vault_path | string | None | If the Mist MIST_HOST, MIST_APITOKEN, MIST_USER, MIST_PASSWORD are stored in an HashiCorp Vault, Path to the secret in Vault |
177178
| vault_mount_point | string | secret | If the Mist MIST_HOST, MIST_APITOKEN, MIST_USER, MIST_PASSWORD are stored in an HashiCorp Vault, Mount point for the secrets engine |
@@ -370,6 +371,7 @@ else:
370371
The package supports all Mist cloud instances:
371372

372373
- **APAC 01**: api.ac5.mist.com
374+
- **APAC 02**: api.gc5.mist.com
373375
- **APAC 03**: api.gc7.mist.com
374376
- **EMEA 01**: api.eu.mist.com
375377
- **EMEA 02**: api.gc3.mist.com

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.57.2"
7+
version = "0.58.0"
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/mistapi/__api_session.py

Lines changed: 185 additions & 126 deletions
Large diffs are not rendered by default.

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.57.2"
1+
__version__ = "0.58.0"
22
__author__ = "Thomas Munzer <tmunzer@juniper.net>"

src/mistapi/api/v1/msps/insights.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def getMspSle(
2121
sle: str | None = None,
2222
duration: str = "1d",
2323
interval: str | None = None,
24-
start: int | None = None,
25-
end: int | None = None,
24+
start: str | None = None,
25+
end: str | None = None,
2626
) -> _APIResponse:
2727
"""
2828
API doc: https://www.juniper.net/documentation/us/en/software/mist/api/http/api/msps/sles/get-msp-sle
@@ -42,8 +42,8 @@ def getMspSle(
4242
sle : str
4343
duration : str, default: 1d
4444
interval : str
45-
start : int
46-
end : int
45+
start : str
46+
end : str
4747
4848
RETURN
4949
-----------

src/mistapi/api/v1/msps/logs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def listMspAuditLogs(
2121
admin_name: str | None = None,
2222
message: str | None = None,
2323
sort: str | None = None,
24-
start: int | None = None,
25-
end: int | None = None,
24+
start: str | None = None,
25+
end: str | None = None,
2626
duration: str = "1d",
2727
limit: int = 100,
2828
page: int = 1,
@@ -46,8 +46,8 @@ def listMspAuditLogs(
4646
message : str
4747
sort : str{'-timestamp', 'admin_id', 'site_id', 'timestamp'}
4848
Sort order
49-
start : int
50-
end : int
49+
start : str
50+
end : str
5151
duration : str, default: 1d
5252
limit : int, default: 100
5353
page : int, default: 1

src/mistapi/api/v1/msps/search.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ def searchMspOrgGroup(
2020
type: str,
2121
q: str | None = None,
2222
limit: int = 100,
23-
start: int | None = None,
24-
end: int | None = None,
23+
start: str | None = None,
24+
end: str | None = None,
2525
duration: str = "1d",
2626
sort: str = "timestamp",
2727
) -> _APIResponse:
@@ -43,8 +43,8 @@ def searchMspOrgGroup(
4343
Orgs
4444
q : str
4545
limit : int, default: 100
46-
start : int
47-
end : int
46+
start : str
47+
end : str
4848
duration : str, default: 1d
4949
sort : str, default: timestamp
5050

src/mistapi/api/v1/msps/tickets.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
def listMspTickets(
1818
mist_session: _APISession,
1919
msp_id: str,
20-
start: int | None = None,
21-
end: int | None = None,
20+
start: str | None = None,
21+
end: str | None = None,
2222
duration: str = "1d",
2323
) -> _APIResponse:
2424
"""
@@ -35,8 +35,8 @@ def listMspTickets(
3535
3636
QUERY PARAMS
3737
------------
38-
start : int
39-
end : int
38+
start : str
39+
end : str
4040
duration : str, default: 1d
4141
4242
RETURN

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ def countOrgAlarms(
8080
mist_session: _APISession,
8181
org_id: str,
8282
distinct: str | None = None,
83-
start: int | None = None,
84-
end: int | None = None,
83+
start: str | None = None,
84+
end: str | None = None,
8585
duration: str = "1d",
8686
limit: int = 100,
8787
) -> _APIResponse:
@@ -100,8 +100,8 @@ def countOrgAlarms(
100100
QUERY PARAMS
101101
------------
102102
distinct : str
103-
start : int
104-
end : int
103+
start : str
104+
end : str
105105
duration : str, default: 1d
106106
limit : int, default: 100
107107
@@ -133,8 +133,8 @@ def searchOrgAlarms(
133133
site_id: str | None = None,
134134
type: str | None = None,
135135
status: str | None = None,
136-
start: int | None = None,
137-
end: int | None = None,
136+
start: str | None = None,
137+
end: str | None = None,
138138
duration: str = "1d",
139139
limit: int = 100,
140140
sort: str = "timestamp",
@@ -156,8 +156,8 @@ def searchOrgAlarms(
156156
site_id : str
157157
type : str
158158
status : str
159-
start : int
160-
end : int
159+
start : str
160+
end : str
161161
duration : str, default: 1d
162162
limit : int, default: 100
163163
sort : str, default: timestamp

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

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ def countOrgWirelessClients(
2626
ap: str | None = None,
2727
vlan: str | None = None,
2828
ssid: str | None = None,
29-
ip_address: str | None = None,
30-
start: int | None = None,
31-
end: int | None = None,
29+
ip: str | None = None,
30+
start: str | None = None,
31+
end: str | None = None,
3232
duration: str = "1d",
3333
limit: int = 100,
3434
) -> _APIResponse:
@@ -55,9 +55,9 @@ def countOrgWirelessClients(
5555
ap : str
5656
vlan : str
5757
ssid : str
58-
ip_address : str
59-
start : int
60-
end : int
58+
ip : str
59+
start : str
60+
end : str
6161
duration : str, default: 1d
6262
limit : int, default: 100
6363
@@ -87,8 +87,8 @@ def countOrgWirelessClients(
8787
query_params["vlan"] = str(vlan)
8888
if ssid:
8989
query_params["ssid"] = str(ssid)
90-
if ip_address:
91-
query_params["ip_address"] = str(ip_address)
90+
if ip:
91+
query_params["ip"] = str(ip)
9292
if start:
9393
query_params["start"] = str(start)
9494
if end:
@@ -113,8 +113,8 @@ def countOrgWirelessClientEvents(
113113
band: str | None = None,
114114
wlan_id: str | None = None,
115115
site_id: str | None = None,
116-
start: int | None = None,
117-
end: int | None = None,
116+
start: str | None = None,
117+
end: str | None = None,
118118
duration: str = "1d",
119119
limit: int = 100,
120120
) -> _APIResponse:
@@ -137,14 +137,14 @@ def countOrgWirelessClientEvents(
137137
reason_code : int
138138
ssid : str
139139
ap : str
140-
proto : str{'a', 'ac', 'ax', 'b', 'g', 'n'}
140+
proto : str{'a', 'ac', 'ax', 'b', 'be', 'g', 'n'}
141141
a / b / g / n / ac / ax
142142
band : str{'24', '5', '6'}
143143
802.11 Band
144144
wlan_id : str
145145
site_id : str
146-
start : int
147-
end : int
146+
start : str
147+
end : str
148148
duration : str, default: 1d
149149
limit : int, default: 100
150150
@@ -198,10 +198,11 @@ def searchOrgWirelessClientEvents(
198198
band: str | None = None,
199199
wlan_id: str | None = None,
200200
nacrule_id: str | None = None,
201-
start: int | None = None,
202-
end: int | None = None,
201+
start: str | None = None,
202+
end: str | None = None,
203203
duration: str = "1d",
204204
sort: str = "timestamp",
205+
limit: int = 100,
205206
) -> _APIResponse:
206207
"""
207208
API doc: https://www.juniper.net/documentation/us/en/software/mist/api/http/api/orgs/clients/wireless/search-org-wireless-client-events
@@ -221,18 +222,19 @@ def searchOrgWirelessClientEvents(
221222
reason_code : int
222223
ssid : str
223224
ap : str
224-
key_mgmt : str{'WPA2-PSK', 'WPA2-PSK-FT', 'WPA3-EAP-SHA256'}
225+
key_mgmt : str{'WPA2-PSK', 'WPA2-PSK/CCMP', 'WPA2-PSK-FT', 'WPA2-PSK-SHA256', 'WPA3-EAP-SHA256', 'WPA3-EAP-SHA256/CCMP', 'WPA3-EAP-FT/GCMP256', 'WPA3-SAE-FT', 'WPA3-SAE-PSK'}
225226
Key Management Protocol, e.g. WPA2-PSK, WPA3-SAE, WPA2-Enterprise
226-
proto : str{'a', 'ac', 'ax', 'b', 'g', 'n'}
227+
proto : str{'a', 'ac', 'ax', 'b', 'be', 'g', 'n'}
227228
a / b / g / n / ac / ax
228229
band : str{'24', '5', '6'}
229230
802.11 Band
230231
wlan_id : str
231232
nacrule_id : str
232-
start : int
233-
end : int
233+
start : str
234+
end : str
234235
duration : str, default: 1d
235236
sort : str, default: timestamp
237+
limit : int, default: 100
236238
237239
RETURN
238240
-----------
@@ -268,6 +270,8 @@ def searchOrgWirelessClientEvents(
268270
query_params["duration"] = str(duration)
269271
if sort:
270272
query_params["sort"] = str(sort)
273+
if limit:
274+
query_params["limit"] = str(limit)
271275
resp = mist_session.mist_get(uri=uri, query=query_params)
272276
return resp
273277

@@ -277,7 +281,7 @@ def searchOrgWirelessClients(
277281
org_id: str,
278282
site_id: str | None = None,
279283
mac: str | None = None,
280-
ip_address: str | None = None,
284+
ip: str | None = None,
281285
hostname: str | None = None,
282286
band: str | None = None,
283287
device: str | None = None,
@@ -291,8 +295,8 @@ def searchOrgWirelessClients(
291295
ssid: str | None = None,
292296
text: str | None = None,
293297
limit: int = 100,
294-
start: int | None = None,
295-
end: int | None = None,
298+
start: str | None = None,
299+
end: str | None = None,
296300
duration: str = "1d",
297301
sort: str = "timestamp",
298302
) -> _APIResponse:
@@ -312,7 +316,7 @@ def searchOrgWirelessClients(
312316
------------
313317
site_id : str
314318
mac : str
315-
ip_address : str
319+
ip : str
316320
hostname : str
317321
band : str
318322
device : str
@@ -326,8 +330,8 @@ def searchOrgWirelessClients(
326330
ssid : str
327331
text : str
328332
limit : int, default: 100
329-
start : int
330-
end : int
333+
start : str
334+
end : str
331335
duration : str, default: 1d
332336
sort : str, default: timestamp
333337
@@ -343,8 +347,8 @@ def searchOrgWirelessClients(
343347
query_params["site_id"] = str(site_id)
344348
if mac:
345349
query_params["mac"] = str(mac)
346-
if ip_address:
347-
query_params["ip_address"] = str(ip_address)
350+
if ip:
351+
query_params["ip"] = str(ip)
348352
if hostname:
349353
query_params["hostname"] = str(hostname)
350354
if band:
@@ -395,8 +399,8 @@ def countOrgWirelessClientsSessions(
395399
client_os: str | None = None,
396400
ssid: str | None = None,
397401
wlan_id: str | None = None,
398-
start: int | None = None,
399-
end: int | None = None,
402+
start: str | None = None,
403+
end: str | None = None,
400404
duration: str = "1d",
401405
limit: int = 100,
402406
) -> _APIResponse:
@@ -424,8 +428,8 @@ def countOrgWirelessClientsSessions(
424428
client_os : str
425429
ssid : str
426430
wlan_id : str
427-
start : int
428-
end : int
431+
start : str
432+
end : str
429433
duration : str, default: 1d
430434
limit : int, default: 100
431435
@@ -482,8 +486,8 @@ def searchOrgWirelessClientSessions(
482486
psk_id: str | None = None,
483487
psk_name: str | None = None,
484488
limit: int = 100,
485-
start: int | None = None,
486-
end: int | None = None,
489+
start: str | None = None,
490+
end: str | None = None,
487491
duration: str = "1d",
488492
sort: str = "timestamp",
489493
) -> _APIResponse:
@@ -514,8 +518,8 @@ def searchOrgWirelessClientSessions(
514518
psk_id : str
515519
psk_name : str
516520
limit : int, default: 100
517-
start : int
518-
end : int
521+
start : str
522+
end : str
519523
duration : str, default: 1d
520524
sort : str, default: timestamp
521525

0 commit comments

Comments
 (0)