Skip to content

Commit

Permalink
Automatically regenerated library. (#228)
Browse files Browse the repository at this point in the history
Co-authored-by: GitHub Action <[email protected]>
  • Loading branch information
TKIPisalegacycipher and GitHub Action authored Oct 5, 2023
1 parent 51a886b commit 3b883ec
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 73 deletions.
2 changes: 1 addition & 1 deletion meraki/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
USE_ITERATOR_FOR_GET_PAGES,
)

__version__ = '1.37.3'
__version__ = '1.38.0'


class DashboardAPI(object):
Expand Down
44 changes: 8 additions & 36 deletions meraki/aio/api/organizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -1998,12 +1998,17 @@ def deleteOrganizationEarlyAccessFeaturesOptIn(self, organizationId: str, optInI



def getOrganizationFirmwareUpgrades(self, organizationId: str, **kwargs):
def getOrganizationFirmwareUpgrades(self, organizationId: str, total_pages=1, direction='next', **kwargs):
"""
**Get firmware upgrade information for an organization**
https://developer.cisco.com/meraki/api-v1/#!get-organization-firmware-upgrades
- organizationId (string): Organization ID
- 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
- perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000.
- 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.
- status (array): Optional parameter to filter the upgrade by status.
- productTypes (array): Optional parameter to filter the upgrade by product type.
"""
Expand All @@ -2017,7 +2022,7 @@ def getOrganizationFirmwareUpgrades(self, organizationId: str, **kwargs):
organizationId = urllib.parse.quote(str(organizationId), safe='')
resource = f'/organizations/{organizationId}/firmware/upgrades'

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

array_params = ['status', 'productTypes', ]
Expand All @@ -2026,7 +2031,7 @@ def getOrganizationFirmwareUpgrades(self, organizationId: str, **kwargs):
params[f'{k.strip()}[]'] = kwargs[f'{k}']
params.pop(k.strip())

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



Expand Down Expand Up @@ -3563,39 +3568,6 @@ def getOrganizationUplinksStatuses(self, organizationId: str, total_pages=1, dir



def getOrganizationUplinksLossAndLatency(self, organizationId: str, **kwargs):
"""
**Return the uplink loss and latency for every MX in the organization from at latest 2 minutes ago**
https://developer.cisco.com/meraki/api-v1/#!get-organization-uplinks-loss-and-latency
- organizationId (string): Organization ID
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 60 days from today.
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 5 minutes after t0. The latest possible time that t1 can be is 2 minutes into the past.
- 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 5 minutes. The default is 5 minutes.
- uplink (string): Optional filter for a specific WAN uplink. Valid uplinks are wan1, wan2, wan3, cellular. Default will return all uplinks.
- ip (string): Optional filter for a specific destination IP. Default will return all destination IPs.
"""

kwargs.update(locals())

if 'uplink' in kwargs:
options = ['cellular', 'wan1', 'wan2', 'wan3']
assert kwargs['uplink'] in options, f'''"uplink" cannot be "{kwargs['uplink']}", & must be set to one of: {options}'''

metadata = {
'tags': ['organizations', 'monitor', 'uplinksLossAndLatency'],
'operation': 'getOrganizationUplinksLossAndLatency'
}
organizationId = urllib.parse.quote(str(organizationId), safe='')
resource = f'/organizations/{organizationId}/uplinksLossAndLatency'

query_params = ['t0', 't1', 'timespan', 'uplink', 'ip', ]
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}

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



def getOrganizationWebhooksAlertTypes(self, organizationId: str, **kwargs):
"""
**Return a list of alert types to be used with managing webhook alerts**
Expand Down
55 changes: 55 additions & 0 deletions meraki/aio/api/sm.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,34 @@ def getNetworkSmDeviceDeviceProfiles(self, networkId: str, deviceId: str):



def installNetworkSmDeviceApps(self, networkId: str, deviceId: str, appIds: list, **kwargs):
"""
**Install applications on a device**
https://developer.cisco.com/meraki/api-v1/#!install-network-sm-device-apps
- networkId (string): Network ID
- deviceId (string): Device ID
- appIds (array): ids of applications to be installed
- force (boolean): By default, installation of an app which is believed to already be present on the device will be skipped. If you'd like to force the installation of the app, set this parameter to true.
"""

kwargs.update(locals())

metadata = {
'tags': ['sm', 'configure', 'devices'],
'operation': 'installNetworkSmDeviceApps'
}
networkId = urllib.parse.quote(str(networkId), safe='')
deviceId = urllib.parse.quote(str(deviceId), safe='')
resource = f'/networks/{networkId}/sm/devices/{deviceId}/installApps'

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

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



def getNetworkSmDeviceNetworkAdapters(self, networkId: str, deviceId: str):
"""
**List the network adapters of a device**
Expand Down Expand Up @@ -585,6 +613,33 @@ def unenrollNetworkSmDevice(self, networkId: str, deviceId: str):



def uninstallNetworkSmDeviceApps(self, networkId: str, deviceId: str, appIds: list):
"""
**Uninstall applications on a device**
https://developer.cisco.com/meraki/api-v1/#!uninstall-network-sm-device-apps
- networkId (string): Network ID
- deviceId (string): Device ID
- appIds (array): ids of applications to be uninstalled
"""

kwargs = locals()

metadata = {
'tags': ['sm', 'configure', 'devices'],
'operation': 'uninstallNetworkSmDeviceApps'
}
networkId = urllib.parse.quote(str(networkId), safe='')
deviceId = urllib.parse.quote(str(deviceId), safe='')
resource = f'/networks/{networkId}/sm/devices/{deviceId}/uninstallApps'

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

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



def getNetworkSmDeviceWlanLists(self, networkId: str, deviceId: str):
"""
**List the saved SSID names on a device**
Expand Down
44 changes: 8 additions & 36 deletions meraki/api/organizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -1998,12 +1998,17 @@ def deleteOrganizationEarlyAccessFeaturesOptIn(self, organizationId: str, optInI



def getOrganizationFirmwareUpgrades(self, organizationId: str, **kwargs):
def getOrganizationFirmwareUpgrades(self, organizationId: str, total_pages=1, direction='next', **kwargs):
"""
**Get firmware upgrade information for an organization**
https://developer.cisco.com/meraki/api-v1/#!get-organization-firmware-upgrades
- organizationId (string): Organization ID
- 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
- perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000.
- 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.
- status (array): Optional parameter to filter the upgrade by status.
- productTypes (array): Optional parameter to filter the upgrade by product type.
"""
Expand All @@ -2017,7 +2022,7 @@ def getOrganizationFirmwareUpgrades(self, organizationId: str, **kwargs):
organizationId = urllib.parse.quote(str(organizationId), safe='')
resource = f'/organizations/{organizationId}/firmware/upgrades'

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

array_params = ['status', 'productTypes', ]
Expand All @@ -2026,7 +2031,7 @@ def getOrganizationFirmwareUpgrades(self, organizationId: str, **kwargs):
params[f'{k.strip()}[]'] = kwargs[f'{k}']
params.pop(k.strip())

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



Expand Down Expand Up @@ -3563,39 +3568,6 @@ def getOrganizationUplinksStatuses(self, organizationId: str, total_pages=1, dir



def getOrganizationUplinksLossAndLatency(self, organizationId: str, **kwargs):
"""
**Return the uplink loss and latency for every MX in the organization from at latest 2 minutes ago**
https://developer.cisco.com/meraki/api-v1/#!get-organization-uplinks-loss-and-latency
- organizationId (string): Organization ID
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 60 days from today.
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 5 minutes after t0. The latest possible time that t1 can be is 2 minutes into the past.
- 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 5 minutes. The default is 5 minutes.
- uplink (string): Optional filter for a specific WAN uplink. Valid uplinks are wan1, wan2, wan3, cellular. Default will return all uplinks.
- ip (string): Optional filter for a specific destination IP. Default will return all destination IPs.
"""

kwargs.update(locals())

if 'uplink' in kwargs:
options = ['cellular', 'wan1', 'wan2', 'wan3']
assert kwargs['uplink'] in options, f'''"uplink" cannot be "{kwargs['uplink']}", & must be set to one of: {options}'''

metadata = {
'tags': ['organizations', 'monitor', 'uplinksLossAndLatency'],
'operation': 'getOrganizationUplinksLossAndLatency'
}
organizationId = urllib.parse.quote(str(organizationId), safe='')
resource = f'/organizations/{organizationId}/uplinksLossAndLatency'

query_params = ['t0', 't1', 'timespan', 'uplink', 'ip', ]
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}

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



def getOrganizationWebhooksAlertTypes(self, organizationId: str, **kwargs):
"""
**Return a list of alert types to be used with managing webhook alerts**
Expand Down
55 changes: 55 additions & 0 deletions meraki/api/sm.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,34 @@ def getNetworkSmDeviceDeviceProfiles(self, networkId: str, deviceId: str):



def installNetworkSmDeviceApps(self, networkId: str, deviceId: str, appIds: list, **kwargs):
"""
**Install applications on a device**
https://developer.cisco.com/meraki/api-v1/#!install-network-sm-device-apps
- networkId (string): Network ID
- deviceId (string): Device ID
- appIds (array): ids of applications to be installed
- force (boolean): By default, installation of an app which is believed to already be present on the device will be skipped. If you'd like to force the installation of the app, set this parameter to true.
"""

kwargs.update(locals())

metadata = {
'tags': ['sm', 'configure', 'devices'],
'operation': 'installNetworkSmDeviceApps'
}
networkId = urllib.parse.quote(str(networkId), safe='')
deviceId = urllib.parse.quote(str(deviceId), safe='')
resource = f'/networks/{networkId}/sm/devices/{deviceId}/installApps'

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

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



def getNetworkSmDeviceNetworkAdapters(self, networkId: str, deviceId: str):
"""
**List the network adapters of a device**
Expand Down Expand Up @@ -585,6 +613,33 @@ def unenrollNetworkSmDevice(self, networkId: str, deviceId: str):



def uninstallNetworkSmDeviceApps(self, networkId: str, deviceId: str, appIds: list):
"""
**Uninstall applications on a device**
https://developer.cisco.com/meraki/api-v1/#!uninstall-network-sm-device-apps
- networkId (string): Network ID
- deviceId (string): Device ID
- appIds (array): ids of applications to be uninstalled
"""

kwargs = locals()

metadata = {
'tags': ['sm', 'configure', 'devices'],
'operation': 'uninstallNetworkSmDeviceApps'
}
networkId = urllib.parse.quote(str(networkId), safe='')
deviceId = urllib.parse.quote(str(deviceId), safe='')
resource = f'/networks/{networkId}/sm/devices/{deviceId}/uninstallApps'

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

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



def getNetworkSmDeviceWlanLists(self, networkId: str, deviceId: str):
"""
**List the saved SSID names on a device**
Expand Down

0 comments on commit 3b883ec

Please sign in to comment.