Forum Discussion
Hi,
As an alternative to using python to send the graphql queries, we can look to use the cato-cli to make any call that the API supports. Please see the following resources published on how to use python to call the CLI with a few examples for windows and unix.
https://github.com/catonetworks/cato-cli?tab=readme-ov-file#advanced-cato-cli-topics
pip3 install cato-cli
catocli configure
Please see the following examples for how to delete a network from one site:
catocli mutation site removeNetworkRange '{
"networkRangeId": "UzU2NjQwMA=="
}'
Please see an example of how to add a network range to a site below:
catocli mutation site addNetworkRange '{
"addNetworkRangeInput": {
"localIp": "10.11.0.1",
"name": "MyNetwork Range",
"rangeType": "Direct",
"subnet": "10.11.0.0/24"
},
"lanSocketInterfaceId": "177643"
}'
Please note that I used the cato api explorer application to generate these code examples, this is a docker application you can run locally on your machine that will generate cli commands, as well as python code snippits on the fly for you for any API that is in the schema.
https://github.com/catonetworks/cato-api-explorer