Skip to content

Commit aa8a588

Browse files
Automatically regenerated library. (#249)
Bumps API version to 1.45.0. Co-authored-by: GitHub Action <[email protected]>
1 parent 243922d commit aa8a588

22 files changed

+775
-146
lines changed

meraki/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
)
4444
from meraki.rest_session import *
4545

46-
__version__ = '1.43.0'
46+
__version__ = '1.45.0'
4747

4848

4949
class DashboardAPI(object):

meraki/aio/api/appliance.py

+46-13
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,30 @@ def getDeviceApplianceDhcpSubnets(self, serial: str):
2727

2828

2929

30-
def getDeviceAppliancePerformance(self, serial: str):
30+
def getDeviceAppliancePerformance(self, serial: str, **kwargs):
3131
"""
3232
**Return the performance score for a single MX**
3333
https://developer.cisco.com/meraki/api-v1/#!get-device-appliance-performance
3434
3535
- serial (string): Serial
36+
- t0 (string): The beginning of the timespan for the data.
37+
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0.
38+
- 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 greater than or equal to 30 minutes and be less than or equal to 14 days. The default is 30 minutes.
3639
"""
3740

41+
kwargs.update(locals())
42+
3843
metadata = {
3944
'tags': ['appliance', 'monitor', 'performance'],
4045
'operation': 'getDeviceAppliancePerformance'
4146
}
4247
serial = urllib.parse.quote(str(serial), safe='')
4348
resource = f'/devices/{serial}/appliance/performance'
4449

45-
return self._session.get(metadata, resource)
50+
query_params = ['t0', 't1', 'timespan', ]
51+
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
52+
53+
return self._session.get(metadata, resource, params)
4654

4755

4856

@@ -1143,6 +1151,31 @@ def getNetworkApplianceRfProfile(self, networkId: str, rfProfileId: str):
11431151

11441152

11451153

1154+
def updateNetworkApplianceSdwanInternetPolicies(self, networkId: str, **kwargs):
1155+
"""
1156+
**Update SDWAN internet traffic preferences for an MX network**
1157+
https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-sdwan-internet-policies
1158+
1159+
- networkId (string): Network ID
1160+
- wanTrafficUplinkPreferences (array): policies with respective traffic filters for an MX network
1161+
"""
1162+
1163+
kwargs.update(locals())
1164+
1165+
metadata = {
1166+
'tags': ['appliance', 'configure', 'sdwan', 'internetPolicies'],
1167+
'operation': 'updateNetworkApplianceSdwanInternetPolicies'
1168+
}
1169+
networkId = urllib.parse.quote(str(networkId), safe='')
1170+
resource = f'/networks/{networkId}/appliance/sdwan/internetPolicies'
1171+
1172+
body_params = ['wanTrafficUplinkPreferences', ]
1173+
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
1174+
1175+
return self._session.put(metadata, resource, payload)
1176+
1177+
1178+
11461179
def getNetworkApplianceSecurityEvents(self, networkId: str, total_pages=1, direction='next', **kwargs):
11471180
"""
11481181
**List the security events for a network**
@@ -1495,10 +1528,10 @@ def createNetworkApplianceStaticRoute(self, networkId: str, name: str, subnet: s
14951528
https://developer.cisco.com/meraki/api-v1/#!create-network-appliance-static-route
14961529
14971530
- networkId (string): Network ID
1498-
- name (string): The name of the new static route
1499-
- subnet (string): The subnet of the static route
1500-
- gatewayIp (string): The gateway IP (next hop) of the static route
1501-
- gatewayVlanId (string): The gateway IP (next hop) VLAN ID of the static route
1531+
- name (string): Name of the route
1532+
- subnet (string): Subnet of the route
1533+
- gatewayIp (string): Gateway IP address (next hop)
1534+
- gatewayVlanId (string): Gateway VLAN ID
15021535
"""
15031536

15041537
kwargs.update(locals())
@@ -1545,13 +1578,13 @@ def updateNetworkApplianceStaticRoute(self, networkId: str, staticRouteId: str,
15451578
15461579
- networkId (string): Network ID
15471580
- staticRouteId (string): Static route ID
1548-
- name (string): The name of the static route
1549-
- subnet (string): The subnet of the static route
1550-
- gatewayIp (string): The gateway IP (next hop) of the static route
1551-
- gatewayVlanId (string): The gateway IP (next hop) VLAN ID of the static route
1552-
- enabled (boolean): The enabled state of the static route
1553-
- fixedIpAssignments (object): The DHCP fixed IP assignments on the static route. 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.
1554-
- reservedIpRanges (array): The DHCP reserved IP ranges on the static route
1581+
- name (string): Name of the route
1582+
- subnet (string): Subnet of the route
1583+
- gatewayIp (string): Gateway IP address (next hop)
1584+
- gatewayVlanId (string): Gateway VLAN ID
1585+
- enabled (boolean): Whether the route should be enabled or not
1586+
- fixedIpAssignments (object): Fixed DHCP IP assignments on the route
1587+
- reservedIpRanges (array): DHCP reserved IP ranges
15551588
"""
15561589

15571590
kwargs.update(locals())

meraki/aio/api/camera.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def __init__(self, session):
1010

1111
def getDeviceCameraAnalyticsLive(self, serial: str):
1212
"""
13-
**Returns live state from camera of analytics zones**
13+
**Returns live state from camera analytics zones**
1414
https://developer.cisco.com/meraki/api-v1/#!get-device-camera-analytics-live
1515
1616
- serial (string): Serial

meraki/aio/api/licensing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def validateAdministeredLicensingSubscriptionSubscriptionsClaimKey(self, claimKe
126126

127127

128128

129-
def getAdministeredLicensingSubscriptionSubscriptionsComplianceStatuses(self, **kwargs):
129+
def getAdministeredLicensingSubscriptionSubscriptionsComplianceStatuses(self, organizationIds: list, **kwargs):
130130
"""
131131
**Get compliance status for requested subscriptions**
132132
https://developer.cisco.com/meraki/api-v1/#!get-administered-licensing-subscription-subscriptions-compliance-statuses

meraki/aio/api/networks.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ def updateNetworkClientPolicy(self, networkId: str, clientId: str, devicePolicy:
503503
- networkId (string): Network ID
504504
- clientId (string): Client ID
505505
- devicePolicy (string): The policy to assign. Can be 'Whitelisted', 'Blocked', 'Normal' or 'Group policy'. Required.
506-
- groupPolicyId (string): [optional] If 'devicePolicy' is set to 'Group policy' this param is used to specify the group policy ID.
506+
- groupPolicyId (string): [Optional] If 'devicePolicy' is set to 'Group policy' this param is used to specify the group policy ID.
507507
"""
508508

509509
kwargs.update(locals())
@@ -644,7 +644,7 @@ def getNetworkDevices(self, networkId: str):
644644

645645
def claimNetworkDevices(self, networkId: str, serials: list):
646646
"""
647-
**Claim devices into a network. (Note: for recently claimed devices, it may take a few minutes for API requsts against that device to succeed)**
647+
**Claim devices into a network. (Note: for recently claimed devices, it may take a few minutes for API requests against that device to succeed)**
648648
https://developer.cisco.com/meraki/api-v1/#!claim-network-devices
649649
650650
- networkId (string): Network ID
@@ -1392,15 +1392,18 @@ def updateNetworkGroupPolicy(self, networkId: str, groupPolicyId: str, **kwargs)
13921392

13931393

13941394

1395-
def deleteNetworkGroupPolicy(self, networkId: str, groupPolicyId: str):
1395+
def deleteNetworkGroupPolicy(self, networkId: str, groupPolicyId: str, **kwargs):
13961396
"""
13971397
**Delete a group policy**
13981398
https://developer.cisco.com/meraki/api-v1/#!delete-network-group-policy
13991399
14001400
- networkId (string): Network ID
14011401
- groupPolicyId (string): Group policy ID
1402+
- force (boolean): If true, the system deletes the GP even if there are active clients using the GP. After deletion, active clients that were assigned to that Group Policy will be left without any policy applied. Default is false.
14021403
"""
14031404

1405+
kwargs.update(locals())
1406+
14041407
metadata = {
14051408
'tags': ['networks', 'configure', 'groupPolicies'],
14061409
'operation': 'deleteNetworkGroupPolicy'

meraki/aio/api/organizations.py

+70-24
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ def deleteOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId
12061206

12071207
def claimIntoOrganization(self, organizationId: str, **kwargs):
12081208
"""
1209-
**Claim a list of devices, licenses, and/or orders into an organization**
1209+
**Claim a list of devices, licenses, and/or orders into an organization inventory**
12101210
https://developer.cisco.com/meraki/api-v1/#!claim-into-organization
12111211
12121212
- organizationId (string): Organization ID
@@ -1260,7 +1260,7 @@ def getOrganizationClientsBandwidthUsageHistory(self, organizationId: str, **kwa
12601260

12611261
def getOrganizationClientsOverview(self, organizationId: str, **kwargs):
12621262
"""
1263-
**Return summary information around client data usage (in mb) across the given organization.**
1263+
**Return summary information around client data usage (in kb) across the given organization.**
12641264
https://developer.cisco.com/meraki/api-v1/#!get-organization-clients-overview
12651265
12661266
- organizationId (string): Organization ID
@@ -1308,7 +1308,7 @@ def getOrganizationClientsSearch(self, organizationId: str, mac: str, total_page
13081308
organizationId = urllib.parse.quote(str(organizationId), safe='')
13091309
resource = f'/organizations/{organizationId}/clients/search'
13101310

1311-
query_params = ['mac', 'perPage', 'startingAfter', 'endingBefore', ]
1311+
query_params = ['perPage', 'startingAfter', 'endingBefore', 'mac', ]
13121312
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
13131313

13141314
return self._session.get_pages(metadata, resource, params, total_pages, direction)
@@ -1386,6 +1386,27 @@ def createOrganizationConfigTemplate(self, organizationId: str, name: str, **kwa
13861386

13871387

13881388

1389+
def getOrganizationConfigTemplate(self, organizationId: str, configTemplateId: str):
1390+
"""
1391+
**Return a single configuration template**
1392+
https://developer.cisco.com/meraki/api-v1/#!get-organization-config-template
1393+
1394+
- organizationId (string): Organization ID
1395+
- configTemplateId (string): Config template ID
1396+
"""
1397+
1398+
metadata = {
1399+
'tags': ['organizations', 'configure', 'configTemplates'],
1400+
'operation': 'getOrganizationConfigTemplate'
1401+
}
1402+
organizationId = urllib.parse.quote(str(organizationId), safe='')
1403+
configTemplateId = urllib.parse.quote(str(configTemplateId), safe='')
1404+
resource = f'/organizations/{organizationId}/configTemplates/{configTemplateId}'
1405+
1406+
return self._session.get(metadata, resource)
1407+
1408+
1409+
13891410
def updateOrganizationConfigTemplate(self, organizationId: str, configTemplateId: str, **kwargs):
13901411
"""
13911412
**Update a configuration template**
@@ -1435,27 +1456,6 @@ def deleteOrganizationConfigTemplate(self, organizationId: str, configTemplateId
14351456

14361457

14371458

1438-
def getOrganizationConfigTemplate(self, organizationId: str, configTemplateId: str):
1439-
"""
1440-
**Return a single configuration template**
1441-
https://developer.cisco.com/meraki/api-v1/#!get-organization-config-template
1442-
1443-
- organizationId (string): Organization ID
1444-
- configTemplateId (string): Config template ID
1445-
"""
1446-
1447-
metadata = {
1448-
'tags': ['organizations', 'configure', 'configTemplates'],
1449-
'operation': 'getOrganizationConfigTemplate'
1450-
}
1451-
organizationId = urllib.parse.quote(str(organizationId), safe='')
1452-
configTemplateId = urllib.parse.quote(str(configTemplateId), safe='')
1453-
resource = f'/organizations/{organizationId}/configTemplates/{configTemplateId}'
1454-
1455-
return self._session.get(metadata, resource)
1456-
1457-
1458-
14591459
def getOrganizationConfigurationChanges(self, organizationId: str, total_pages=1, direction='prev', **kwargs):
14601460
"""
14611461
**View the Change Log for your organization**
@@ -2165,6 +2165,52 @@ def getOrganizationInventoryDevices(self, organizationId: str, total_pages=1, di
21652165

21662166

21672167

2168+
def createOrganizationInventoryDevicesSwapsBulk(self, organizationId: str, swaps: list):
2169+
"""
2170+
**Swap the devices identified by devices.old with a devices.new, then perform the :afterAction on the devices.old.**
2171+
https://developer.cisco.com/meraki/api-v1/#!create-organization-inventory-devices-swaps-bulk
2172+
2173+
- organizationId (string): Organization ID
2174+
- swaps (array): List of replacments to perform
2175+
"""
2176+
2177+
kwargs = locals()
2178+
2179+
metadata = {
2180+
'tags': ['organizations', 'configure', 'inventory', 'devices', 'swaps', 'bulk'],
2181+
'operation': 'createOrganizationInventoryDevicesSwapsBulk'
2182+
}
2183+
organizationId = urllib.parse.quote(str(organizationId), safe='')
2184+
resource = f'/organizations/{organizationId}/inventory/devices/swaps/bulk'
2185+
2186+
body_params = ['swaps', ]
2187+
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
2188+
2189+
return self._session.post(metadata, resource, payload)
2190+
2191+
2192+
2193+
def getOrganizationInventoryDevicesSwapsBulk(self, organizationId: str, id: str):
2194+
"""
2195+
**List of device swaps for a given request ID ({id}).**
2196+
https://developer.cisco.com/meraki/api-v1/#!get-organization-inventory-devices-swaps-bulk
2197+
2198+
- organizationId (string): Organization ID
2199+
- id (string): ID
2200+
"""
2201+
2202+
metadata = {
2203+
'tags': ['organizations', 'configure', 'inventory', 'devices', 'swaps', 'bulk'],
2204+
'operation': 'getOrganizationInventoryDevicesSwapsBulk'
2205+
}
2206+
organizationId = urllib.parse.quote(str(organizationId), safe='')
2207+
id = urllib.parse.quote(str(id), safe='')
2208+
resource = f'/organizations/{organizationId}/inventory/devices/swaps/bulk/{id}'
2209+
2210+
return self._session.get(metadata, resource)
2211+
2212+
2213+
21682214
def getOrganizationInventoryDevice(self, organizationId: str, serial: str):
21692215
"""
21702216
**Return a single device from the inventory of an organization**

meraki/aio/api/sensor.py

+90
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,96 @@ def __init__(self, session):
88

99

1010

11+
def getDeviceSensorCommands(self, serial: str, total_pages=1, direction='next', **kwargs):
12+
"""
13+
**Returns a historical log of all commands**
14+
https://developer.cisco.com/meraki/api-v1/#!get-device-sensor-commands
15+
16+
- serial (string): Serial
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+
- operations (array): Optional parameter to filter commands by operation. Allowed values are disableDownstreamPower, enableDownstreamPower, cycleDownstreamPower, and refreshData.
20+
- perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 10.
21+
- 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.
22+
- 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.
23+
- sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'descending'.
24+
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 30 days from today.
25+
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 30 days after t0.
26+
- 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 30 days. The default is 30 days.
27+
"""
28+
29+
kwargs.update(locals())
30+
31+
if 'sortOrder' in kwargs:
32+
options = ['ascending', 'descending']
33+
assert kwargs['sortOrder'] in options, f'''"sortOrder" cannot be "{kwargs['sortOrder']}", & must be set to one of: {options}'''
34+
35+
metadata = {
36+
'tags': ['sensor', 'configure', 'commands'],
37+
'operation': 'getDeviceSensorCommands'
38+
}
39+
serial = urllib.parse.quote(str(serial), safe='')
40+
resource = f'/devices/{serial}/sensor/commands'
41+
42+
query_params = ['operations', 'perPage', 'startingAfter', 'endingBefore', 'sortOrder', 't0', 't1', 'timespan', ]
43+
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
44+
45+
array_params = ['operations', ]
46+
for k, v in kwargs.items():
47+
if k.strip() in array_params:
48+
params[f'{k.strip()}[]'] = kwargs[f'{k}']
49+
params.pop(k.strip())
50+
51+
return self._session.get_pages(metadata, resource, params, total_pages, direction)
52+
53+
54+
55+
def createDeviceSensorCommand(self, serial: str, operation: str):
56+
"""
57+
**Sends a command to a sensor**
58+
https://developer.cisco.com/meraki/api-v1/#!create-device-sensor-command
59+
60+
- serial (string): Serial
61+
- operation (string): Operation to run on the sensor. 'enableDownstreamPower', 'disableDownstreamPower', and 'cycleDownstreamPower' turn power on/off to the device that is connected downstream of an MT40 power monitor. 'refreshData' causes an MT15 or MT40 device to upload its latest readings so that they are immediately available in the Dashboard API.
62+
"""
63+
64+
kwargs = locals()
65+
66+
metadata = {
67+
'tags': ['sensor', 'configure', 'commands'],
68+
'operation': 'createDeviceSensorCommand'
69+
}
70+
serial = urllib.parse.quote(str(serial), safe='')
71+
resource = f'/devices/{serial}/sensor/commands'
72+
73+
body_params = ['operation', ]
74+
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
75+
76+
return self._session.post(metadata, resource, payload)
77+
78+
79+
80+
def getDeviceSensorCommand(self, serial: str, commandId: str):
81+
"""
82+
**Returns information about the command's execution, including the status**
83+
https://developer.cisco.com/meraki/api-v1/#!get-device-sensor-command
84+
85+
- serial (string): Serial
86+
- commandId (string): Command ID
87+
"""
88+
89+
metadata = {
90+
'tags': ['sensor', 'configure', 'commands'],
91+
'operation': 'getDeviceSensorCommand'
92+
}
93+
serial = urllib.parse.quote(str(serial), safe='')
94+
commandId = urllib.parse.quote(str(commandId), safe='')
95+
resource = f'/devices/{serial}/sensor/commands/{commandId}'
96+
97+
return self._session.get(metadata, resource)
98+
99+
100+
11101
def getDeviceSensorRelationships(self, serial: str):
12102
"""
13103
**List the sensor roles for a given sensor or camera device.**

0 commit comments

Comments
 (0)