Skip to content

Commit 4977f2b

Browse files
committed
0.61.2
1 parent ac62836 commit 4977f2b

14 files changed

Lines changed: 439 additions & 151 deletions

File tree

.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 = master
4+
branch = 2602.1.7

CHANGELOG.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,57 @@
11
# CHANGELOG
2+
## Version 0.61.2 (March 2026)
3+
4+
**Released**: March 17, 2026
5+
6+
This release adds automatic reconnection support for WebSocket streams, updates the OpenAPI specification, and includes minor bug fixes.
7+
8+
---
9+
10+
### 1. NEW FEATURES
11+
12+
#### **WebSocket Auto-Reconnect**
13+
`_MistWebsocket` now supports automatic reconnection with configurable parameters:
14+
- `auto_reconnect` — Enable/disable auto-reconnect (default: `False`)
15+
- `max_reconnect_attempts` — Maximum reconnect attempts before giving up (default: `5`)
16+
- `reconnect_backoff` — Base backoff delay in seconds, with exponential increase (default: `2.0`)
17+
18+
When enabled, the WebSocket automatically reconnects on transient failures using exponential backoff. User-initiated `disconnect()` calls are respected during reconnection attempts.
19+
20+
```python
21+
ws = mistapi.websockets.sites.DeviceStatsEvents(
22+
apisession,
23+
site_ids=["<site_id>"],
24+
auto_reconnect=True,
25+
max_reconnect_attempts=5,
26+
reconnect_backoff=2.0
27+
)
28+
ws.connect(run_in_background=True)
29+
```
30+
31+
---
32+
33+
### 2. API CHANGES (OpenAPI 2602.1.7)
34+
35+
Updated to mist_openapi spec version 2602.1.7.
36+
37+
#### **Insights API**
38+
- **`getSiteInsightMetrics()`** — Now uses `metrics` as a query parameter instead of a path parameter
39+
- **`getSiteInsightMetricsForAP()`** — New function to retrieve insight metrics for a specific AP
40+
- **`getSiteInsightMetricsForClient()`** — Changed `metric` path parameter to `metrics` query parameter
41+
- **`getSiteInsightMetricsForGateway()`** — Changed `metric` path parameter to `metrics` query parameter
42+
43+
#### **Stats API**
44+
- **`getOrgStats()`** — Removed `start`, `end`, `duration`, `limit`, `page` query parameters
45+
- **`listOrgSiteStats()`** — Removed `start`, `end`, `duration` query parameters
46+
47+
---
48+
49+
### 3. BUG FIXES
50+
51+
- Fixed `ShellSession.recv()` to gracefully handle socket timeout reset when the connection is already closed
52+
53+
---
54+
255
## Version 0.61.1 (March 2026)
356

457
**Released**: March 15, 2026

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.61.1"
7+
version = "0.61.2"
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/__version.py

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

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

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,7 @@
1414
from mistapi.__api_response import APIResponse as _APIResponse
1515

1616

17-
def getOrgStats(
18-
mist_session: _APISession,
19-
org_id: str,
20-
start: str | None = None,
21-
end: str | None = None,
22-
duration: str | None = None,
23-
limit: int | None = None,
24-
page: int | None = None,
25-
) -> _APIResponse:
17+
def getOrgStats(mist_session: _APISession, org_id: str) -> _APIResponse:
2618
"""
2719
API doc: https://www.juniper.net/documentation/us/en/software/mist/api/http/api/orgs/stats/get-org-stats
2820
@@ -35,14 +27,6 @@ def getOrgStats(
3527
-----------
3628
org_id : str
3729
38-
QUERY PARAMS
39-
------------
40-
start : str
41-
end : str
42-
duration : str, default: 1d
43-
limit : int, default: 100
44-
page : int, default: 1
45-
4630
RETURN
4731
-----------
4832
mistapi.APIResponse
@@ -51,16 +35,6 @@ def getOrgStats(
5135

5236
uri = f"/api/v1/orgs/{org_id}/stats"
5337
query_params: dict[str, str] = {}
54-
if start:
55-
query_params["start"] = str(start)
56-
if end:
57-
query_params["end"] = str(end)
58-
if duration:
59-
query_params["duration"] = str(duration)
60-
if limit:
61-
query_params["limit"] = str(limit)
62-
if page:
63-
query_params["page"] = str(page)
6438
resp = mist_session.mist_get(uri=uri, query=query_params)
6539
return resp
6640

@@ -1017,9 +991,6 @@ def searchOrgSwOrGwPorts(
1017991
def listOrgSiteStats(
1018992
mist_session: _APISession,
1019993
org_id: str,
1020-
start: str | None = None,
1021-
end: str | None = None,
1022-
duration: str | None = None,
1023994
limit: int | None = None,
1024995
page: int | None = None,
1025996
) -> _APIResponse:
@@ -1037,9 +1008,6 @@ def listOrgSiteStats(
10371008
10381009
QUERY PARAMS
10391010
------------
1040-
start : str
1041-
end : str
1042-
duration : str, default: 1d
10431011
limit : int, default: 100
10441012
page : int, default: 1
10451013
@@ -1051,12 +1019,6 @@ def listOrgSiteStats(
10511019

10521020
uri = f"/api/v1/orgs/{org_id}/stats/sites"
10531021
query_params: dict[str, str] = {}
1054-
if start:
1055-
query_params["start"] = str(start)
1056-
if end:
1057-
query_params["end"] = str(end)
1058-
if duration:
1059-
query_params["duration"] = str(duration)
10601022
if limit:
10611023
query_params["limit"] = str(limit)
10621024
if page:

0 commit comments

Comments
 (0)