B `j@sGdddeZdS)cs|eZdZfddZedddZedddZeedd d Zeeed d d Z eedddZ eedddZ edddZ eedddZ eedddZeedddZeeddd Zeed!d"d#Zeed!d$d%Zeeeeed&d'd(Zeed)d*d+Zeed)d,d-Zeeeed.d/d0Zeed1d2d3Zeed1d4d5Zedd6d7Zedd8d9Zedd:d;ZZS)<ActionBatchNetworkscstt|dS)N)superr__init__)self) __class__t/private/var/folders/7j/8686xlfs15q3tgljmghtvg0r0000gn/T/pip-target-isidps9b/lib/python/meraki/api/batch/networks.pyrszActionBatchNetworks.__init__) networkIdc sX|tddgdd}d|}dddd d gfd d |D}|d |d}|S)aR **Update a network** https://developer.cisco.com/meraki/api-v1/#!update-network - networkId (string): (required) - name (string): The name of the network - timeZone (string): The timezone of the network. For a list of allowed timezones, please see the 'TZ' column in the table in this article. - tags (array): A list of tags to be applied to the network - enrollmentString (string): A unique identifier which can be used for device enrollment or easy access through the Meraki SM Registration page or the Self Service Portal. Please note that changing this field may cause existing bookmarks to break. - notes (string): Add any notes or additional information about this network here. networks configure updateNetwork)tags operationz /networks/nameZtimeZoner ZenrollmentStringZnotescs&i|]\}}|kr||qSr)strip).0kv) body_paramsrr sz5ActionBatchNetworks.updateNetwork..update)resourcer body)rlocalsitems)rrkwargsmetadatarpayloadactionr)rrr s  z!ActionBatchNetworks.updateNetworkcCs(ddgdd}d|}|dtd}|S)z **Delete a network** https://developer.cisco.com/meraki/api-v1/#!delete-network - networkId (string): (required) r r deleteNetwork)r r z /networks/destroy)rr r)r)rrrrrrrrr*s  z!ActionBatchNetworks.deleteNetwork)rconfigTemplateIdc sT|tddgdd}d|d}ddgfd d |D}|d |d }|S) aq **Bind a network to a template.** https://developer.cisco.com/meraki/api-v1/#!bind-network - networkId (string): (required) - configTemplateId (string): The ID of the template to which the network should be bound. - autoBind (boolean): Optional boolean indicating whether the network's switches should automatically bind to profiles of the same model. Defaults to false if left unspecified. This option only affects switch networks and switch templates. Auto-bind is not valid unless the switch template has at least one profile and has at most one profile per switch model. r r bindNetwork)r r z /networks/z/bindr ZautoBindcs&i|]\}}|kr||qSr)r)rrr)rrrrWsz3ActionBatchNetworks.bindNetwork..create)rr r)rrr)rrr rrrrrr)rrr!Ds  zActionBatchNetworks.bindNetwork)rclients devicePolicyc  s|td|krFdddddg}|d|ksFtd|dd|d d d gd d }d|d}d ddddgfdd|D}|d|d} | S)a **Provisions a client with a name and policy** https://developer.cisco.com/meraki/api-v1/#!provision-network-clients - networkId (string): (required) - clients (array): The array of clients to provision - devicePolicy (string): The policy to apply to the specified client. Can be 'Group policy', 'Allowed', 'Blocked', 'Per connection' or 'Normal'. Required. - groupPolicyId (string): The ID of the desired group policy to apply to the client. Required if 'devicePolicy' is set to "Group policy". Otherwise this is ignored. - policiesBySecurityAppliance (object): An object, describing what the policy-connection association is for the security appliance. (Only relevant if the security appliance is actually within the network) - policiesBySsid (object): An object, describing the policy-connection associations for each active SSID within the network. Keys should be the number of enabled SSIDs, mapping to an object describing the client's policy r$z Group policyZAllowedZBlockedzPer connectionZNormalz"devicePolicy" cannot be "z", & must be set to one of: r r r#provisionNetworkClients)r r z /networks/z/clients/provision groupPolicyIdZpoliciesBySecurityApplianceZpoliciesBySsidcs&i|]\}}|kr||qSr)r)rrr)rrrr~sz?ActionBatchNetworks.provisionNetworkClients..r")rr r)rrAssertionErrorr) rrr#r$roptionsrrrrr)rrr%ds $ z+ActionBatchNetworks.provisionNetworkClients)rserialscsNt}dddgdd}d|d}dgfd d |D}|d |d }|S) aW **Claim devices into a network. (Note: for recently claimed devices, it may take a few minutes for API requsts against that device to succeed)** https://developer.cisco.com/meraki/api-v1/#!claim-network-devices - networkId (string): (required) - serials (array): A list of serials of devices to claim r r devicesclaimNetworkDevices)r r z /networks/z/devices/claimr)cs&i|]\}}|kr||qSr)r)rrr)rrrrsz;ActionBatchNetworks.claimNetworkDevices..r")rr r)rr)rrr)rrrrrr)rrr+s  z'ActionBatchNetworks.claimNetworkDevices)rserialcsNt}dddgdd}d|d}dgfd d |D}|d |d }|S) z **Remove a single device** https://developer.cisco.com/meraki/api-v1/#!remove-network-devices - networkId (string): (required) - serial (string): The serial of a device r r r*removeNetworkDevices)r r z /networks/z/devices/remover,cs&i|]\}}|kr||qSr)r)rrr)rrrrsz.r")rr r)rr)rrr,rrrrrr)rrr-s  z(ActionBatchNetworks.removeNetworkDevicesc sX|tdddgdd}d|d}dd d gfd d |D}|d |d}|S)a **Update firmware upgrade information for a network** https://developer.cisco.com/meraki/api-v1/#!update-network-firmware-upgrades - networkId (string): (required) - upgradeWindow (object): Upgrade window for devices in network - timezone (string): The timezone for the network - products (object): Contains information about the network to update r r firmwareUpgradesupdateNetworkFirmwareUpgrades)r r z /networks/z/firmwareUpgradesZ upgradeWindowtimezoneZproductscs&i|]\}}|kr||qSr)r)rrr)rrrrszEActionBatchNetworks.updateNetworkFirmwareUpgrades..r)rr r)rrr)rrrrrrrr)rrr/s   z1ActionBatchNetworks.updateNetworkFirmwareUpgrades)rreasonsc  s|td|krHddddddg}|d|ksHtd|dd |d d d d gdd}d|d}ddddgfdd|D}|d|d}|S)a **Rollback a Firmware Upgrade For A Network** https://developer.cisco.com/meraki/api-v1/#!create-network-firmware-upgrades-rollback - networkId (string): (required) - reasons (array): Reasons for the rollback - product (string): Product type to rollback (if the network is a combined network) - time (string): Scheduled time for the rollback - toVersion (object): Version to downgrade to (if the network has firmware flexibility) productZwirelessswitchZ applianceZcameraZvmxHostZcellularGatewayz"product" cannot be "z", & must be set to one of: r r r.Z rollbacks%createNetworkFirmwareUpgradesRollback)r r z /networks/z/firmwareUpgrades/rollbackstimer1Z toVersioncs&i|]\}}|kr||qSr)r)rrr)rrrrszMActionBatchNetworks.createNetworkFirmwareUpgradesRollback..r")rr r)rrr'r) rrr1rr(rrrrr)rrr4s $   z9ActionBatchNetworks.createNetworkFirmwareUpgradesRollback)r floorPlanIdc sd|tdddgdd}d|d|}dd d d d d dgfdd|D}|d|d}|S)a **Update a floor plan's geolocation and other meta data** https://developer.cisco.com/meraki/api-v1/#!update-network-floor-plan - networkId (string): (required) - floorPlanId (string): (required) - name (string): The name of your floor plan. - center (object): The longitude and latitude of the center of your floor plan. If you want to change the geolocation data of your floor plan, either the 'center' or two adjacent corners (e.g. 'topLeftCorner' and 'bottomLeftCorner') must be specified. If 'center' is specified, the floor plan is placed over that point with no rotation. If two adjacent corners are specified, the floor plan is rotated to line up with the two specified points. The aspect ratio of the floor plan's image is preserved regardless of which corners/center are specified. (This means if that more than two corners are specified, only two corners may be used to preserve the floor plan's aspect ratio.). No two points can have the same latitude, longitude pair. - bottomLeftCorner (object): The longitude and latitude of the bottom left corner of your floor plan. - bottomRightCorner (object): The longitude and latitude of the bottom right corner of your floor plan. - topLeftCorner (object): The longitude and latitude of the top left corner of your floor plan. - topRightCorner (object): The longitude and latitude of the top right corner of your floor plan. - imageContents (string): The file contents (a base 64 encoded string) of your new image. Supported formats are PNG, GIF, and JPG. Note that all images are saved as PNG files, regardless of the format they are uploaded in. If you upload a new image, and you do NOT specify any new geolocation fields ('center, 'topLeftCorner', etc), the floor plan will be recentered with no rotation in order to maintain the aspect ratio of your new image. r r floorPlansupdateNetworkFloorPlan)r r z /networks/z /floorPlans/rcenterZbottomLeftCornerZbottomRightCornerZ topLeftCornerZtopRightCornerZ imageContentscs&i|]\}}|kr||qSr)r)rrr)rrrr)sz>ActionBatchNetworks.updateNetworkFloorPlan..r)rr r)rrr)rrr6rrrrrr)rrr8s z*ActionBatchNetworks.updateNetworkFloorPlancCs0dddgdd}d|d|}|dtd }|S) z **Destroy a floor plan** https://developer.cisco.com/meraki/api-v1/#!delete-network-floor-plan - networkId (string): (required) - floorPlanId (string): (required) r r r7deleteNetworkFloorPlan)r r z /networks/z /floorPlans/r)rr r)r)rrr6rrrrrrr:6s z*ActionBatchNetworks.deleteNetworkFloorPlan)rrc  s|td|kr@ddg}|d|ks@td|dd|dddgd d }d |d }d dddddddgfdd|D}|d|d}|S)a **Create a group policy** https://developer.cisco.com/meraki/api-v1/#!create-network-group-policy - networkId (string): (required) - name (string): The name for your group policy. Required. - scheduling (object): The schedule for the group policy. Schedules are applied to days of the week. - bandwidth (object): The bandwidth settings for clients bound to your group policy. - firewallAndTrafficShaping (object): The firewall and traffic shaping rules and settings for your policy. - contentFiltering (object): The content filtering settings for your group policy - splashAuthSettings (string): Whether clients bound to your policy will bypass splash authorization or behave according to the network's rules. Can be one of 'network default' or 'bypass'. Only available if your network has a wireless configuration. - vlanTagging (object): The VLAN tagging settings for your group policy. Only available if your network has a wireless configuration. - bonjourForwarding (object): The Bonjour settings for your group policy. Only valid if your network has a wireless configuration. splashAuthSettingsznetwork defaultbypassz "splashAuthSettings" cannot be "z", & must be set to one of: r r groupPoliciescreateNetworkGroupPolicy)r r z /networks/z/groupPoliciesr scheduling bandwidthfirewallAndTrafficShapingcontentFiltering vlanTaggingbonjourForwardingcs&i|]\}}|kr||qSr)r)rrr)rrrrqsz@ActionBatchNetworks.createNetworkGroupPolicy..r")rr r)rrr'r) rrrrr(rrrrr)rrr>Qs $ z,ActionBatchNetworks.createNetworkGroupPolicy)rr&c  s|td|kr@ddg}|d|ks@td|dd|dddgd d }d |d |}d dddddddgfdd|D}|d|d}|S)a **Update a group policy** https://developer.cisco.com/meraki/api-v1/#!update-network-group-policy - networkId (string): (required) - groupPolicyId (string): (required) - name (string): The name for your group policy. - scheduling (object): The schedule for the group policy. Schedules are applied to days of the week. - bandwidth (object): The bandwidth settings for clients bound to your group policy. - firewallAndTrafficShaping (object): The firewall and traffic shaping rules and settings for your policy. - contentFiltering (object): The content filtering settings for your group policy - splashAuthSettings (string): Whether clients bound to your policy will bypass splash authorization or behave according to the network's rules. Can be one of 'network default' or 'bypass'. Only available if your network has a wireless configuration. - vlanTagging (object): The VLAN tagging settings for your group policy. Only available if your network has a wireless configuration. - bonjourForwarding (object): The Bonjour settings for your group policy. Only valid if your network has a wireless configuration. r;znetwork defaultr<z "splashAuthSettings" cannot be "z", & must be set to one of: r r r=updateNetworkGroupPolicy)r r z /networks/z/groupPolicies/rr?r@rArBrCrDcs&i|]\}}|kr||qSr)r)rrr)rrrrsz@ActionBatchNetworks.updateNetworkGroupPolicy..r)rr r)rrr'r) rrr&rr(rrrrr)rrrE~s $z,ActionBatchNetworks.updateNetworkGroupPolicycCs0dddgdd}d|d|}|dtd }|S) z **Delete a group policy** https://developer.cisco.com/meraki/api-v1/#!delete-network-group-policy - networkId (string): (required) - groupPolicyId (string): (required) r r r=deleteNetworkGroupPolicy)r r z /networks/z/groupPolicies/r)rr r)r)rrr&rrrrrrrFs z,ActionBatchNetworks.deleteNetworkGroupPolicy)remailrpasswordauthorizationsc  s|td|krBdddg}|d|ksBtd|dd|ddd gd d }d |d } ddddddgfdd|D} | d| d} | S)aa **Authorize a user configured with Meraki Authentication for a network (currently supports 802.1X, splash guest, and client VPN users, and currently, organizations have a 50,000 user cap)** https://developer.cisco.com/meraki/api-v1/#!create-network-meraki-auth-user - networkId (string): (required) - email (string): Email address of the user - name (string): Name of the user - password (string): The password for this user account - authorizations (array): Authorization zones and expiration dates for the user. - accountType (string): Authorization type for user. Can be 'Guest' or '802.1X' for wireless networks, or 'Client VPN' for wired networks. Defaults to '802.1X'. - emailPasswordToUser (boolean): Whether or not Meraki should email the password to user. Default is false. Z accountTypeZGuestz802.1Xz Client VPNz"accountType" cannot be "z", & must be set to one of: r r merakiAuthUserscreateNetworkMerakiAuthUser)r r z /networks/z/merakiAuthUsersrGrrHemailPasswordToUserrIcs&i|]\}}|kr||qSr)r)rrr)rrrrszCActionBatchNetworks.createNetworkMerakiAuthUser..r")rr r)rrr'r) rrrGrrHrIrr(rrrrr)rrrKs  $ z/ActionBatchNetworks.createNetworkMerakiAuthUser)rmerakiAuthUserIdcCs0dddgdd}d|d|}|dtd }|S) z **Deauthorize a user** https://developer.cisco.com/meraki/api-v1/#!delete-network-meraki-auth-user - networkId (string): (required) - merakiAuthUserId (string): (required) r r rJdeleteNetworkMerakiAuthUser)r r z /networks/z/merakiAuthUsers/r)rr r)r)rrrMrrrrrrrNs z/ActionBatchNetworks.deleteNetworkMerakiAuthUserc s^|tdddgdd}d|d|}dd d d gfd d |D}|d|d}|S)a| **Update a user configured with Meraki Authentication (currently, 802.1X RADIUS, splash guest, and client VPN users can be updated)** https://developer.cisco.com/meraki/api-v1/#!update-network-meraki-auth-user - networkId (string): (required) - merakiAuthUserId (string): (required) - name (string): Name of the user - password (string): The password for this user account - emailPasswordToUser (boolean): Whether or not Meraki should email the password to user. Default is false. - authorizations (array): Authorization zones and expiration dates for the user. r r rJupdateNetworkMerakiAuthUser)r r z /networks/z/merakiAuthUsers/rrHrLrIcs&i|]\}}|kr||qSr)r)rrr)rrrr szCActionBatchNetworks.updateNetworkMerakiAuthUser..r)rr r)rrr)rrrMrrrrrr)rrrO s  z/ActionBatchNetworks.updateNetworkMerakiAuthUser)rrhostportc sRt}dddgdd}d|d}dd d gfd d |D}|d |d} | S)ac **Add an MQTT broker** https://developer.cisco.com/meraki/api-v1/#!create-network-mqtt-broker - networkId (string): (required) - name (string): Name of the MQTT broker - host (string): Host name/IP address where MQTT broker runs - port (integer): Host port though which MQTT broker can be reached r r mqttBrokerscreateNetworkMqttBroker)r r z /networks/z /mqttBrokersrrPrQcs&i|]\}}|kr||qSr)r)rrr)rrrrAsz?ActionBatchNetworks.createNetworkMqttBroker..r")rr r)rr) rrrrPrQrrrrrr)rrrS-s   z+ActionBatchNetworks.createNetworkMqttBroker)r mqttBrokerIdc s\|tdddgdd}d|d|}dd d gfd d |D}|d |d}|S)a **Update an MQTT broker** https://developer.cisco.com/meraki/api-v1/#!update-network-mqtt-broker - networkId (string): (required) - mqttBrokerId (string): (required) - name (string): Name of the mqtt config - host (string): Host name where mqtt broker runs - port (integer): Host port though which mqtt broker can be reached r r rRupdateNetworkMqttBroker)r r z /networks/z /mqttBrokers/rrPrQcs&i|]\}}|kr||qSr)r)rrr)rrrrcsz?ActionBatchNetworks.updateNetworkMqttBroker..r)rr r)rrr)rrrTrrrrrr)rrrUNs  z+ActionBatchNetworks.updateNetworkMqttBrokercCs0dddgdd}d|d|}|dtd }|S) z **Delete an MQTT broker** https://developer.cisco.com/meraki/api-v1/#!delete-network-mqtt-broker - networkId (string): (required) - mqttBrokerId (string): (required) r r rRdeleteNetworkMqttBroker)r r z /networks/z /mqttBrokers/r)rr r)r)rrrTrrrrrrrVps z+ActionBatchNetworks.deleteNetworkMqttBrokerc sX|tdddgdd}d|d}dd d gfd d |D}|d |d}|S)at **Update the settings for a network** https://developer.cisco.com/meraki/api-v1/#!update-network-settings - networkId (string): (required) - localStatusPageEnabled (boolean): Enables / disables the local device status pages (my.meraki.com, ap.meraki.com, switch.meraki.com, wired.meraki.com). Optional (defaults to false) - remoteStatusPageEnabled (boolean): Enables / disables access to the device status page (http://[device's LAN IP]). Optional. Can only be set if localStatusPageEnabled is set to true - secureConnect (object): A hash of SecureConnect options applied to the Network. r r settingsupdateNetworkSettings)r r z /networks/z /settingsZlocalStatusPageEnabledZremoteStatusPageEnabledZ secureConnectcs&i|]\}}|kr||qSr)r)rrr)rrrrsz=ActionBatchNetworks.updateNetworkSettings..r)rr r)rrr)rrrrrrrr)rrrXs   z)ActionBatchNetworks.updateNetworkSettingscCs*ddgdd}d|d}|dtd}|S) z **Split a combined network into individual networks for each type of device** https://developer.cisco.com/meraki/api-v1/#!split-network - networkId (string): (required) r r splitNetwork)r r z /networks/z/splitr")rr r)r)rrrrrrrrrYs  z ActionBatchNetworks.splitNetworkcCs*ddgdd}d|d}|dtd}|S) z **Unbind a network from a template.** https://developer.cisco.com/meraki/api-v1/#!unbind-network - networkId (string): (required) r r unbindNetwork)r r z /networks/z/unbindr")rr r)r)rrrrrrrrrZs  z!ActionBatchNetworks.unbindNetwork)__name__ __module__ __qualname__rstrr rr!listr%r+r-r/r4r8r:r>rErFrKrNrOintrSrUrVrXrYrZ __classcell__rr)rrrs. # '!&&-.(#!"!rN)objectrrrrr