Skip to content

Commit

Permalink
Automatically regenerated library.
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub Action committed Apr 4, 2024
1 parent 243922d commit 9c480a7
Show file tree
Hide file tree
Showing 22 changed files with 775 additions and 146 deletions.
2 changes: 1 addition & 1 deletion meraki/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
)
from meraki.rest_session import *

__version__ = '1.43.0'
__version__ = '1.45.0'


class DashboardAPI(object):
Expand Down
59 changes: 46 additions & 13 deletions meraki/aio/api/appliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,30 @@ def getDeviceApplianceDhcpSubnets(self, serial: str):



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

kwargs.update(locals())

metadata = {
'tags': ['appliance', 'monitor', 'performance'],
'operation': 'getDeviceAppliancePerformance'
}
serial = urllib.parse.quote(str(serial), safe='')
resource = f'/devices/{serial}/appliance/performance'

return self._session.get(metadata, resource)
query_params = ['t0', 't1', 'timespan', ]
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}

return self._session.get(metadata, resource, params)



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



def updateNetworkApplianceSdwanInternetPolicies(self, networkId: str, **kwargs):
"""
**Update SDWAN internet traffic preferences for an MX network**
https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-sdwan-internet-policies
- networkId (string): Network ID
- wanTrafficUplinkPreferences (array): policies with respective traffic filters for an MX network
"""

kwargs.update(locals())

metadata = {
'tags': ['appliance', 'configure', 'sdwan', 'internetPolicies'],
'operation': 'updateNetworkApplianceSdwanInternetPolicies'
}
networkId = urllib.parse.quote(str(networkId), safe='')
resource = f'/networks/{networkId}/appliance/sdwan/internetPolicies'

body_params = ['wanTrafficUplinkPreferences', ]
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}

return self._session.put(metadata, resource, payload)



def getNetworkApplianceSecurityEvents(self, networkId: str, total_pages=1, direction='next', **kwargs):
"""
**List the security events for a network**
Expand Down Expand Up @@ -1495,10 +1528,10 @@ def createNetworkApplianceStaticRoute(self, networkId: str, name: str, subnet: s
https://developer.cisco.com/meraki/api-v1/#!create-network-appliance-static-route
- networkId (string): Network ID
- name (string): The name of the new static route
- subnet (string): The subnet of the static route
- gatewayIp (string): The gateway IP (next hop) of the static route
- gatewayVlanId (string): The gateway IP (next hop) VLAN ID of the static route
- name (string): Name of the route
- subnet (string): Subnet of the route
- gatewayIp (string): Gateway IP address (next hop)
- gatewayVlanId (string): Gateway VLAN ID
"""

kwargs.update(locals())
Expand Down Expand Up @@ -1545,13 +1578,13 @@ def updateNetworkApplianceStaticRoute(self, networkId: str, staticRouteId: str,
- networkId (string): Network ID
- staticRouteId (string): Static route ID
- name (string): The name of the static route
- subnet (string): The subnet of the static route
- gatewayIp (string): The gateway IP (next hop) of the static route
- gatewayVlanId (string): The gateway IP (next hop) VLAN ID of the static route
- enabled (boolean): The enabled state of the static route
- 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.
- reservedIpRanges (array): The DHCP reserved IP ranges on the static route
- name (string): Name of the route
- subnet (string): Subnet of the route
- gatewayIp (string): Gateway IP address (next hop)
- gatewayVlanId (string): Gateway VLAN ID
- enabled (boolean): Whether the route should be enabled or not
- fixedIpAssignments (object): Fixed DHCP IP assignments on the route
- reservedIpRanges (array): DHCP reserved IP ranges
"""

kwargs.update(locals())
Expand Down
2 changes: 1 addition & 1 deletion meraki/aio/api/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def __init__(self, session):

def getDeviceCameraAnalyticsLive(self, serial: str):
"""
**Returns live state from camera of analytics zones**
**Returns live state from camera analytics zones**
https://developer.cisco.com/meraki/api-v1/#!get-device-camera-analytics-live
- serial (string): Serial
Expand Down
2 changes: 1 addition & 1 deletion meraki/aio/api/licensing.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def validateAdministeredLicensingSubscriptionSubscriptionsClaimKey(self, claimKe



def getAdministeredLicensingSubscriptionSubscriptionsComplianceStatuses(self, **kwargs):
def getAdministeredLicensingSubscriptionSubscriptionsComplianceStatuses(self, organizationIds: list, **kwargs):
"""
**Get compliance status for requested subscriptions**
https://developer.cisco.com/meraki/api-v1/#!get-administered-licensing-subscription-subscriptions-compliance-statuses
Expand Down
9 changes: 6 additions & 3 deletions meraki/aio/api/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ def updateNetworkClientPolicy(self, networkId: str, clientId: str, devicePolicy:
- networkId (string): Network ID
- clientId (string): Client ID
- devicePolicy (string): The policy to assign. Can be 'Whitelisted', 'Blocked', 'Normal' or 'Group policy'. Required.
- groupPolicyId (string): [optional] If 'devicePolicy' is set to 'Group policy' this param is used to specify the group policy ID.
- groupPolicyId (string): [Optional] If 'devicePolicy' is set to 'Group policy' this param is used to specify the group policy ID.
"""

kwargs.update(locals())
Expand Down Expand Up @@ -644,7 +644,7 @@ def getNetworkDevices(self, networkId: str):

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



def deleteNetworkGroupPolicy(self, networkId: str, groupPolicyId: str):
def deleteNetworkGroupPolicy(self, networkId: str, groupPolicyId: str, **kwargs):
"""
**Delete a group policy**
https://developer.cisco.com/meraki/api-v1/#!delete-network-group-policy
- networkId (string): Network ID
- groupPolicyId (string): Group policy ID
- 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.
"""

kwargs.update(locals())

metadata = {
'tags': ['networks', 'configure', 'groupPolicies'],
'operation': 'deleteNetworkGroupPolicy'
Expand Down
94 changes: 70 additions & 24 deletions meraki/aio/api/organizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@ def deleteOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId

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

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

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

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



def getOrganizationConfigTemplate(self, organizationId: str, configTemplateId: str):
"""
**Return a single configuration template**
https://developer.cisco.com/meraki/api-v1/#!get-organization-config-template
- organizationId (string): Organization ID
- configTemplateId (string): Config template ID
"""

metadata = {
'tags': ['organizations', 'configure', 'configTemplates'],
'operation': 'getOrganizationConfigTemplate'
}
organizationId = urllib.parse.quote(str(organizationId), safe='')
configTemplateId = urllib.parse.quote(str(configTemplateId), safe='')
resource = f'/organizations/{organizationId}/configTemplates/{configTemplateId}'

return self._session.get(metadata, resource)



def updateOrganizationConfigTemplate(self, organizationId: str, configTemplateId: str, **kwargs):
"""
**Update a configuration template**
Expand Down Expand Up @@ -1435,27 +1456,6 @@ def deleteOrganizationConfigTemplate(self, organizationId: str, configTemplateId



def getOrganizationConfigTemplate(self, organizationId: str, configTemplateId: str):
"""
**Return a single configuration template**
https://developer.cisco.com/meraki/api-v1/#!get-organization-config-template
- organizationId (string): Organization ID
- configTemplateId (string): Config template ID
"""

metadata = {
'tags': ['organizations', 'configure', 'configTemplates'],
'operation': 'getOrganizationConfigTemplate'
}
organizationId = urllib.parse.quote(str(organizationId), safe='')
configTemplateId = urllib.parse.quote(str(configTemplateId), safe='')
resource = f'/organizations/{organizationId}/configTemplates/{configTemplateId}'

return self._session.get(metadata, resource)



def getOrganizationConfigurationChanges(self, organizationId: str, total_pages=1, direction='prev', **kwargs):
"""
**View the Change Log for your organization**
Expand Down Expand Up @@ -2165,6 +2165,52 @@ def getOrganizationInventoryDevices(self, organizationId: str, total_pages=1, di



def createOrganizationInventoryDevicesSwapsBulk(self, organizationId: str, swaps: list):
"""
**Swap the devices identified by devices.old with a devices.new, then perform the :afterAction on the devices.old.**
https://developer.cisco.com/meraki/api-v1/#!create-organization-inventory-devices-swaps-bulk
- organizationId (string): Organization ID
- swaps (array): List of replacments to perform
"""

kwargs = locals()

metadata = {
'tags': ['organizations', 'configure', 'inventory', 'devices', 'swaps', 'bulk'],
'operation': 'createOrganizationInventoryDevicesSwapsBulk'
}
organizationId = urllib.parse.quote(str(organizationId), safe='')
resource = f'/organizations/{organizationId}/inventory/devices/swaps/bulk'

body_params = ['swaps', ]
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}

return self._session.post(metadata, resource, payload)



def getOrganizationInventoryDevicesSwapsBulk(self, organizationId: str, id: str):
"""
**List of device swaps for a given request ID ({id}).**
https://developer.cisco.com/meraki/api-v1/#!get-organization-inventory-devices-swaps-bulk
- organizationId (string): Organization ID
- id (string): ID
"""

metadata = {
'tags': ['organizations', 'configure', 'inventory', 'devices', 'swaps', 'bulk'],
'operation': 'getOrganizationInventoryDevicesSwapsBulk'
}
organizationId = urllib.parse.quote(str(organizationId), safe='')
id = urllib.parse.quote(str(id), safe='')
resource = f'/organizations/{organizationId}/inventory/devices/swaps/bulk/{id}'

return self._session.get(metadata, resource)



def getOrganizationInventoryDevice(self, organizationId: str, serial: str):
"""
**Return a single device from the inventory of an organization**
Expand Down
90 changes: 90 additions & 0 deletions meraki/aio/api/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,96 @@ def __init__(self, session):



def getDeviceSensorCommands(self, serial: str, total_pages=1, direction='next', **kwargs):
"""
**Returns a historical log of all commands**
https://developer.cisco.com/meraki/api-v1/#!get-device-sensor-commands
- serial (string): Serial
- total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages
- direction (string): direction to paginate, either "next" (default) or "prev" page
- operations (array): Optional parameter to filter commands by operation. Allowed values are disableDownstreamPower, enableDownstreamPower, cycleDownstreamPower, and refreshData.
- perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 10.
- 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.
- 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.
- sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'descending'.
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 30 days from today.
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 30 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 30 days. The default is 30 days.
"""

kwargs.update(locals())

if 'sortOrder' in kwargs:
options = ['ascending', 'descending']
assert kwargs['sortOrder'] in options, f'''"sortOrder" cannot be "{kwargs['sortOrder']}", & must be set to one of: {options}'''

metadata = {
'tags': ['sensor', 'configure', 'commands'],
'operation': 'getDeviceSensorCommands'
}
serial = urllib.parse.quote(str(serial), safe='')
resource = f'/devices/{serial}/sensor/commands'

query_params = ['operations', 'perPage', 'startingAfter', 'endingBefore', 'sortOrder', 't0', 't1', 'timespan', ]
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}

array_params = ['operations', ]
for k, v in kwargs.items():
if k.strip() in array_params:
params[f'{k.strip()}[]'] = kwargs[f'{k}']
params.pop(k.strip())

return self._session.get_pages(metadata, resource, params, total_pages, direction)



def createDeviceSensorCommand(self, serial: str, operation: str):
"""
**Sends a command to a sensor**
https://developer.cisco.com/meraki/api-v1/#!create-device-sensor-command
- serial (string): Serial
- 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.
"""

kwargs = locals()

metadata = {
'tags': ['sensor', 'configure', 'commands'],
'operation': 'createDeviceSensorCommand'
}
serial = urllib.parse.quote(str(serial), safe='')
resource = f'/devices/{serial}/sensor/commands'

body_params = ['operation', ]
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}

return self._session.post(metadata, resource, payload)



def getDeviceSensorCommand(self, serial: str, commandId: str):
"""
**Returns information about the command's execution, including the status**
https://developer.cisco.com/meraki/api-v1/#!get-device-sensor-command
- serial (string): Serial
- commandId (string): Command ID
"""

metadata = {
'tags': ['sensor', 'configure', 'commands'],
'operation': 'getDeviceSensorCommand'
}
serial = urllib.parse.quote(str(serial), safe='')
commandId = urllib.parse.quote(str(commandId), safe='')
resource = f'/devices/{serial}/sensor/commands/{commandId}'

return self._session.get(metadata, resource)



def getDeviceSensorRelationships(self, serial: str):
"""
**List the sensor roles for a given sensor or camera device.**
Expand Down
Loading

0 comments on commit 9c480a7

Please sign in to comment.