Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions meraki/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
)
from meraki.rest_session import *

__version__ = '1.56.0'
__api_version__ = '1.56.0'
__version__ = '2.0.0'
__api_version__ = '1.57.0'


class DashboardAPI(object):
Expand Down
8 changes: 4 additions & 4 deletions meraki/aio/api/appliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -2474,10 +2474,10 @@ def getOrganizationApplianceDnsLocalProfilesAssignments(self, organizationId: st



def createOrganizationApplianceDnsLocalProfilesAssignmentsBulkCreate(self, organizationId: str, items: list):
def bulkOrganizationApplianceDnsLocalProfilesAssignmentsCreate(self, organizationId: str, items: list):
"""
**Assign the local DNS profile to networks in the organization**
https://developer.cisco.com/meraki/api-v1/#!create-organization-appliance-dns-local-profiles-assignments-bulk-create
https://developer.cisco.com/meraki/api-v1/#!bulk-organization-appliance-dns-local-profiles-assignments-create

- organizationId (string): Organization ID
- items (array): List containing the network ID and Profile ID
Expand All @@ -2486,8 +2486,8 @@ def createOrganizationApplianceDnsLocalProfilesAssignmentsBulkCreate(self, organ
kwargs = locals()

metadata = {
'tags': ['appliance', 'configure', 'dns', 'local', 'profiles', 'assignments', 'bulkCreate'],
'operation': 'createOrganizationApplianceDnsLocalProfilesAssignmentsBulkCreate'
'tags': ['appliance', 'configure', 'dns', 'local', 'profiles', 'assignments'],
'operation': 'bulkOrganizationApplianceDnsLocalProfilesAssignmentsCreate'
}
organizationId = urllib.parse.quote(str(organizationId), safe='')
resource = f'/organizations/{organizationId}/appliance/dns/local/profiles/assignments/bulkCreate'
Expand Down
5 changes: 3 additions & 2 deletions meraki/aio/api/licensing.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def getAdministeredLicensingSubscriptionSubscriptions(self, organizationIds: lis
- endDate (string): Filter subscriptions by end date, ISO 8601 format. To filter with a range of dates, use 'endDate[<option>]=?' in the request. Accepted options include lt, gt, lte, gte.
- statuses (array): List of statuses that returned subscriptions can have
- productTypes (array): List of product types that returned subscriptions need to have entitlements for.
- skus (array): List of SKUs that returned subscriptions need to have entitlements for.
- name (string): Search for subscription name
"""

Expand All @@ -64,10 +65,10 @@ def getAdministeredLicensingSubscriptionSubscriptions(self, organizationIds: lis
}
resource = f'/administered/licensing/subscription/subscriptions'

query_params = ['perPage', 'startingAfter', 'endingBefore', 'subscriptionIds', 'organizationIds', 'startDate', 'endDate', 'statuses', 'productTypes', 'name', ]
query_params = ['perPage', 'startingAfter', 'endingBefore', 'subscriptionIds', 'organizationIds', 'startDate', 'endDate', 'statuses', 'productTypes', 'skus', 'name', ]
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}

array_params = ['subscriptionIds', 'organizationIds', 'statuses', 'productTypes', ]
array_params = ['subscriptionIds', 'organizationIds', 'statuses', 'productTypes', 'skus', ]
for k, v in kwargs.items():
if k.strip() in array_params:
params[f'{k.strip()}[]'] = kwargs[f'{k}']
Expand Down
4 changes: 2 additions & 2 deletions meraki/aio/api/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ def createNetworkFloorPlan(self, networkId: str, name: str, imageContents: str,
- bottomRightCorner (object): The longitude and latitude of the bottom right corner of your floor plan.
- topLeftCorner (object): The longitude and latitude of the top left corner of your floor plan.
- topRightCorner (object): The longitude and latitude of the top right corner of your floor plan.
- floorNumber (integer): The floor number of the floors within the building
- floorNumber (number): The floor number of the floors within the building
"""

kwargs.update(locals())
Expand Down Expand Up @@ -1361,7 +1361,7 @@ def updateNetworkFloorPlan(self, networkId: str, floorPlanId: str, **kwargs):
- bottomRightCorner (object): The longitude and latitude of the bottom right corner of your floor plan.
- topLeftCorner (object): The longitude and latitude of the top left corner of your floor plan.
- topRightCorner (object): The longitude and latitude of the top right corner of your floor plan.
- floorNumber (integer): The floor number of the floors within the building
- floorNumber (number): The floor number of the floors within the building
- imageContents (string): The file contents (a base 64 encoded string) of your new image. Supported formats are PNG, GIF, and JPG. Note that all images are saved as PNG files, regardless of the format they are uploaded in. If you upload a new image, and you do NOT specify any new geolocation fields ('center, 'topLeftCorner', etc), the floor plan will be recentered with no rotation in order to maintain the aspect ratio of your new image.
"""

Expand Down
91 changes: 89 additions & 2 deletions meraki/aio/api/organizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2688,6 +2688,92 @@ def getOrganizationFloorPlansAutoLocateStatuses(self, organizationId: str, total



def getOrganizationIntegrationsXdrNetworks(self, organizationId: str, total_pages=1, direction='next', **kwargs):
"""
**Returns the networks in the organization that have XDR enabled**
https://developer.cisco.com/meraki/api-v1/#!get-organization-integrations-xdr-networks

- 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
- networkIds (array): Optional parameter to filter the results by network IDs
- perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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.
- 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.
"""

kwargs.update(locals())

metadata = {
'tags': ['organizations', 'configure', 'integrations', 'xdr', 'networks'],
'operation': 'getOrganizationIntegrationsXdrNetworks'
}
organizationId = urllib.parse.quote(str(organizationId), safe='')
resource = f'/organizations/{organizationId}/integrations/xdr/networks'

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

array_params = ['networkIds', ]
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 disableOrganizationIntegrationsXdrNetworks(self, organizationId: str, networks: list):
"""
**Disable XDR on networks**
https://developer.cisco.com/meraki/api-v1/#!disable-organization-integrations-xdr-networks

- organizationId (string): Organization ID
- networks (array): List containing the network ID and the product type to disable XDR on
"""

kwargs = locals()

metadata = {
'tags': ['organizations', 'configure', 'integrations', 'xdr', 'networks'],
'operation': 'disableOrganizationIntegrationsXdrNetworks'
}
organizationId = urllib.parse.quote(str(organizationId), safe='')
resource = f'/organizations/{organizationId}/integrations/xdr/networks/disable'

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

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



def enableOrganizationIntegrationsXdrNetworks(self, organizationId: str, networks: list):
"""
**Enable XDR on networks**
https://developer.cisco.com/meraki/api-v1/#!enable-organization-integrations-xdr-networks

- organizationId (string): Organization ID
- networks (array): List containing the network ID and the product type to enable XDR on
"""

kwargs = locals()

metadata = {
'tags': ['organizations', 'configure', 'integrations', 'xdr', 'networks'],
'operation': 'enableOrganizationIntegrationsXdrNetworks'
}
organizationId = urllib.parse.quote(str(organizationId), safe='')
resource = f'/organizations/{organizationId}/integrations/xdr/networks/enable'

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

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



def claimIntoOrganizationInventory(self, organizationId: str, **kwargs):
"""
**Claim a list of devices, licenses, and/or orders into an organization inventory**
Expand Down Expand Up @@ -3242,7 +3328,8 @@ def updateOrganizationLoginSecurity(self, organizationId: str, **kwargs):
- passwordExpirationDays (integer): Number of days after which users will be forced to change their password.
- enforceDifferentPasswords (boolean): Boolean indicating whether users, when setting a new password, are forced to choose a new password that is different from any past passwords.
- numDifferentPasswords (integer): Number of recent passwords that new password must be distinct from.
- enforceStrongPasswords (boolean): Boolean indicating whether users will be forced to choose strong passwords for their accounts. Strong passwords are at least 8 characters that contain 3 of the following: number, uppercase letter, lowercase letter, and symbol
- enforceStrongPasswords (boolean): Deprecated. Values of 'false' are always ignored.
- minimumPasswordLength (integer): Minimum number of characters required in admins' passwords.
- enforceAccountLockout (boolean): Boolean indicating whether users' Dashboard accounts will be locked out after a specified number of consecutive failed login attempts.
- accountLockoutAttempts (integer): Number of consecutive failed login attempts after which users' accounts will be locked.
- enforceIdleTimeout (boolean): Boolean indicating whether users will be logged out after being idle for the specified number of minutes.
Expand All @@ -3262,7 +3349,7 @@ def updateOrganizationLoginSecurity(self, organizationId: str, **kwargs):
organizationId = urllib.parse.quote(str(organizationId), safe='')
resource = f'/organizations/{organizationId}/loginSecurity'

body_params = ['enforcePasswordExpiration', 'passwordExpirationDays', 'enforceDifferentPasswords', 'numDifferentPasswords', 'enforceStrongPasswords', 'enforceAccountLockout', 'accountLockoutAttempts', 'enforceIdleTimeout', 'idleTimeoutMinutes', 'enforceTwoFactorAuth', 'enforceLoginIpRanges', 'loginIpRanges', 'apiAuthentication', ]
body_params = ['enforcePasswordExpiration', 'passwordExpirationDays', 'enforceDifferentPasswords', 'numDifferentPasswords', 'enforceStrongPasswords', 'minimumPasswordLength', 'enforceAccountLockout', 'accountLockoutAttempts', 'enforceIdleTimeout', 'idleTimeoutMinutes', 'enforceTwoFactorAuth', 'enforceLoginIpRanges', 'loginIpRanges', 'apiAuthentication', ]
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}

return self._session.put(metadata, resource, payload)
Expand Down
4 changes: 4 additions & 0 deletions meraki/aio/api/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ def createDeviceSensorCommand(self, serial: str, operation: str):

kwargs = locals()

if 'operation' in kwargs:
options = ['cycleDownstreamPower', 'disableDownstreamPower', 'enableDownstreamPower', 'refreshData']
assert kwargs['operation'] in options, f'''"operation" cannot be "{kwargs['operation']}", & must be set to one of: {options}'''

metadata = {
'tags': ['sensor', 'configure', 'commands'],
'operation': 'createDeviceSensorCommand'
Expand Down
Loading