cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
6638
Views
2
Helpful
6
Replies

github update_ports script, 400 status code > resolved by removing port attributes from JSON data

CiscoDave
Frequent Visitor
Frequent Visitor

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.

1 Accepted Solution

Accepted Solutions

Hello @CiscoDave 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

View solution in original post

6 Replies 6

CBurkhead
Level 5
Level 5

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.

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

image.png

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.

Hello @CiscoDave 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

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.

image.jpeg