Hi all,
I am struggling with the Meraki API "createNetworkSwitchQosRule" ...
When I send
{'dstPortRange': '20000-64999', 'protocol': 'UDP', 'vlan': 4}
I get the error
'Source port is required when protocol is UDP'
But when I include the SourcePort "None" (I want to have any source)
{'dstPortRange': '20000-64999', 'protocol': 'UDP', 'srcPort': None, 'vlan': 3}
I get the error
"'srcPort' must be an integer"
"None" is what I get when I read the rule from the dashboard.
How do I have to send this request?
Have a great day, Karsten
If you want to specify any source port, you could try setting the srcPort to a range that covers all possible ports. In most systems, this would be 1-65535.
I've never tried it before, but I believe it should work.
Yes, this works. But it can't be the solution if the dashboard can have an "Any" entry.
Have you tried with literally the "Any" argument?
I didn't try "Any" as it is an Integer. I tried zero, but that also gives an error that it has to be greater than zero.
{"id":"x","vlan":null,"protocol":"UDP","srcPort":null,"dstPortRange":"16384-32766","dscp":-1}
"ANY" from the dashboard is translated to null via the API.
Have you tried it ?
Taking the payload from the 'GET' endpoint and not being able to 'PUT' it is a big issue... I haven't tried it yet. Going to test it.
yes, I tried that. But in python I can't set the element to null:
newRule["srcPort"]=null
results in
NameError: name 'null' is not defined
I can only set it to Null, but that doesn't work.
payload = '''{
"vlan":null,
"protocol":"UDP",
"srcPortRange":"16384-32766",
"dstPort":null,
"dscp":-1
}'''
{"errors":["'dstPort' must be an integer"]}
I confirm that you can't 'POST' the result from the 'GET' if srcPort or dstPort == ANY( null)
#broken
And not only with the result from the GET. It's the same for building the object from scratch.
Having the API is one of the best strengths of Meraki but at the same time the biggest PITA ... 😞
We are on 16.7.
Running 15.22 or something like that and I'm also experiencing the same issues.
Did you open a case ? I did and I got some very funny "answers"
I didn't because I was not sure it would be useful as there is nothing where support can directly assist.