mitchos / pyZscaler

Unofficial Python SDK for Zscaler
https://pyzscaler.readthedocs.io/
MIT License
37 stars 18 forks source link

[ZPA add_segment / update_segment]: tcp and udp pairs. #257

Open mrpackethead opened 6 months ago

mrpackethead commented 6 months ago

In zpa app_segments the add_segment and update_segments take a different type for udp and tcp ports.. in add_segments its a list of string, and in update_segment its a list of of tuple pairs..

Is that intentional?

Is it possible to add a segment with a list of tuple pairs? For example, i want to add ports 80 and 443, not the range 80 to 443.

mitchos commented 6 months ago

Hi @mrpackethead I looked into this and you're right that they're different and yes it will work if we use a list of tuple pairs (pass it as a kwarg tcpPortRange if you need this capability today).

I'm still using the same code from the initial implementation 2 years ago so I think I was going for MVP at that stage vs completely implementing all options. I can't really explain my actions from then 🤷

I've tested it working with the same as the implementation for updating an app segment so I'll go back through that method and bring it up to date with the latest attributes for that ZPA API endpoint. This will be fixed in the next release.

Thanks for flagging.