Skip to content

Commit b74ac9a

Browse files
committed
feat(iotendpoints): add countSiteIotEndpoints and rejoinSiteIotEndpointZigbee functions with detailed API documentation
1 parent 9656b67 commit b74ac9a

1 file changed

Lines changed: 84 additions & 0 deletions

File tree

‎src/mistapi/api/v1/sites/iotendpoints.py‎

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,62 @@
1414
from mistapi.__api_response import APIResponse as _APIResponse
1515

1616

17+
def countSiteIotEndpoints(
18+
mist_session: _APISession,
19+
site_id: str,
20+
distinct: str | None = None,
21+
start: str | None = None,
22+
end: str | None = None,
23+
duration: str | None = None,
24+
limit: int | None = None,
25+
) -> _APIResponse:
26+
"""
27+
API doc: https://www.juniper.net/documentation/us/en/software/mist/api/http/api/sites/stats/iot-endpoints/count-site-iot-endpoints
28+
29+
PARAMS
30+
-----------
31+
mistapi.APISession : mist_session
32+
mistapi session including authentication and Mist host information
33+
34+
PATH PARAMS
35+
-----------
36+
site_id : str
37+
38+
QUERY PARAMS
39+
------------
40+
distinct : str{'ap_mac', 'mac', 'site_id', 'type'}, default: site_id
41+
Field used to group this count response. enum: `ap_mac`, `mac`, `site_id`, `type`
42+
start : str
43+
Lower bound of the time range, as an epoch timestamp in seconds or a relative value such as `-1d` or `-1w`
44+
end : str
45+
Upper bound of the time range, as an epoch timestamp in seconds or a relative value such as `-1d`, `-2h`, or `now`
46+
duration : str, default: 1d
47+
Time range duration for the query, using relative units such as `10m`, `7d`, or `2w`
48+
limit : int, default: 100
49+
Maximum number of results to return per page
50+
51+
RETURN
52+
-----------
53+
mistapi.APIResponse
54+
response from the API call
55+
"""
56+
57+
uri = f"/api/v1/sites/{site_id}/iotendpoints/count"
58+
query_params: dict[str, str] = {}
59+
if distinct:
60+
query_params["distinct"] = str(distinct)
61+
if start:
62+
query_params["start"] = str(start)
63+
if end:
64+
query_params["end"] = str(end)
65+
if duration:
66+
query_params["duration"] = str(duration)
67+
if limit:
68+
query_params["limit"] = str(limit)
69+
resp = mist_session.mist_get(uri=uri, query=query_params)
70+
return resp
71+
72+
1773
def searchSiteIotEndpoints(
1874
mist_session: _APISession,
1975
site_id: str,
@@ -83,3 +139,31 @@ def searchSiteIotEndpoints(
83139
query_params["duration"] = str(duration)
84140
resp = mist_session.mist_get(uri=uri, query=query_params)
85141
return resp
142+
143+
144+
def rejoinSiteIotEndpointZigbee(
145+
mist_session: _APISession, site_id: str, id: str
146+
) -> _APIResponse:
147+
"""
148+
API doc: https://www.juniper.net/documentation/us/en/software/mist/api/http/api/sites/stats/iot-endpoints/rejoin-site-iot-endpoint-zigbee
149+
150+
PARAMS
151+
-----------
152+
mistapi.APISession : mist_session
153+
mistapi session including authentication and Mist host information
154+
155+
PATH PARAMS
156+
-----------
157+
site_id : str
158+
id : str
159+
ID of the IoT Endpoint
160+
161+
RETURN
162+
-----------
163+
mistapi.APIResponse
164+
response from the API call
165+
"""
166+
167+
uri = f"/api/v1/sites/{site_id}/iotendpoints/{id}/zigbee_rejoin"
168+
resp = mist_session.mist_post(uri=uri)
169+
return resp

0 commit comments

Comments
 (0)