B `h@sGdddeZdS)cseZdZfddZeedddZeedddZeed d d Z ed d dZ eedddZ ed ddZ ed ddZ eedddZeeedddZeedddZed ddZeed d!d"Zeed d#d$Zed d%d&Zeedd'd(Zeedd)d*Zeedd+d,Zeedd-d.Zeedd/d0Zeedd1d2Zeedd3d4Zeedd5d6Zed7d8d9ZdEeed<d=d>ZdFeed<d?d@ZdGeed<dAdBZ dHeed<dCdDZ!Z"S)ISMcstt|||_dS)N)superr__init___session)selfsession) __class__k/private/var/folders/7j/8686xlfs15q3tgljmghtvg0r0000gn/T/pip-target-isidps9b/lib/python/meraki_v0/api/sm.pyrsz SM.__init__) networkIdidscsJt}dgdd}d|d}dgfdd|D}|j|||S) a  **Bypass activation lock attempt** https://developer.cisco.com/meraki/api/#!create-network-sm-bypass-activation-lock-attempt - networkId (string) - ids (array): The ids of the devices to attempt activation lock bypass. r*createNetworkSmBypassActivationLockAttempt)tags operationz /networks/z /sm/bypassActivationLockAttemptsr cs&i|]\}}|kr||qSr)strip).0kv) body_paramsrr szASM.createNetworkSmBypassActivationLockAttempt..)localsitemsrpost)rr r kwargsmetadataresourcepayloadr)rr r s  z-SM.createNetworkSmBypassActivationLockAttempt)r attemptIdcCs*dgdd}d|d|}|j||S)z **Bypass activation lock attempt status** https://developer.cisco.com/meraki/api/#!get-network-sm-bypass-activation-lock-attempt - networkId (string) - attemptId (string) r'getNetworkSmBypassActivationLockAttempt)r rz /networks/z!/sm/bypassActivationLockAttempts/)rget)rr rrrrrr rs z*SM.getNetworkSmBypassActivationLockAttempt)r deviceFieldsc sV|tdgdd}d|d}dddd gfd d |D}|j|||S) a **Modify the fields of a device** https://developer.cisco.com/meraki/api/#!update-network-sm-device-fields - networkId (string) - deviceFields (object): The new fields of the device. Each field of this object is optional. - wifiMac (string): The wifiMac of the device to be modified. - id (string): The id of the device to be modified. - serial (string): The serial of the device to be modified. rupdateNetworkSmDeviceFields)r rz /networks/z/sm/device/fieldswifiMacidserialrcs&i|]\}}|kr||qSr)r)rrr)rrr rBsz2SM.updateNetworkSmDeviceFields..)updaterrrput)rr rrrrrr)rr r -s   zSM.updateNetworkSmDeviceFields)r c sV|tdgdd}d|d}dddd gfd d |D}|j|||S) a **Wipe a device** https://developer.cisco.com/meraki/api/#!wipe-network-sm-device - networkId (string) - wifiMac (string): The wifiMac of the device to be wiped. - id (string): The id of the device to be wiped. - serial (string): The serial of the device to be wiped. - pin (integer): The pin number (a six digit value) for wiping a macOS device. Required only for macOS devices. rwipeNetworkSmDevice)r rz /networks/z/sm/device/wiper!r"r#pincs&i|]\}}|kr||qSr)r)rrr)rrr r[sz*SM.wipeNetworkSmDevice..)r$rrrr%)rr rrrrr)rr r&Fs   zSM.wipeNetworkSmDevice)r deviceIdcCs,dgdd}d|d|d}|j||S)z **Refresh the details of a device** https://developer.cisco.com/meraki/api/#!refresh-network-sm-device-details - networkId (string) - deviceId (string) rrefreshNetworkSmDeviceDetails)r rz /networks/z /sm/device/z/refreshDetails)rr)rr r(rrrrr r)_s z SM.refreshNetworkSmDeviceDetailsc s\|tdgdd}d|d}dddd d d d gfd d|D}|j|||S)a **List the devices enrolled in an SM network with various specified fields and filters** https://developer.cisco.com/meraki/api/#!get-network-sm-devices - networkId (string) - fields (string): Additional fields that will be displayed for each device. Multiple fields can be passed in as comma separated values. The default fields are: id, name, tags, ssid, wifiMac, osName, systemModel, uuid, and serialNumber. The additional fields are: ip, systemType, availableDeviceCapacity, kioskAppName, biosVersion, lastConnected, missingAppsCount, userSuppliedAddress, location, lastUser, ownerEmail, ownerUsername, publicIp, phoneNumber, diskInfoJson, deviceCapacity, isManaged, hadMdm, isSupervised, meid, imei, iccid, simCarrierNetwork, cellularDataUsed, isHotspotEnabled, createdAt, batteryEstCharge, quarantined, avName, avRunning, asName, fwName, isRooted, loginRequired, screenLockEnabled, screenLockDelay, autoLoginDisabled, autoTags, hasMdm, hasDesktopAgent, diskEncryptionEnabled, hardwareEncryptionCaps, passCodeLock, usesHardwareKeystore, and androidSecurityPatchVersion. - wifiMacs (string): Filter devices by wifi mac(s). Multiple wifi macs can be passed in as comma separated values. - serials (string): Filter devices by serial(s). Multiple serials can be passed in as comma separated values. - ids (string): Filter devices by id(s). Multiple ids can be passed in as comma separated values. - scope (string): Specify a scope (one of all, none, withAny, withAll, withoutAny, or withoutAll) and a set of tags as comma separated values. - batchSize (integer): Number of devices to return, 1000 is the default as well as the max. - batchToken (string): If the network has more devices than the batch size, a batch token will be returned as a part of the device list. To see the remainder of the devices, pass in the batchToken as a parameter in the next request. Requests made with the batchToken do not require additional parameters as the batchToken includes the parameters passed in with the original request. Additional parameters passed in with the batchToken will be ignored. rgetNetworkSmDevices)r rz /networks/z /sm/devicesfieldswifiMacsserialsr scopeZ batchSizeZ batchTokencs&i|]\}}|kr||qSr)r)rrr) query_paramsrr rsz*SM.getNetworkSmDevices..)r$rrrr)rr rrrparamsr)r/r r*ps  zSM.getNetworkSmDevicesc sV|tdgdd}d|d}dddd gfd d |D}|j|||S) a **Force check-in a set of devices** https://developer.cisco.com/meraki/api/#!checkin-network-sm-devices - networkId (string) - wifiMacs (string): The wifiMacs of the devices to be checked-in. - ids (string): The ids of the devices to be checked-in. - serials (string): The serials of the devices to be checked-in. - scope (string): The scope (one of all, none, withAny, withAll, withoutAny, or withoutAll) and a set of tags of the devices to be checked-in. rcheckinNetworkSmDevices)r rz /networks/z/sm/devices/checkinr,r r-r.cs&i|]\}}|kr||qSr)r)rrr)rrr rsz.SM.checkinNetworkSmDevices..)r$rrrr%)rr rrrrr)rr r1s   zSM.checkinNetworkSmDevices)r newNetworkc sX|tdgdd}d|d}dddd d gfd d |D}|j|||S) aV **Move a set of devices to a new network** https://developer.cisco.com/meraki/api/#!move-network-sm-devices - networkId (string) - newNetwork (string): The new network to which the devices will be moved. - wifiMacs (string): The wifiMacs of the devices to be moved. - ids (string): The ids of the devices to be moved. - serials (string): The serials of the devices to be moved. - scope (string): The scope (one of all, none, withAny, withAll, withoutAny, or withoutAll) and a set of tags of the devices to be moved. rmoveNetworkSmDevices)r rz /networks/z/sm/devices/mover,r r-r.r2cs&i|]\}}|kr||qSr)r)rrr)rrr rsz+SM.moveNetworkSmDevices..)r$rrrr%)rr r2rrrrr)rr r3s  zSM.moveNetworkSmDevices)r r updateActionc sZ|tdgdd}d|d}dddd d d gfd d |D}|j|||S)a **Add, delete, or update the tags of a set of devices** https://developer.cisco.com/meraki/api/#!update-network-sm-devices-tags - networkId (string) - tags (string): The tags to be added, deleted, or updated. - updateAction (string): One of add, delete, or update. Only devices that have been modified will be returned. - wifiMacs (string): The wifiMacs of the devices to be modified. - ids (string): The ids of the devices to be modified. - serials (string): The serials of the devices to be modified. - scope (string): The scope (one of all, none, withAny, withAll, withoutAny, or withoutAll) and a set of tags of the devices to be modified. rupdateNetworkSmDevicesTags)r rz /networks/z/sm/devices/tagsr,r r-r.r r4cs&i|]\}}|kr||qSr)r)rrr)rrr rsz1SM.updateNetworkSmDevicesTags..)r$rrrr%)rr r r4rrrrr)rr r5s  zSM.updateNetworkSmDevicesTagscCs,dgdd}d|d|d}|j||S)z **Unenroll a device** https://developer.cisco.com/meraki/api/#!unenroll-network-sm-device - networkId (string) - deviceId (string) runenrollNetworkSmDevice)r rz /networks/z /sm/devices/z /unenroll)rr)rr r(rrrrr r6s zSM.unenrollNetworkSmDevicecCs&dgdd}d|d}|j||S)z **List all the profiles in the network** https://developer.cisco.com/meraki/api/#!get-network-sm-profiles - networkId (string) rgetNetworkSmProfiles)r rz /networks/z /sm/profiles)rr)rr rrrrr r7s  zSM.getNetworkSmProfiles)r userIdcCs,dgdd}d|d|d}|j||S)z **Get the profiles associated with a user** https://developer.cisco.com/meraki/api/#!get-network-sm-user-device-profiles - networkId (string) - userId (string) rgetNetworkSmUserDeviceProfiles)r rz /networks/z /sm/user/z/deviceProfiles)rr)rr r8rrrrr r9s z!SM.getNetworkSmUserDeviceProfilescCs,dgdd}d|d|d}|j||S)z **Get a list of softwares associated with a user** https://developer.cisco.com/meraki/api/#!get-network-sm-user-softwares - networkId (string) - userId (string) rgetNetworkSmUserSoftwares)r rz /networks/z /sm/user/z /softwares)rr)rr r8rrrrr r:s zSM.getNetworkSmUserSoftwaresc sV|tdgdd}d|d}dddd gfd d |D}|j|||S) a **List the owners in an SM network with various specified fields and filters** https://developer.cisco.com/meraki/api/#!get-network-sm-users - networkId (string) - ids (string): Filter users by id(s). Multiple ids can be passed in as comma separated values. - usernames (string): Filter users by username(s). Multiple usernames can be passed in as comma separated values. - emails (string): Filter users by email(s). Multiple emails can be passed in as comma separated values. - scope (string): Specifiy a scope (one of all, none, withAny, withAll, withoutAny, withoutAll) and a set of tags as comma separated values. rgetNetworkSmUsers)r rz /networks/z /sm/usersr Z usernamesZemailsr.cs&i|]\}}|kr||qSr)r)rrr)r/rr r;sz(SM.getNetworkSmUsers..)r$rrrr)rr rrrr0r)r/r r;&s   zSM.getNetworkSmUserscCs,dgdd}d|d|d}|j||S)a **Return the client's daily cellular data usage history. Usage data is in kilobytes.** https://developer.cisco.com/meraki/api/#!get-network-sm-cellular-usage-history - networkId (string) - deviceId (string) r getNetworkSmCellularUsageHistory)r rz /networks/z/sm/z/cellularUsageHistory)rr)rr r(rrrrr r<?s z#SM.getNetworkSmCellularUsageHistorycCs,dgdd}d|d|d}|j||S)z **List the certs on a device** https://developer.cisco.com/meraki/api/#!get-network-sm-certs - networkId (string) - deviceId (string) rgetNetworkSmCerts)r rz /networks/z/sm/z/certs)rr)rr r(rrrrr r=Ps zSM.getNetworkSmCertscCs,dgdd}d|d|d}|j||S)z **Get the profiles associated with a device** https://developer.cisco.com/meraki/api/#!get-network-sm-device-profiles - networkId (string) - deviceId (string) rgetNetworkSmDeviceProfiles)r rz /networks/z/sm/z/deviceProfiles)rr)rr r(rrrrr r>as zSM.getNetworkSmDeviceProfilescCs,dgdd}d|d|d}|j||S)z **List the network adapters of a device** https://developer.cisco.com/meraki/api/#!get-network-sm-network-adapters - networkId (string) - deviceId (string) rgetNetworkSmNetworkAdapters)r rz /networks/z/sm/z/networkAdapters)rr)rr r(rrrrr r?rs zSM.getNetworkSmNetworkAdapterscCs,dgdd}d|d|d}|j||S)z **List the restrictions on a device** https://developer.cisco.com/meraki/api/#!get-network-sm-restrictions - networkId (string) - deviceId (string) rgetNetworkSmRestrictions)r rz /networks/z/sm/z /restrictions)rr)rr r(rrrrr r@s zSM.getNetworkSmRestrictionscCs,dgdd}d|d|d}|j||S)z **List the security centers on a device** https://developer.cisco.com/meraki/api/#!get-network-sm-security-centers - networkId (string) - deviceId (string) rgetNetworkSmSecurityCenters)r rz /networks/z/sm/z/securityCenters)rr)rr r(rrrrr rAs zSM.getNetworkSmSecurityCenterscCs,dgdd}d|d|d}|j||S)z **Get a list of softwares associated with a device** https://developer.cisco.com/meraki/api/#!get-network-sm-softwares - networkId (string) - deviceId (string) rgetNetworkSmSoftwares)r rz /networks/z/sm/z /softwares)rr)rr r(rrrrr rBs zSM.getNetworkSmSoftwarescCs,dgdd}d|d|d}|j||S)z **List the saved SSID names on a device** https://developer.cisco.com/meraki/api/#!get-network-sm-wlan-lists - networkId (string) - deviceId (string) rgetNetworkSmWlanLists)r rz /networks/z/sm/z /wlanLists)rr)rr r(rrrrr rCs zSM.getNetworkSmWlanLists) network_idc sX|tdgdd}d|d}dddd d gfd d |D}|j|||S) ao **Lock a set of devices** https://developer.cisco.com/meraki/api/#!lock-network-sm-devices - network_id (string) - wifiMacs (string): The wifiMacs of the devices to be locked. - ids (string): The ids of the devices to be locked. - serials (string): The serials of the devices to be locked. - scope (string): The scope (one of all, none, withAny, withAll, withoutAny, or withoutAll) and a set of tags of the devices to be wiped. - pin (integer): The pin number for locking macOS devices (a six digit number). Required only for macOS devices. rlockNetworkSmDevices)r rz /networks/z/sm/devices/lockr,r r-r.r'cs&i|]\}}|kr||qSr)r)rrr)rrr rsz+SM.lockNetworkSmDevices..)r$rrrr%)rrDrrrrr)rr rEs  zSM.lockNetworkSmDevicesnext)rDr"c  s^|tdgdd}d|d|d}ddd gfd d |D}|j|||||S) a **Returns historical connectivity data (whether a device is regularly checking in to Dashboard).** https://developer.cisco.com/meraki/api/#!get-network-sm-connectivity - network_id (string) - id (string) - total_pages (integer or string): total number of pages to retrieve, -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. rgetNetworkSmConnectivity)r rz /networks/z/sm/z /connectivityperPage startingAfter endingBeforecs&i|]\}}|kr||qSr)r)rrr)r/rr rsz/SM.getNetworkSmConnectivity..)r$rrr get_pages) rrDr" total_pages directionrrrr0r)r/r rHs  zSM.getNetworkSmConnectivityc  s^|tdgdd}d|d|d}ddd gfd d |D}|j|||||S) a **Return historical records of various Systems Manager network connection details for desktop devices.** https://developer.cisco.com/meraki/api/#!get-network-sm-desktop-logs - network_id (string) - id (string) - total_pages (integer or string): total number of pages to retrieve, -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. rgetNetworkSmDesktopLogs)r rz /networks/z/sm/z /desktopLogsrIrJrKcs&i|]\}}|kr||qSr)r)rrr)r/rr rsz.SM.getNetworkSmDesktopLogs..)r$rrrrL) rrDr"rMrNrrrr0r)r/r rOs  zSM.getNetworkSmDesktopLogsc  s^|tdgdd}d|d|d}ddd gfd d |D}|j|||||S) a ** Return historical records of commands sent to Systems Manager devices.

Note that this will include the name of the Dashboard user who initiated the command if it was generated by a Dashboard admin rather than the automatic behavior of the system; you may wish to filter this out of any reports.

** https://developer.cisco.com/meraki/api/#!get-network-sm-device-command-logs - network_id (string) - id (string) - total_pages (integer or string): total number of pages to retrieve, -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. rgetNetworkSmDeviceCommandLogs)r rz /networks/z/sm/z/deviceCommandLogsrIrJrKcs&i|]\}}|kr||qSr)r)rrr)r/rr r4sz4SM.getNetworkSmDeviceCommandLogs..)r$rrrrL) rrDr"rMrNrrrr0r)r/r rPs  z SM.getNetworkSmDeviceCommandLogsc  s^|tdgdd}d|d|d}ddd gfd d |D}|j|||||S) a **Return historical records of various Systems Manager client metrics for desktop devices.** https://developer.cisco.com/meraki/api/#!get-network-sm-performance-history - network_id (string) - id (string) - total_pages (integer or string): total number of pages to retrieve, -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. rgetNetworkSmPerformanceHistory)r rz /networks/z/sm/z/performanceHistoryrIrJrKcs&i|]\}}|kr||qSr)r)rrr)r/rr rPsz5SM.getNetworkSmPerformanceHistory..)r$rrrrL) rrDr"rMrNrrrr0r)r/r rQ9s  z!SM.getNetworkSmPerformanceHistory)rFrG)rFrG)rFrG)rFrG)#__name__ __module__ __qualname__rstrlistr rdictr r&r)r*r1r3r5r6r7r9r:r;r<r=r>r?r@rArBrCrErHrOrPrQ __classcell__rr)rr rs8 % rN)objectrrrrr