Skip to content

Commit ff7b506

Browse files
Dashboard API release 1.30.0
1 parent 622dd21 commit ff7b506

27 files changed

Lines changed: 1094 additions & 313 deletions

meraki/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
USE_ITERATOR_FOR_GET_PAGES,
4545
)
4646

47-
__version__ = '1.27.1'
47+
__version__ = '1.30.0'
4848

4949

5050
class DashboardAPI(object):

meraki/aio/api/appliance.py

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def updateNetworkApplianceContentFiltering(self, networkId: str, **kwargs):
264264
kwargs.update(locals())
265265

266266
if 'urlCategoryListSize' in kwargs:
267-
options = ['topSites', 'fullList']
267+
options = ['fullList', 'topSites']
268268
assert kwargs['urlCategoryListSize'] in options, f'''"urlCategoryListSize" cannot be "{kwargs['urlCategoryListSize']}", & must be set to one of: {options}'''
269269

270270
metadata = {
@@ -1048,10 +1048,10 @@ def updateNetworkApplianceSecurityIntrusion(self, networkId: str, **kwargs):
10481048
kwargs.update(locals())
10491049

10501050
if 'mode' in kwargs:
1051-
options = ['prevention', 'detection', 'disabled']
1051+
options = ['detection', 'disabled', 'prevention']
10521052
assert kwargs['mode'] in options, f'''"mode" cannot be "{kwargs['mode']}", & must be set to one of: {options}'''
10531053
if 'idsRulesets' in kwargs:
1054-
options = ['connectivity', 'balanced', 'security']
1054+
options = ['balanced', 'connectivity', 'security']
10551055
assert kwargs['idsRulesets'] in options, f'''"idsRulesets" cannot be "{kwargs['idsRulesets']}", & must be set to one of: {options}'''
10561056

10571057
metadata = {
@@ -1101,7 +1101,7 @@ def updateNetworkApplianceSecurityMalware(self, networkId: str, mode: str, **kwa
11011101
kwargs.update(locals())
11021102

11031103
if 'mode' in kwargs:
1104-
options = ['enabled', 'disabled']
1104+
options = ['disabled', 'enabled']
11051105
assert kwargs['mode'] in options, f'''"mode" cannot be "{kwargs['mode']}", & must be set to one of: {options}'''
11061106

11071107
metadata = {
@@ -1154,7 +1154,7 @@ def updateNetworkApplianceSettings(self, networkId: str, **kwargs):
11541154
options = ['IP address', 'MAC address', 'Unique client identifier']
11551155
assert kwargs['clientTrackingMethod'] in options, f'''"clientTrackingMethod" cannot be "{kwargs['clientTrackingMethod']}", & must be set to one of: {options}'''
11561156
if 'deploymentMode' in kwargs:
1157-
options = ['routed', 'passthrough']
1157+
options = ['passthrough', 'routed']
11581158
assert kwargs['deploymentMode'] in options, f'''"deploymentMode" cannot be "{kwargs['deploymentMode']}", & must be set to one of: {options}'''
11591159

11601160
metadata = {
@@ -1199,6 +1199,7 @@ def updateNetworkApplianceSingleLan(self, networkId: str, **kwargs):
11991199
- subnet (string): The subnet of the single LAN configuration
12001200
- applianceIp (string): The appliance IP address of the single LAN
12011201
- ipv6 (object): IPv6 configuration on the VLAN
1202+
- mandatoryDhcp (object): Mandatory DHCP will enforce that clients connecting to this LAN must use the IP address assigned by the DHCP server. Clients who use a static IP address won't be able to associate. Only available on firmware versions 17.0 and above
12021203
"""
12031204

12041205
kwargs.update(locals())
@@ -1210,7 +1211,7 @@ def updateNetworkApplianceSingleLan(self, networkId: str, **kwargs):
12101211
networkId = urllib.parse.quote(str(networkId), safe='')
12111212
resource = f'/networks/{networkId}/appliance/singleLan'
12121213

1213-
body_params = ['subnet', 'applianceIp', 'ipv6', ]
1214+
body_params = ['subnet', 'applianceIp', 'ipv6', 'mandatoryDhcp', ]
12141215
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
12151216

12161217
return self._session.put(metadata, resource, payload)
@@ -1273,12 +1274,13 @@ def updateNetworkApplianceSsid(self, networkId: str, number: str, **kwargs):
12731274
- encryptionMode (string): The psk encryption mode for the SSID ('wep' or 'wpa'). This param is only valid if the authMode is 'psk'.
12741275
- wpaEncryptionMode (string): The types of WPA encryption. ('WPA1 and WPA2', 'WPA2 only', 'WPA3 Transition Mode' or 'WPA3 only'). This param is only valid if (1) the authMode is 'psk' & the encryptionMode is 'wpa' OR (2) the authMode is '8021x-meraki' OR (3) the authMode is '8021x-radius'
12751276
- visible (boolean): Boolean indicating whether the MX should advertise or hide this SSID.
1277+
- dhcpEnforcedDeauthentication (object): DHCP Enforced Deauthentication enables the disassociation of wireless clients in addition to Mandatory DHCP. This param is only valid on firmware versions >= MX 17.0 where the associated LAN has Mandatory DHCP Enabled
12761278
"""
12771279

12781280
kwargs.update(locals())
12791281

12801282
if 'authMode' in kwargs:
1281-
options = ['open', 'psk', '8021x-meraki', '8021x-radius']
1283+
options = ['8021x-meraki', '8021x-radius', 'open', 'psk']
12821284
assert kwargs['authMode'] in options, f'''"authMode" cannot be "{kwargs['authMode']}", & must be set to one of: {options}'''
12831285
if 'encryptionMode' in kwargs:
12841286
options = ['wep', 'wpa']
@@ -1295,7 +1297,7 @@ def updateNetworkApplianceSsid(self, networkId: str, number: str, **kwargs):
12951297
number = urllib.parse.quote(str(number), safe='')
12961298
resource = f'/networks/{networkId}/appliance/ssids/{number}'
12971299

1298-
body_params = ['name', 'enabled', 'defaultVlanId', 'authMode', 'psk', 'radiusServers', 'encryptionMode', 'wpaEncryptionMode', 'visible', ]
1300+
body_params = ['name', 'enabled', 'defaultVlanId', 'authMode', 'psk', 'radiusServers', 'encryptionMode', 'wpaEncryptionMode', 'visible', 'dhcpEnforcedDeauthentication', ]
12991301
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
13001302

13011303
return self._session.put(metadata, resource, payload)
@@ -1707,6 +1709,7 @@ def updateNetworkApplianceTrafficShapingUplinkSelection(self, networkId: str, **
17071709
- activeActiveAutoVpnEnabled (boolean): Toggle for enabling or disabling active-active AutoVPN
17081710
- defaultUplink (string): The default uplink. Must be one of: 'wan1' or 'wan2'
17091711
- loadBalancingEnabled (boolean): Toggle for enabling or disabling load balancing
1712+
- failoverAndFailback (object): WAN failover and failback behavior
17101713
- wanTrafficUplinkPreferences (array): Array of uplink preference rules for WAN traffic
17111714
- vpnTrafficUplinkPreferences (array): Array of uplink preference rules for VPN traffic
17121715
"""
@@ -1724,7 +1727,7 @@ def updateNetworkApplianceTrafficShapingUplinkSelection(self, networkId: str, **
17241727
networkId = urllib.parse.quote(str(networkId), safe='')
17251728
resource = f'/networks/{networkId}/appliance/trafficShaping/uplinkSelection'
17261729

1727-
body_params = ['activeActiveAutoVpnEnabled', 'defaultUplink', 'loadBalancingEnabled', 'wanTrafficUplinkPreferences', 'vpnTrafficUplinkPreferences', ]
1730+
body_params = ['activeActiveAutoVpnEnabled', 'defaultUplink', 'loadBalancingEnabled', 'failoverAndFailback', 'wanTrafficUplinkPreferences', 'vpnTrafficUplinkPreferences', ]
17281731
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
17291732

17301733
return self._session.put(metadata, resource, payload)
@@ -1793,6 +1796,7 @@ def createNetworkApplianceVlan(self, networkId: str, id: str, name: str, **kwarg
17931796
- cidr (string): CIDR of the pool of subnets. Applicable only for template network. Each network bound to the template will automatically pick a subnet from this pool to build its own VLAN.
17941797
- mask (integer): Mask used for the subnet of all bound to the template networks. Applicable only for template network.
17951798
- ipv6 (object): IPv6 configuration on the VLAN
1799+
- mandatoryDhcp (object): Mandatory DHCP will enforce that clients connecting to this VLAN must use the IP address assigned by the DHCP server. Clients who use a static IP address won't be able to associate. Only available on firmware versions 17.0 and above
17961800
"""
17971801

17981802
kwargs.update(locals())
@@ -1808,7 +1812,7 @@ def createNetworkApplianceVlan(self, networkId: str, id: str, name: str, **kwarg
18081812
networkId = urllib.parse.quote(str(networkId), safe='')
18091813
resource = f'/networks/{networkId}/appliance/vlans'
18101814

1811-
body_params = ['id', 'name', 'subnet', 'applianceIp', 'groupPolicyId', 'templateVlanType', 'cidr', 'mask', 'ipv6', ]
1815+
body_params = ['id', 'name', 'subnet', 'applianceIp', 'groupPolicyId', 'templateVlanType', 'cidr', 'mask', 'ipv6', 'mandatoryDhcp', ]
18121816
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
18131817

18141818
return self._session.post(metadata, resource, payload)
@@ -1906,15 +1910,16 @@ def updateNetworkApplianceVlan(self, networkId: str, vlanId: str, **kwargs):
19061910
- cidr (string): CIDR of the pool of subnets. Applicable only for template network. Each network bound to the template will automatically pick a subnet from this pool to build its own VLAN.
19071911
- mask (integer): Mask used for the subnet of all bound to the template networks. Applicable only for template network.
19081912
- ipv6 (object): IPv6 configuration on the VLAN
1913+
- mandatoryDhcp (object): Mandatory DHCP will enforce that clients connecting to this VLAN must use the IP address assigned by the DHCP server. Clients who use a static IP address won't be able to associate. Only available on firmware versions 17.0 and above
19091914
"""
19101915

19111916
kwargs.update(locals())
19121917

19131918
if 'dhcpHandling' in kwargs:
1914-
options = ['Run a DHCP server', 'Relay DHCP to another server', 'Do not respond to DHCP requests']
1919+
options = ['Do not respond to DHCP requests', 'Relay DHCP to another server', 'Run a DHCP server']
19151920
assert kwargs['dhcpHandling'] in options, f'''"dhcpHandling" cannot be "{kwargs['dhcpHandling']}", & must be set to one of: {options}'''
19161921
if 'dhcpLeaseTime' in kwargs:
1917-
options = ['30 minutes', '1 hour', '4 hours', '12 hours', '1 day', '1 week']
1922+
options = ['1 day', '1 hour', '1 week', '12 hours', '30 minutes', '4 hours']
19181923
assert kwargs['dhcpLeaseTime'] in options, f'''"dhcpLeaseTime" cannot be "{kwargs['dhcpLeaseTime']}", & must be set to one of: {options}'''
19191924
if 'templateVlanType' in kwargs:
19201925
options = ['same', 'unique']
@@ -1928,7 +1933,7 @@ def updateNetworkApplianceVlan(self, networkId: str, vlanId: str, **kwargs):
19281933
vlanId = urllib.parse.quote(str(vlanId), safe='')
19291934
resource = f'/networks/{networkId}/appliance/vlans/{vlanId}'
19301935

1931-
body_params = ['name', 'subnet', 'applianceIp', 'groupPolicyId', 'vpnNatSubnet', 'dhcpHandling', 'dhcpRelayServerIps', 'dhcpLeaseTime', 'dhcpBootOptionsEnabled', 'dhcpBootNextServer', 'dhcpBootFilename', 'fixedIpAssignments', 'reservedIpRanges', 'dnsNameservers', 'dhcpOptions', 'templateVlanType', 'cidr', 'mask', 'ipv6', ]
1936+
body_params = ['name', 'subnet', 'applianceIp', 'groupPolicyId', 'vpnNatSubnet', 'dhcpHandling', 'dhcpRelayServerIps', 'dhcpLeaseTime', 'dhcpBootOptionsEnabled', 'dhcpBootNextServer', 'dhcpBootFilename', 'fixedIpAssignments', 'reservedIpRanges', 'dnsNameservers', 'dhcpOptions', 'templateVlanType', 'cidr', 'mask', 'ipv6', 'mandatoryDhcp', ]
19321937
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
19331938

19341939
return self._session.put(metadata, resource, payload)
@@ -2036,7 +2041,7 @@ def updateNetworkApplianceVpnSiteToSiteVpn(self, networkId: str, mode: str, **kw
20362041
kwargs.update(locals())
20372042

20382043
if 'mode' in kwargs:
2039-
options = ['none', 'spoke', 'hub']
2044+
options = ['hub', 'none', 'spoke']
20402045
assert kwargs['mode'] in options, f'''"mode" cannot be "{kwargs['mode']}", & must be set to one of: {options}'''
20412046

20422047
metadata = {

meraki/aio/api/camera.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,10 @@ def updateDeviceCameraQualityAndRetention(self, serial: str, **kwargs):
251251
kwargs.update(locals())
252252

253253
if 'quality' in kwargs:
254-
options = ['Standard', 'High', 'Enhanced']
254+
options = ['Enhanced', 'High', 'Standard']
255255
assert kwargs['quality'] in options, f'''"quality" cannot be "{kwargs['quality']}", & must be set to one of: {options}'''
256256
if 'resolution' in kwargs:
257-
options = ['1280x720', '1920x1080', '1080x1080', '2058x2058', '2112x2112', '2880x2880', '2688x1512', '3840x2160']
257+
options = ['1080x1080', '1280x720', '1920x1080', '2058x2058', '2112x2112', '2688x1512', '2880x2880', '3840x2160']
258258
assert kwargs['resolution'] in options, f'''"resolution" cannot be "{kwargs['resolution']}", & must be set to one of: {options}'''
259259
if 'motionDetectorVersion' in kwargs:
260260
options = [1, 2]

meraki/aio/api/devices.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def getDeviceLossAndLatencyHistory(self, serial: str, ip: str, **kwargs):
287287
kwargs.update(locals())
288288

289289
if 'uplink' in kwargs:
290-
options = ['wan1', 'wan2', 'cellular']
290+
options = ['cellular', 'wan1', 'wan2']
291291
assert kwargs['uplink'] in options, f'''"uplink" cannot be "{kwargs['uplink']}", & must be set to one of: {options}'''
292292

293293
metadata = {

meraki/aio/api/licensing.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import urllib
2+
3+
4+
class AsyncLicensing:
5+
def __init__(self, session):
6+
super().__init__()
7+
self._session = session
8+
9+
10+
11+
def getOrganizationLicensingCotermLicenses(self, organizationId: str, total_pages=1, direction='next', **kwargs):
12+
"""
13+
**List the licenses in a coterm organization**
14+
https://developer.cisco.com/meraki/api-v1/#!get-organization-licensing-coterm-licenses
15+
16+
- organizationId (string): (required)
17+
- total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages
18+
- direction (string): direction to paginate, either "next" (default) or "prev" page
19+
- perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000.
20+
- 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.
21+
- 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.
22+
- invalidated (boolean): Filter for licenses that are invalidated
23+
- expired (boolean): Filter for licenses that are expired
24+
"""
25+
26+
kwargs.update(locals())
27+
28+
metadata = {
29+
'tags': ['licensing', 'configure', 'coterm', 'licenses'],
30+
'operation': 'getOrganizationLicensingCotermLicenses'
31+
}
32+
organizationId = urllib.parse.quote(str(organizationId), safe='')
33+
resource = f'/organizations/{organizationId}/licensing/coterm/licenses'
34+
35+
query_params = ['perPage', 'startingAfter', 'endingBefore', 'invalidated', 'expired', ]
36+
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
37+
38+
return self._session.get_pages(metadata, resource, params, total_pages, direction)
39+
40+
41+
42+
def moveOrganizationLicensingCotermLicenses(self, organizationId: str, destination: dict, licenses: list):
43+
"""
44+
**Moves a license to a different organization (coterm only)**
45+
https://developer.cisco.com/meraki/api-v1/#!move-organization-licensing-coterm-licenses
46+
47+
- organizationId (string): (required)
48+
- destination (object): Destination data for the license move
49+
- licenses (array): The list of licenses to move
50+
"""
51+
52+
kwargs = locals()
53+
54+
metadata = {
55+
'tags': ['licensing', 'configure', 'coterm', 'licenses'],
56+
'operation': 'moveOrganizationLicensingCotermLicenses'
57+
}
58+
organizationId = urllib.parse.quote(str(organizationId), safe='')
59+
resource = f'/organizations/{organizationId}/licensing/coterm/licenses/move'
60+
61+
body_params = ['destination', 'licenses', ]
62+
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
63+
64+
return self._session.post(metadata, resource, payload)
65+

0 commit comments

Comments
 (0)