- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
github update_ports script, 400 status code > resolved by removing port attributes from JSON data
Hi all -
I am using the update_ports script from https://github.com/meraki/automation-scripts
this used to work fine when I first used it a couple months ago - now I see a status of 400 in the API history when I run it.
The script works fine to grab the data, but when it goes to PUT the data, it does not update the port. No errors while running the script.
When I do a call to the API to see the last API PUT calls, it shows the postman call and the python script call as identical besides the user agent and return status.
Solved! Go to solution.
- Labels:
-
Dashboard API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @Meraki_Dave Meraki_Dave
what details for the port are you defining to update on the port. I'm noticing a problem with the following parameters you should be able to remove these if not required and the script should run.
macWhitelist
stickyMacWhitelist
stickyMacWhitelistLimit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is the issue being dealt with in the "which parameters in an API call are required" thread. I have been doing some work today in my own Python script (which does not use the Github code) and I cannot update a port, either. I am sending the data and I get a 200, but the port is not updated when I look at it in the dashboard. As far as I can tell, this is broken on the backend and Meraki is going to have to address it. Perhaps when this is fixed, it will also resolve the problem originally brought up in the other thread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If that were the case, I would expect it would not work form Postman either, but it does. Not sure if its the same issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have gotten the port to update. What I had to do does not make sense at the moment, but I am not going to worry about it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @Meraki_Dave Meraki_Dave
what details for the port are you defining to update on the port. I'm noticing a problem with the following parameters you should be able to remove these if not required and the script should run.
macWhitelist
stickyMacWhitelist
stickyMacWhitelistLimit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the meraki github code pulls all of the attributes of the port into a variable, then updates the access policy variable and sends it back.
I am not sure how to strip out any of the attribute before it sends the update to the switch.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
