Skip to content

Commit 08dcf7b

Browse files
committed
websocket tools added
1 parent 84c7615 commit 08dcf7b

46 files changed

Lines changed: 3264 additions & 1753 deletions

Some content is hidden

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

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[submodule "mist_openapi"]
22
path = mist_openapi
33
url = https://github.com/mistsys/mist_openapi.git
4-
branch = 2602.1.2
4+
branch = master

pyproject.toml

Lines changed: 12 additions & 9 deletions
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.60.3"
7+
version = "0.55.15"
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"]
@@ -35,14 +35,17 @@ dependencies = [
3535
"Bug Tracker" = "https://github.com/tmunzer/mistapi_python/issues"
3636

3737
# UV-specific configuration
38-
[tool.uv.scripts]
39-
test = "pytest"
40-
lint = "ruff check src/"
41-
fmt = "ruff format src/"
42-
build = "python -m build"
43-
44-
[tool.uv]
45-
dev-dependencies = [
38+
#[tool.uv]
39+
#preview = true
40+
41+
#[tool.uv.scripts]
42+
#test = "pytest"
43+
#lint = "ruff check src/"
44+
#fmt = "ruff format src/"
45+
#build = "python -m build"
46+
47+
[dependency-groups]
48+
dev = [
4649
# Testing dependencies
4750
"pytest>=8.4.0",
4851
"pytest-cov>=6.1.1",

src/mistapi/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from mistapi import api as api
1616
from mistapi import cli as cli
1717
from mistapi import websockets as websockets
18+
from mistapi import utils as utils
1819
from mistapi.__pagination import get_all as get_all
1920
from mistapi.__pagination import get_next as get_next
2021
from mistapi.__version import __author__ as __author__

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

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

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -144,38 +144,43 @@ def searchOrgAlarms(
144144
search_after: str | None = None,
145145
) -> _APIResponse:
146146
"""
147-
API doc: https://www.juniper.net/documentation/us/en/software/mist/api/http/api/orgs/alarms/search-org-alarms
148-
149-
PARAMS
150-
-----------
151-
mistapi.APISession : mist_session
152-
mistapi session including authentication and Mist host information
153-
154-
PATH PARAMS
155-
-----------
156-
org_id : str
157-
158-
QUERY PARAMS
159-
------------
160-
site_id : str
161-
group : str{'infrastructure', 'marvis', 'security'}
162-
Alarm group. enum: `infrastructure`, `marvis`, `security`
163-
severity : str{'critical', 'info', 'warn'}
164-
Severity of the alarm. enum: `critical`, `info`, `warn`
165-
type : str
166-
ack_admin_name : str
167-
acked : bool
168-
start : str
169-
end : str
170-
duration : str, default: 1d
171-
limit : int, default: 100
172-
sort : str, default: timestamp
173-
search_after : str
174-
175-
RETURN
176-
-----------
177-
mistapi.APIResponse
178-
response from the API call
147+
API doc: https://www.juniper.net/documentation/us/en/software/mist/api/http/api/orgs/alarms/search-org-alarms
148+
149+
PARAMS
150+
-----------
151+
mistapi.APISession : mist_session
152+
mistapi session including authentication and Mist host information
153+
154+
PATH PARAMS
155+
-----------
156+
org_id : str
157+
158+
QUERY PARAMS
159+
------------
160+
site_id : str
161+
group : str{'infrastructure', 'marvis', 'security'}
162+
Alarm group. enum: `infrastructure`, `marvis`, `security`.
163+
The `marvis` group is used to retrieve AI-driven network issue detections.
164+
Known Marvis alarm types include: `bad_cable`, `bad_wan_uplink`, `dns_failure`,
165+
`arp_failure`, `auth_failure`, `dhcp_failure`, `missing_vlan`,
166+
`negotiation_mismatch`, `port_flap`. Results include resolution status
167+
(`status`, `resolved_time`) and affected entity details."
168+
severity : str{'critical', 'info', 'warn'}
169+
Severity of the alarm. enum: `critical`, `info`, `warn`
170+
type : str
171+
ack_admin_name : str
172+
acked : bool
173+
start : str
174+
end : str
175+
duration : str, default: 1d
176+
limit : int, default: 100
177+
sort : str, default: timestamp
178+
search_after : str
179+
180+
RETURN
181+
-----------
182+
mistapi.APIResponse
183+
response from the API call
179184
"""
180185

181186
uri = f"/api/v1/orgs/{org_id}/alarms/search"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def searchOrgDeviceEvents(
260260
------------
261261
mac : str
262262
model : str
263-
device_type : str{'all', 'ap', 'gateway', 'switch'}, default: ap
263+
device_type : str, default: ap
264264
text : str
265265
timestamp : str
266266
type : str

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,8 @@ def searchOrgInventory(
316316
org_id: str,
317317
type: str | None = None,
318318
mac: str | None = None,
319-
vc_mac: str | None = None,
320-
master_mac: str | None = None,
319+
model: str | None = None,
320+
name: str | None = None,
321321
site_id: str | None = None,
322322
serial: str | None = None,
323323
master: str | None = None,
@@ -345,14 +345,15 @@ def searchOrgInventory(
345345
------------
346346
type : str{'ap', 'gateway', 'switch'}, default: ap
347347
mac : str
348-
vc_mac : str
349-
master_mac : str
348+
model : str
349+
name : str
350350
site_id : str
351351
serial : str
352352
master : str
353353
sku : str
354354
version : str
355-
status : str
355+
status : str{'connected', 'disconnected'}
356+
Device status. enum: `connected`, `disconnected`
356357
text : str
357358
limit : int, default: 100
358359
sort : str, default: timestamp
@@ -370,10 +371,10 @@ def searchOrgInventory(
370371
query_params["type"] = str(type)
371372
if mac:
372373
query_params["mac"] = str(mac)
373-
if vc_mac:
374-
query_params["vc_mac"] = str(vc_mac)
375-
if master_mac:
376-
query_params["master_mac"] = str(master_mac)
374+
if model:
375+
query_params["model"] = str(model)
376+
if name:
377+
query_params["name"] = str(name)
377378
if site_id:
378379
query_params["site_id"] = str(site_id)
379380
if serial:

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

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,15 @@ def searchOrgJsiAssetsAndContracts(
245245
sku: str | None = None,
246246
status: str | None = None,
247247
warranty_type: str | None = None,
248-
eol_duration: str | None = None,
249-
eos_duration: str | None = None,
248+
eol_after: str | None = None,
249+
eol_before: str | None = None,
250+
eos_after: str | None = None,
251+
eos_before: str | None = None,
252+
version_eos_after: str | None = None,
253+
version_eos_before: str | None = None,
250254
has_support: bool | None = None,
255+
sirt_id: str | None = None,
256+
pbn_id: str | None = None,
251257
text: str | None = None,
252258
limit: int | None = None,
253259
sort: str | None = None,
@@ -275,9 +281,15 @@ def searchOrgJsiAssetsAndContracts(
275281
Device status
276282
warranty_type : str{'Standard Hardware Warranty', 'Enhanced Hardware Warranty', 'Dead On Arrival Warranty', 'Limited Lifetime Warranty', 'Software Warranty', 'Limited Lifetime Warranty for WLA', 'Warranty-JCPO EOL (DOA Not Included)', 'MIST Enhanced Hardware Warranty', 'MIST Standard Warranty', 'Determine Lifetime warranty'}
277283
Device warranty type
278-
eol_duration : str
279-
eos_duration : str
284+
eol_after : str
285+
eol_before : str
286+
eos_after : str
287+
eos_before : str
288+
version_eos_after : str
289+
version_eos_before : str
280290
has_support : bool
291+
sirt_id : str
292+
pbn_id : str
281293
text : str
282294
limit : int, default: 100
283295
sort : str, default: timestamp
@@ -303,12 +315,24 @@ def searchOrgJsiAssetsAndContracts(
303315
query_params["status"] = str(status)
304316
if warranty_type:
305317
query_params["warranty_type"] = str(warranty_type)
306-
if eol_duration:
307-
query_params["eol_duration"] = str(eol_duration)
308-
if eos_duration:
309-
query_params["eos_duration"] = str(eos_duration)
318+
if eol_after:
319+
query_params["eol_after"] = str(eol_after)
320+
if eol_before:
321+
query_params["eol_before"] = str(eol_before)
322+
if eos_after:
323+
query_params["eos_after"] = str(eos_after)
324+
if eos_before:
325+
query_params["eos_before"] = str(eos_before)
326+
if version_eos_after:
327+
query_params["version_eos_after"] = str(version_eos_after)
328+
if version_eos_before:
329+
query_params["version_eos_before"] = str(version_eos_before)
310330
if has_support:
311331
query_params["has_support"] = str(has_support)
332+
if sirt_id:
333+
query_params["sirt_id"] = str(sirt_id)
334+
if pbn_id:
335+
query_params["pbn_id"] = str(pbn_id)
312336
if text:
313337
query_params["text"] = str(text)
314338
if limit:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ def listOrgDevicesStats(
410410
411411
QUERY PARAMS
412412
------------
413-
type : str{'all', 'ap', 'gateway', 'switch'}, default: ap
413+
type : str, default: ap
414414
status : str{'all', 'connected', 'disconnected'}, default: all
415415
site_id : str
416416
mac : str

0 commit comments

Comments
 (0)