cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

SOLVED
Highlighted
Conversationalist

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. 

1 ACCEPTED SOLUTION

Accepted Solutions
Getting noticed

Re: using github script, receiving 400 error, when I send the same command with Postman it works

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

6 REPLIES 6
Getting noticed

Re: using github script, receiving 400 error, when I send the same command with Postman it works

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.

Conversationalist

Re: using github script, receiving 400 error, when I send the same command with Postman it works

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

 

2019-09-24_13-46-03.png

Getting noticed

Re: using github script, receiving 400 error, when I send the same command with Postman it works

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. 

Getting noticed

Re: using github script, receiving 400 error, when I send the same command with Postman it works

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

Conversationalist

Re: using github script, receiving 400 error, when I send the same command with Postman it works

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. 

Conversationalist

Re: using github script, receiving 400 error, when I send the same command with Postman it works

updatePort.JPG

Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.