The attached python3 code can be used to export one, several, or all event rules, alert rules, or saved queries.
1. Download the attached zip, unzip it
2. Install requirements: python3 -m pip install requirements.txt
3. Export desired objects to folder (see commands below)
4. Import objects from folder (see commands below)
Notes:
* You will need API keys for your intended export and import environments.
* Context queries will be included in exported alert rules.
* --domainsuffix only required if not .uptycs.io
Example 1. Export all event and alert rules from tenant_a then import them to tenant_b:
# export
python3 object_export.py tenant_a_api_key.json -e --all tenant_a_objects --domainsuffix .myuptycs.com
python3 object_export.py tenant_a_api_key.json -a --all tenant_a_objects --domainsuffix .myuptycs.com
# import
python3 object_import.py tenant_b_api_key.json tenant_a_objects --domainsuffix .myuptycs.com