Hi,
I'm trying to add a ports list to an alias by API
Entry "8,18" is not a valid port number
I tried different ways to add ports, such like a port range: 8-18, and I got same error. But if I add just one port by API, it works. If I add the other ports on GUI by hand, evreything goes well.
Please help me
regards
I'm trying to add a ports list to an alias by API
Code Select
def add_client_dstport_alias(cn, cn_ports):
payload = {
"alias": {
"type": "port",
"enabled": "1",
"name": cn + '_port',
"description": cn,
"content": "8,18",
"proto": "",
"updatefreq": "",
"counters": "0",
"categories": ""
}
}
return api_post('/api/firewall/alias/addItem', payload)
and I got en error:Entry "8,18" is not a valid port number
I tried different ways to add ports, such like a port range: 8-18, and I got same error. But if I add just one port by API, it works. If I add the other ports on GUI by hand, evreything goes well.
Please help me
regards