Writing a QoS rule

KarstenI
Kind of a big deal
Kind of a big deal

Writing a QoS rule

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 found this post helpful, please give it Kudos. If my answer solves your problem, please click Accept as Solution so others can benefit from it.
13 Replies 13
alemabrahao
Kind of a big deal
Kind of a big deal

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 am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.
alemabrahao
Kind of a big deal
Kind of a big deal

I've never tried it before, but I believe it should work.

I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.
KarstenI
Kind of a big deal
Kind of a big deal

Yes, this works. But it can't be the solution if the dashboard can have an "Any" entry.

If you found this post helpful, please give it Kudos. If my answer solves your problem, please click Accept as Solution so others can benefit from it.
alemabrahao
Kind of a big deal
Kind of a big deal

Have you tried with literally the "Any" argument?

I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.
KarstenI
Kind of a big deal
Kind of a big deal

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.

If you found this post helpful, please give it Kudos. If my answer solves your problem, please click Accept as Solution so others can benefit from it.
RaphaelL
Kind of a big deal
Kind of a big deal

{"id":"x","vlan":null,"protocol":"UDP","srcPort":null,"dstPortRange":"16384-32766","dscp":-1}

RaphaelL_0-1702914334996.png

"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.

 

KarstenI
Kind of a big deal
Kind of a big deal

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.

If you found this post helpful, please give it Kudos. If my answer solves your problem, please click Accept as Solution so others can benefit from it.
RaphaelL
Kind of a big deal
Kind of a big deal

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

KarstenI
Kind of a big deal
Kind of a big deal

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 ... 😞

If you found this post helpful, please give it Kudos. If my answer solves your problem, please click Accept as Solution so others can benefit from it.
RaphaelL
Kind of a big deal
Kind of a big deal

What switch version are you using @KarstenI 

KarstenI
Kind of a big deal
Kind of a big deal

We are on 16.7.

If you found this post helpful, please give it Kudos. If my answer solves your problem, please click Accept as Solution so others can benefit from it.
RaphaelL
Kind of a big deal
Kind of a big deal

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"

KarstenI
Kind of a big deal
Kind of a big deal

I didn't because I was not sure it would be useful as there is nothing where support can directly assist.

If you found this post helpful, please give it Kudos. If my answer solves your problem, please click Accept as Solution so others can benefit from it.
Get notified when there are additional replies to this discussion.