meraki / dashboard-api-python

Official Dashboard API library (SDK) for Python
MIT License
289 stars 151 forks source link

Missing output in the Content Filtering #198

Closed y0rune closed 1 year ago

y0rune commented 1 year ago

Hello! I found out that in the latest version of Meraki API the Content Filtering getter is different which show the docs (https://developer.cisco.com/meraki/api-latest/#!get-network-appliance-content-filtering).

Example code in python with outputs:

import meraki
API_KEY = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
network_id = "L_646829496481112748"
dashboard = meraki.DashboardAPI(API_KEY)

# 2023-01-07 01:07:53       meraki:     INFO > PUT https://api.meraki.com/api/v1/networks/L_646829496481112748/appliance/contentFiltering
# 2023-01-07 01:07:55       meraki:     INFO > appliance, updateNetworkApplianceContentFiltering - 200 OK
# {'blockedUrlCategories': [{'id': 'meraki:contentFiltering/category/C6', 'name': 'Adult'}], 'blockedUrlPatterns': [], 'allowedUrlPatterns': []}
response = dashboard.appliance.updateNetworkApplianceContentFiltering(network_id,
    blockedUrlCategories=["meraki:contentFiltering/category/C6"],
    urlCategoryListSize="topSites",
)
print(response)

# 2023-01-07 01:07:55       meraki:     INFO > GET https://api.meraki.com/api/v1/networks/L_646829496481112748/appliance/contentFiltering
# 2023-01-07 01:07:55       meraki:     INFO > appliance, getNetworkApplianceContentFiltering - 200 OK
# {'blockedUrlCategories': [{'id': 'meraki:contentFiltering/category/C6', 'name': 'Adult'}], 'blockedUrlPatterns': [], 'allowedUrlPatterns': []}
response_get = dashboard.appliance.getNetworkApplianceContentFiltering(
    network_id
)
print(response_get)

As far you can see the access for the value 'urlCategoryListSize' is missing in the output of the 'response_get'.

TKIPisalegacycipher commented 1 year ago

Hi @y0rune thanks for reporting this. I don't see any sign that the library is dropping this attribute from the response -- if you are not receiving the attribute from the API then that could be an issue with the API itself. Please open a case with Meraki support to report the issue so the relevant team can fix the problem.