B `@sGdddeZdS)cseZdZfddZedddZeeeeedddZeed d d Zeed d d Zeed ddZ edddZ ee dddZ Z S)VLANscstt|||_dS)N)superr__init___session)selfsession) __class__n/private/var/folders/7j/8686xlfs15q3tgljmghtvg0r0000gn/T/pip-target-isidps9b/lib/python/meraki_v0/api/vlans.pyrszVLANs.__init__) networkIdcCs&dgdd}d|d}|j||S)z **List the VLANs for an MX network** https://developer.cisco.com/meraki/api/#!get-network-vlans - networkId (string) rgetNetworkVlans)tags operationz /networks/z/vlans)rget)rr metadataresourcerrr r s  zVLANs.getNetworkVlans)r idnamesubnet applianceIpc  sX|tdgdd}d|d}dddd d gfd d |D} |j||| S) a **Add a VLAN** https://developer.cisco.com/meraki/api/#!create-network-vlan - networkId (string) - id (string): The VLAN ID of the new VLAN (must be between 1 and 4094) - name (string): The name of the new VLAN - subnet (string): The subnet of the VLAN - applianceIp (string): The local IP of the appliance on the VLAN - groupPolicyId (string): The id of the desired group policy to apply to the VLAN rcreateNetworkVlan)r r z /networks/z/vlansrrrr groupPolicyIdcs&i|]\}}|kr||qSr)strip).0kv) body_paramsrr ,sz+VLANs.createNetworkVlan..)updatelocalsitemsrpost) rr rrrrkwargsrrpayloadr)rr rs  zVLANs.createNetworkVlan)r vlanIdcCs*dgdd}d|d|}|j||S)z **Return a VLAN** https://developer.cisco.com/meraki/api/#!get-network-vlan - networkId (string) - vlanId (string) rgetNetworkVlan)r r z /networks/z/vlans/)rr)rr r#rrrrr r$0s zVLANs.getNetworkVlanc s|td|krBdddg}|d|ksBtd|dd|d|kr~dd d d d d g}|d|ks~td|dd|dgdd}d|d|}ddddddddddddddd gfd!d"|D}|j|||S)#a **Update a VLAN** https://developer.cisco.com/meraki/api/#!update-network-vlan - networkId (string) - vlanId (string) - name (string): The name of the VLAN - subnet (string): The subnet of the VLAN - applianceIp (string): The local IP of the appliance on the VLAN - groupPolicyId (string): The id of the desired group policy to apply to the VLAN - vpnNatSubnet (string): The translated VPN subnet if VPN and VPN subnet translation are enabled on the VLAN - dhcpHandling (string): The appliance's handling of DHCP requests on this VLAN. One of: 'Run a DHCP server', 'Relay DHCP to another server' or 'Do not respond to DHCP requests' - dhcpRelayServerIps (array): The IPs of the DHCP servers that DHCP requests should be relayed to - dhcpLeaseTime (string): The term of DHCP leases if the appliance is running a DHCP server on this VLAN. One of: '30 minutes', '1 hour', '4 hours', '12 hours', '1 day' or '1 week' - dhcpBootOptionsEnabled (boolean): Use DHCP boot options specified in other properties - dhcpBootNextServer (string): DHCP boot option to direct boot clients to the server to load the boot file from - dhcpBootFilename (string): DHCP boot option for boot filename - fixedIpAssignments (object): The DHCP fixed IP assignments on the VLAN. This should be an object that contains mappings from MAC addresses to objects that themselves each contain "ip" and "name" string fields. See the sample request/response for more details. - reservedIpRanges (array): The DHCP reserved IP ranges on the VLAN - dnsNameservers (string): The DNS nameservers used for DHCP responses, either "upstream_dns", "google_dns", "opendns", or a newline seperated string of IP addresses or domain names - dhcpOptions (array): The list of DHCP options that will be included in DHCP responses. Each object in the list should have "code", "type", and "value" properties. Z dhcpHandlingzRun a DHCP serverzRelay DHCP to another serverzDo not respond to DHCP requestsz"dhcpHandling" cannot be "z", & must be set to one of: Z dhcpLeaseTimez 30 minutesz1 hourz4 hoursz12 hoursz1 dayz1 weekz"dhcpLeaseTime" cannot be "rupdateNetworkVlan)r r z /networks/z/vlans/rrrrZ vpnNatSubnetZdhcpRelayServerIpsZdhcpBootOptionsEnabledZdhcpBootNextServerZdhcpBootFilenameZfixedIpAssignmentsZreservedIpRangesZdnsNameserversZ dhcpOptionscs&i|]\}}|kr||qSr)r)rrr)rrr risz+VLANs.updateNetworkVlan..)rrAssertionErrorrrput)rr r#r!optionsrrr"r)rr r%As  $$"zVLANs.updateNetworkVlancCs*dgdd}d|d|}|j||S)z **Delete a VLAN from a network** https://developer.cisco.com/meraki/api/#!delete-network-vlan - networkId (string) - vlanId (string) rdeleteNetworkVlan)r r z /networks/z/vlans/)rdelete)rr r#rrrrr r)ms zVLANs.deleteNetworkVlancCs&dgdd}d|d}|j||S)z **Returns the enabled status of VLANs for the network** https://developer.cisco.com/meraki/api/#!get-network-vlans-enabled-state - networkId (string) rgetNetworkVlansEnabledState)r r z /networks/z/vlansEnabledState)rr)rr rrrrr r+~s  z!VLANs.getNetworkVlansEnabledState)r enabledcsJt}dgdd}d|d}dgfdd|D}|j|||S) a, **Enable/Disable VLANs for the given network** https://developer.cisco.com/meraki/api/#!update-network-vlans-enabled-state - networkId (string) - enabled (boolean): Boolean indicating whether to enable (true) or disable (false) VLANs for the network rupdateNetworkVlansEnabledState)r r z /networks/z/vlansEnabledStater,cs&i|]\}}|kr||qSr)r)rrr)rrr rsz8VLANs.updateNetworkVlansEnabledState..)rrrr')rr r,r!rrr"r)rr r-s  z$VLANs.updateNetworkVlansEnabledState)__name__ __module__ __qualname__rstrr rr$r%r)r+boolr- __classcell__rr)rr rs ,rN)objectrrrrr