Pre-Requisites:
- ORG ID = Can be found from the support tab of the SDDC
- SDDC ID = Can be found from the support tab of the SDDC
- O Auth Token or API token = Login into Cloud Portal (https://console.cloud.vmware.com) . Navigate to My Account > API Tokens > Generate Token > Give a name, select All Roles > Generate. (Note down the API Token somewhere safe)
- Make sure you have python installed on your desktop. Python version 3.0 and above is needed.
- Packages that needs to be installed/present on desktop - requests, json, argparse (Command to install these packages. e.g. pip install requests)
Command Syntax:
python ExportVMCFWRules.py orgid sddcid refreshtoken > outFile.json
Output:
outFile.json = This file will have all Firewall rules which includes Management Gateway Rules, Compute Gateway Rules and Distributed Firewall rules.
Script:
Has been attached with this article. (Under Attachments)