|
14 | 14 | from mistapi.__api_response import APIResponse as _APIResponse |
15 | 15 |
|
16 | 16 |
|
| 17 | +def countOrgClientFingerprints( |
| 18 | + mist_session: _APISession, |
| 19 | + org_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/orgs/nac-fingerprints/count-org-client-fingerprints |
| 28 | +
|
| 29 | + PARAMS |
| 30 | + ----------- |
| 31 | + mistapi.APISession : mist_session |
| 32 | + mistapi session including authentication and Mist host information |
| 33 | +
|
| 34 | + PATH PARAMS |
| 35 | + ----------- |
| 36 | + org_id : str |
| 37 | +
|
| 38 | + QUERY PARAMS |
| 39 | + ------------ |
| 40 | + distinct : str{'family', 'model', 'os', 'os_type'}, default: family |
| 41 | + Field used to group this count response. enum: `family`, `model`, `os`, `os_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/orgs/{org_id}/insights/fingerprints/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 | + |
| 73 | +def searchOrgClientFingerprints( |
| 74 | + mist_session: _APISession, |
| 75 | + org_id: str, |
| 76 | + family: str | None = None, |
| 77 | + client_type: str | None = None, |
| 78 | + model: str | None = None, |
| 79 | + mfg: str | None = None, |
| 80 | + os: str | None = None, |
| 81 | + os_type: str | None = None, |
| 82 | + mac: str | None = None, |
| 83 | + limit: int | None = None, |
| 84 | + start: str | None = None, |
| 85 | + end: str | None = None, |
| 86 | + duration: str | None = None, |
| 87 | + interval: str | None = None, |
| 88 | + sort: str | None = None, |
| 89 | + search_after: str | None = None, |
| 90 | +) -> _APIResponse: |
| 91 | + """ |
| 92 | + API doc: https://www.juniper.net/documentation/us/en/software/mist/api/http/api/orgs/nac-fingerprints/search-org-client-fingerprints |
| 93 | +
|
| 94 | + PARAMS |
| 95 | + ----------- |
| 96 | + mistapi.APISession : mist_session |
| 97 | + mistapi session including authentication and Mist host information |
| 98 | +
|
| 99 | + PATH PARAMS |
| 100 | + ----------- |
| 101 | + org_id : str |
| 102 | +
|
| 103 | + QUERY PARAMS |
| 104 | + ------------ |
| 105 | + family : str |
| 106 | + Device Category of the client device |
| 107 | + client_type : str{'wireless', 'wired', 'vty'} |
| 108 | + Filter results by client type. enum: `wireless`, `wired`, `vty` |
| 109 | + model : str |
| 110 | + Filter results by device model |
| 111 | + mfg : str |
| 112 | + Manufacturer name of the client device |
| 113 | + os : str |
| 114 | + Operating System name and version of the client device |
| 115 | + os_type : str |
| 116 | + Operating system name of the client device |
| 117 | + mac : str |
| 118 | + Filter results by MAC address |
| 119 | + limit : int, default: 100 |
| 120 | + Maximum number of results to return per page |
| 121 | + start : str |
| 122 | + Lower bound of the time range, as an epoch timestamp in seconds or a relative value such as `-1d` or `-1w` |
| 123 | + end : str |
| 124 | + Upper bound of the time range, as an epoch timestamp in seconds or a relative value such as `-1d`, `-2h`, or `now` |
| 125 | + duration : str, default: 1d |
| 126 | + Time range duration for the query, using relative units such as `10m`, `7d`, or `2w` |
| 127 | + interval : str |
| 128 | + Aggregation works by giving a time range plus interval (e.g. 1d, 1h, 10m) where aggregation function would be applied to. |
| 129 | + sort : str, default: wxid |
| 130 | + On which field the list should be sorted, -prefix represents DESC order. |
| 131 | + search_after : str |
| 132 | + Pagination cursor for retrieving subsequent pages of results. This value is automatically populated by Mist in the `next` URL from the previous response and should not be manually constructed. |
| 133 | +
|
| 134 | + RETURN |
| 135 | + ----------- |
| 136 | + mistapi.APIResponse |
| 137 | + response from the API call |
| 138 | + """ |
| 139 | + |
| 140 | + uri = f"/api/v1/orgs/{org_id}/insights/fingerprints/search" |
| 141 | + query_params: dict[str, str] = {} |
| 142 | + if family: |
| 143 | + query_params["family"] = str(family) |
| 144 | + if client_type: |
| 145 | + query_params["client_type"] = str(client_type) |
| 146 | + if model: |
| 147 | + query_params["model"] = str(model) |
| 148 | + if mfg: |
| 149 | + query_params["mfg"] = str(mfg) |
| 150 | + if os: |
| 151 | + query_params["os"] = str(os) |
| 152 | + if os_type: |
| 153 | + query_params["os_type"] = str(os_type) |
| 154 | + if mac: |
| 155 | + query_params["mac"] = str(mac) |
| 156 | + if limit: |
| 157 | + query_params["limit"] = str(limit) |
| 158 | + if start: |
| 159 | + query_params["start"] = str(start) |
| 160 | + if end: |
| 161 | + query_params["end"] = str(end) |
| 162 | + if duration: |
| 163 | + query_params["duration"] = str(duration) |
| 164 | + if interval: |
| 165 | + query_params["interval"] = str(interval) |
| 166 | + if sort: |
| 167 | + query_params["sort"] = str(sort) |
| 168 | + if search_after: |
| 169 | + query_params["search_after"] = str(search_after) |
| 170 | + resp = mist_session.mist_get(uri=uri, query=query_params) |
| 171 | + return resp |
| 172 | + |
| 173 | + |
17 | 174 | def getOrgMarvisClientInsights( |
18 | 175 | mist_session: _APISession, |
19 | 176 | org_id: str, |
|
0 commit comments