B `!@sGdddeZdS)cseZdZfddZedddZedddZeddd Zedd d Zedd d Z eedddZ edddZ edddZ edddZ ZS)Devicescstt|||_dS)N)superr__init___session)selfsession) __class__m/private/var/folders/7j/8686xlfs15q3tgljmghtvg0r0000gn/T/pip-target-isidps9b/lib/python/meraki/api/devices.pyrszDevices.__init__)serialcCs&ddgdd}d|}|j||S)z **Return a single device** https://developer.cisco.com/meraki/api-v1/#!get-device - serial (string): (required) devices configure getDevice)tags operationz /devices/)rget)rr metadataresourcerrr r s  zDevices.getDevicec s`|tddgdd}d|}dddd d d d d dg fdd|D}|j|||S)a **Update the attributes of a device** https://developer.cisco.com/meraki/api-v1/#!update-device - serial (string): (required) - name (string): The name of a device - tags (array): The list of tags of a device - lat (number): The latitude of a device - lng (number): The longitude of a device - address (string): The address of a device - notes (string): The notes for the device. String. Limited to 255 characters. - moveMapMarker (boolean): Whether or not to set the latitude and longitude of a device based on the new address. Only applies when lat and lng are not specified. - switchProfileId (string): The ID of a switch profile to bind to the device (for available switch profiles, see the 'Switch Profiles' endpoint). Use null to unbind the switch device from the current profile. For a device to be bindable to a switch profile, it must (1) be a switch, and (2) belong to a network that is bound to a configuration template. - floorPlanId (string): The floor plan to associate to this device. null disassociates the device from the floorplan. r r updateDevice)rrz /devices/namerZlatZlngaddressZnotesZ moveMapMarkerZswitchProfileIdZ floorPlanIdcs&i|]\}}|kr||qSr)strip).0kv) body_paramsrr 4sz(Devices.updateDevice..)updatelocalsitemsrput)rr kwargsrrpayloadr)rr rs  zDevices.updateDevicec sV|tddgdd}d|d}ddd gfd d |D}|j|||S) a **Blink the LEDs on a device** https://developer.cisco.com/meraki/api-v1/#!blink-device-leds - serial (string): (required) - duration (integer): The duration in seconds. Must be between 5 and 120. Default is 20 seconds - period (integer): The period in milliseconds. Must be between 100 and 1000. Default is 160 milliseconds - duty (integer): The duty cycle as the percent active. Must be between 10 and 90. Default is 50. r liveToolsblinkDeviceLeds)rrz /devices/z /blinkLedsdurationZperiodZdutycs&i|]\}}|kr||qSr)r)rrr)rrr rNsz+Devices.blinkDeviceLeds..)rrrrpost)rr r rrr!r)rr r#:s   zDevices.blinkDeviceLedsc sV|tdddgdd}d|d}dd gfd d |D}|j|||S) a **List the clients of a device, up to a maximum of a month ago** https://developer.cisco.com/meraki/api-v1/#!get-device-clients - serial (string): (required) - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameter t0. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. r monitorZclientsgetDeviceClients)rrz /devices/z/clientst0timespancs&i|]\}}|kr||qSr)r)rrr) query_paramsrr rgsz,Devices.getDeviceClients..)rrrrr)rr r rrparamsr)r*r r'Ts  zDevices.getDeviceClientscCs*dddgdd}d|d}|j||S)z **List LLDP and CDP information for a device** https://developer.cisco.com/meraki/api-v1/#!get-device-lldp-cdp - serial (string): (required) r r&ZlldpCdpgetDeviceLldpCdp)rrz /devices/z/lldpCdp)rr)rr rrrrr r,ms  zDevices.getDeviceLldpCdp)r ipc s|td|krBdddg}|d|ksBtd|dd|ddd gd d }d |d }ddddddgfdd|D}|j|||S)aX **Get the uplink loss percentage and latency in milliseconds, and goodput in kilobits per second for a wired network device.** https://developer.cisco.com/meraki/api-v1/#!get-device-loss-and-latency-history - serial (string): (required) - ip (string): The destination IP used to obtain the requested stats. This is required. - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 365 days from today. - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. - resolution (integer): The time resolution in seconds for returned data. The valid resolutions are: 60, 600, 3600, 86400. The default is 60. - uplink (string): The WAN uplink used to obtain the requested stats. Valid uplinks are wan1, wan2, cellular. The default is wan1. Zuplinkwan1wan2Zcellularz"uplink" cannot be "z", & must be set to one of: r r&ZlossAndLatencyHistorygetDeviceLossAndLatencyHistory)rrz /devices/z/lossAndLatencyHistoryr(t1r) resolutionr-cs&i|]\}}|kr||qSr)r)rrr)r*rr rsz:Devices.getDeviceLossAndLatencyHistory..)rrAssertionErrorrrr)rr r-r optionsrrr+r)r*r r0s  $ z&Devices.getDeviceLossAndLatencyHistorycCs*dddgdd}d|d}|j||S)z **Return the management interface settings for a device** https://developer.cisco.com/meraki/api-v1/#!get-device-management-interface - serial (string): (required) r r managementInterfacegetDeviceManagementInterface)rrz /devices/z/managementInterface)rr)rr rrrrr r6s  z$Devices.getDeviceManagementInterfacec sV|tdddgdd}d|d}dd gfd d |D}|j|||S) a/ **Update the management interface settings for a device** https://developer.cisco.com/meraki/api-v1/#!update-device-management-interface - serial (string): (required) - wan1 (object): WAN 1 settings - wan2 (object): WAN 2 settings (only for MX devices) r r r5updateDeviceManagementInterface)rrz /devices/z/managementInterfacer.r/cs&i|]\}}|kr||qSr)r)rrr)rrr rsz;Devices.updateDeviceManagementInterface..)rrrrr)rr r rrr!r)rr r7s  z'Devices.updateDeviceManagementInterfacecCs(ddgdd}d|d}|j||S)z **Reboot a device** https://developer.cisco.com/meraki/api-v1/#!reboot-device - serial (string): (required) r r" rebootDevice)rrz /devices/z/reboot)rr%)rr rrrrr r8s  zDevices.rebootDevice)__name__ __module__ __qualname__rstrr rr#r'r,r0r6r7r8 __classcell__rr)rr rs  !rN)objectrrrrr