The Meraki Community
Register or Sign in
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • About Thibaut-Matzke
Thibaut-Matzke

Thibaut-Matzke

Here to help

Member since May 1, 2020

Saturday
Kudos from
User Count
PhilipDAth
Kind of a big deal PhilipDAth
2
View All
Kudos given to
User Count
Minyi
Meraki Employee Minyi
1
KarstenI
Kind of a big deal KarstenI
2
RafaelM
Meraki Alumni (Retired) RafaelM
18
DavidLowe
Meraki Employee DavidLowe
7
SandroNardi
Meraki Employee SandroNardi
30
View All

Community Record

7
Posts
2
Kudos
0
Solutions

Badges

ECMS1
ECMS2
First 5 Posts
Lift-Off View All
Latest Contributions by Thibaut-Matzke
  • Topics Thibaut-Matzke has Participated In
  • Latest Contributions by Thibaut-Matzke

Meraki API : Cannot create new switch Access Policy when bind to a template

by Thibaut-Matzke in Developers & APIs
‎08-31-2021 03:03 AM
‎08-31-2021 03:03 AM
Hello,   I want to create a new access policy to a switch or a template by API call, using the python library. For this, I am using the following method, found on https://developer.cisco.com/meraki/api-v1/#!create-network-switch-access-policy   dashboard.switch.createNetworkSwitchAccessPolicy(networkId=XXXXXXX) I am using it on a switch bind to a template. The problem is : it doesn't seem to create the access policy on the template.    To be sure about it, I have tried with the example on the API V1 documentation :    network_id = 'L_XXXXXXXXXXXXXXXXXX' name = 'Access policy #1' radius_servers = [{'host': '1.2.3.4', 'port': 22, 'secret': 'password1'}] radius_testing_enabled = False radius_coa_support_enabled = False radius_accounting_enabled = True host_mode = 'Single-Host' url_redirect_walled_garden_enabled = True response = dashboard.switch.createNetworkSwitchAccessPolicy( network_id, name, radius_servers, radius_testing_enabled, radius_coa_support_enabled, radius_accounting_enabled, host_mode, url_redirect_walled_garden_enabled, radiusAccountingServers=[{'host': '1.2.3.4', 'port': 22, 'secret': 'password1'}], radiusGroupAttribute='11', accessPolicyType='Hybrid authentication', increaseAccessSpeed=False, guestVlanId=100, voiceVlanClients=True, urlRedirectWalledGardenRanges=['192.168.1.0/24'] ) print(response) (By the way, in the documentation  urlRedirectWalledGardenRanges is a string, but the method needs an array).   When doing so, I get the 201 Created response, but I cannot find this new access policy.   I created two first access policy by hand on the dasboard before trying by API. After trying to create it by API and getting 201 Created, I cannot find it on the dashboard :   On the changelog, I do see POST logs :      But when analyzing it, there is something weird about the values. As you can see, I tried multiple times creating an access policy by API call. Every time I tried, I changed the radius servers to new values (IP and ports). For my last try, I used the code above (the example on API V1 documentation). So, this was the radius server I gave in parameter to the method :  radius_servers = [{'host': '1.2.3.4', 'port': 22, 'secret': 'password1'}]   When checking the logs, there is something weird : it seems like it concatenates my previous radius servers given during my last tries to the new POST : Each blurred host and port was radius servers I previously tried but never at the same time. There are 7 different host in this POST, when I only gave the method 1 radius server (1.2.3.4 port 22).   Also, I cannot find the new access policy when using the get method :  dashboard.switch.getNetworkSwitchAccessPolicies()   I cannot find anything else than my two first access policy created by hand :   Now, when I try to create a new access policy, I get a 500 Internal Server Error message :    I don't have any issue using the other switch access policy methods, the  updateNetworkSwitchAccessPolicy() one works fine on my access policy created by hand.   Does anyone have the same issue as me ? What am I doing wrong ?   Thank you in advance for your answers on my issue ! ... View more

Re: Meraki API : updating switch access policy updates the template access ...

by Thibaut-Matzke in Developers & APIs
‎08-25-2021 12:23 AM
‎08-25-2021 12:23 AM
Hello Inderdeep,   Okay, thank you very much ! ... View more

Re: Meraki API : updating switch access policy updates the template access ...

by Thibaut-Matzke in Developers & APIs
‎08-24-2021 08:45 AM
‎08-24-2021 08:45 AM
Hello Inderdeep,   Thank you for your reply. Yes I do know that is the access Policy API call, but my question is : is it normal that using a switch-related API call modifies the template bind to it ?   When you have a switch that isn't bind to any template, the access policy is only for the switch, which is logic.   But when you have a switch bind to a template, the functionality is only available on the template side, not on the switch side.   To modify a template switch access policy, you would except to use a API call in the config Templates API group, but it actually works by using a method in the switch API call Group.   This means that anyone who has write access to a template-bind switch can modify the access policy of this template, right ?  ... View more

Meraki API : updating switch access policy updates the template access poli...

by Thibaut-Matzke in Developers & APIs
‎08-24-2021 12:55 AM
‎08-24-2021 12:55 AM
Hello,   While trying to write a simple python script to configure a switch access policy to a network template, I couldn't find any methods to change it from the template.   I tried the method  with a configuration template ID in it : dashboard.switch.updateNetworkSwitchAccessPolicy(networkId=MyTemplateNetworkId)  And got the following API Error :   "meraki.exceptions.APIError: switch, updateNetworkSwitchAccessPolicy - 400 Bad Request, {'errors': ['Unsupported for configuration templates']}"   I then tried to update a switch access policy bind to this template by using the same method, and it worked : dashboard.switch.updateNetworkSwitchAccessPolicy( networkId =frwhlppd_network_id , accessPolicyNumber = "1" , name = ' TEST ' )   2021-08-24 09:49:09 meraki: INFO > PUT https://api.meraki.com/api/v1/networks/L_XXXXXXXXXXXXX/switch/accessPolicies/1 2021-08-24 09:49:10 meraki: INFO > switch, updateNetworkSwitchAccessPolicy - 200 OK {'accessPolicyNumber': '1', 'name': ' TEST ', [...] }     Is this normal ? I guess this is for now the only way to modify a template access policy, but will we have another way to do it (by using the template-related method for instance) ?    Thank you in advance for your answers on this topic ! ... View more
Labels:
  • Labels:
  • Code Sample
  • Dashboard API

Network static IP devices DNS configuration script

by Thibaut-Matzke in Developers & APIs
‎06-13-2021 07:16 AM
2 Kudos
‎06-13-2021 07:16 AM
2 Kudos
Hello, I am currently working on a simple script that provides a user-friendly interface to automatically modify an entire network static IP devices DNS configuration.   Here is the repository if you want to check it out & test it : https://github.com/ThibautMatzke/meraki-automation-dns On a previous script, I used to test out the api_key validity by using the function meraki.myorgaccess(api_key), but since apiV1, I cannot find any other way than trying to get the organization list with the provided API key.   This is what I currently do :   # Creates a persistent Meraki Dashboard API session with the given api_key self ._dashboard = meraki.DashboardAPI( api_key =api_key) try : # Tries a function to see if the API Key is valid self ._dashboard.organizations.getOrganizations() # Return true the key is valid return True # Catches the error if the API Key isn't valid except meraki.APIError as e: # Prints the error message print (e) # Returns false if the key is invalid return False       Does anyone have a better way of testing an api_key validity ?   Also, I would like to share this script on Cisco Code Exchange, but since I am totally new, do you have any best practices for this ? Should I wait to implement new features before submitting it ?   Thank you in advance for your answers / feedback !   ... View more
Labels:
  • Labels:
  • Code Sample
  • Dashboard API

Re: Python meraki : Unable to claim network device

by Thibaut-Matzke in Developers & APIs
‎05-01-2020 04:30 PM
‎05-01-2020 04:30 PM
Hello @Nick_B,   My api_key was already set in my environment variable.   I tried by using serials=serialnums, and it perfectly worked ! I tried again without specifying serials=, and it didn't work, so that was the thing I wasn't doing right   Thank you ! ... View more

Python meraki : Unable to claim network device

by Thibaut-Matzke in Developers & APIs
‎05-01-2020 10:48 AM
‎05-01-2020 10:48 AM
Hello,   I am trying to claim a network device by using the Python API. I am using the library "meraki 0.100.2".   In this library, I am trying to use the method "claimNetworkDevices(self, networkId: str, **kwargs)", but it doesn't work.   Here is my code :  import meraki if __name__ == "__main__" : dashboard = meraki.DashboardAPI() serial = [ '****-****-****' ] network_id = "N_******************" dashboard.devices.claimNetworkDevices(network_id , serial)  I get this error : dashboard.devices.claimNetworkDevices(network_id,serial) TypeError: claimNetworkDevices() takes 2 positional arguments but 3 were given   I have tried by using different type of serial argument : serial = { "serials" : [ "****-****-****" ] } serial = "****-****-****' serial = '****-****-****'   but I still have the same issue. I checked the method definition in "devices.py", but I didn't help.   It works fine when I use POSTMAN with the same request.   What am I doing wrong ? Does anyone have the same issue ? ... View more
Labels:
  • Labels:
  • Code Sample
  • Dashboard API
Kudos from
User Count
PhilipDAth
Kind of a big deal PhilipDAth
2
View All
Kudos given to
User Count
Minyi
Meraki Employee Minyi
1
KarstenI
Kind of a big deal KarstenI
2
RafaelM
Meraki Alumni (Retired) RafaelM
18
DavidLowe
Meraki Employee DavidLowe
7
SandroNardi
Meraki Employee SandroNardi
30
View All
My Top Kudoed Posts
Subject Kudos Views

Network static IP devices DNS configuration script

Developers & APIs
2 462
View All
Powered by Khoros
custom.footer.
  • Community Guidelines
  • Cisco Privacy
  • Khoros Privacy
  • Privacy Settings
  • Terms of Use
© 2023 Meraki