Hi Robert,
I setup a dedicated CentOS 7 VM, altinstalled Python 2.7.14, cloned the Github project and fired off the tool. I'm hoping to ultimately save time and avoid mistakes deploying new tenants in our MDS environment and am happy to see that we can extract the export file and edit the resulting files in a standard text editor. Nice work on the NAT rules, they export perfectly and it would be allot faster creating section titles and simply moving some rules around, instead of creating everything from scratch every time.
The actual domain policies don't export and receive the following errors in the 'export_error_log.elg' file:
Failed to retrieve layer named 'Network'! Error: Requested object name [Network] is not unique.. Layer was not exported!
Failed to retrieve layer named 'Application'! Error: Requested object name [Application] is not unique.. Layer was not exported!
Failed to retrieve layer named 'Network'! Error: Requested object name [Network] is not unique.. Layer was not exported!
Failed to retrieve layer named 'Network'! Error: Requested object name [Network] is not unique.. Layer was not exported!
Failed to retrieve layer named 'Application'! Error: Requested object name [Application] is not unique.. Layer was not exported!
I assume this has to do with the Global policy assignment on domains, herewith a screenshot:
PS: The above screenshot is from the 'Network' policy where rules 1-8 and 9 are globally assigned and customers can exclusively edit the inline domain policy. I assume the export tool subsequently sees multiple 'Network' and 'Application' policy layers.
Really, really hoping the API can reference layers using unique IDs instead of names, to overcome this limitation, as it essentially doesn't work with Multi-Domain Server instances...
PS: Not sure why the export tool complains about 'Network' three times and 'Application' twice as the structure there is essentially the same:
PS: Snipped out rules 8.1 and 8.2 as they contain customer references.
Herewith the content of the 'import_export.log' file:
Checking existence of package [Standard]
Exporting Access Control layers
Exporting Access Layer [Network]
Getting layer information for layer [Network]
Failed to retrieve layer named 'Network'! Error: Requested object name [Network] is not unique.. Layer was not exported!
Exporting Access Layer [Application]
Getting layer information for layer [Application]
Failed to retrieve layer named 'Application'! Error: Requested object name [Application] is not unique.. Layer was not exported!
Exporting Access Layer [Network]
Getting layer information for layer [Network]
Failed to retrieve layer named 'Network'! Error: Requested object name [Network] is not unique.. Layer was not exported!
Exporting Access Layer [Network]
Getting layer information for layer [Network]
Failed to retrieve layer named 'Network'! Error: Requested object name [Network] is not unique.. Layer was not exported!
Exporting Access Layer [Application]
Getting layer information for layer [Application]
Failed to retrieve layer named 'Application'! Error: Requested object name [Application] is not unique.. Layer was not exported!
Exporting NAT policy
Getting information from show-nat-rulebase
Retrieved 4 out of 4 rules (100%)
##Show presented object of type CpmiAnyObject with name All
##Show presented object of type CpmiAnyObject with name Any
##Show presented object of type network with name CP_default_Office_Mode_addresses_pool
##Show presented object of type host with name External IP 2
##Show presented object of type group with name Internal
##Show presented object of type Global with name Original
##Show presented object of type Global with name Policy Targets
Analysing rulebase items...
##Show presented dependent rule of type nat-rule under section Exempt NAT
##Show presented section of type nat-section with name Exempt NAT
##Show presented dependent rule of type nat-rule under section Outbound NAT
##Show presented section of type nat-section with name Outbound NAT
Processing rules and sections
Updating data for rule #3
Updating data for rule #4
Exporting hosts
Exporting host with uid 882d76fe-87fe-4335-902e-2e9a994ba17b named External IP 2
Exporting groups
Exporting groups from group [Internal]
Exporting networks from group [Network - Client Name]
Exporting network with uid 2582f788-a426-421c-9aa6-6590e98c0d09 named LAN - Bloemfontein
Exporting network with uid b7a7cfab-8bee-4a8b-9d9c-ea776bd5d67a named LAN - Cape Town
Exporting network with uid af52ae76-5783-4f24-b035-da17bb9a72af named LAN - Polokwane
Exporting network with uid f80dd08c-ea84-4c19-9811-ac7e00114e38 named LAN - Durban
Exporting network with uid c13b2949-40f3-4bb2-a509-3baa1a09e330 named LAN - Johannesburg
Exporting network with uid f7c169bf-2140-4db7-b16f-16c411b940d5 named LAN - Nelspruit
Exporting network with uid a50a97cb-68fa-4b4d-ac3d-204a66d6a5b0 named LAN - Port Elizabeth
Exporting networks from group [Network - Guest WiFi]
Exporting network with uid b3b1a4e2-0f01-48c0-8d29-d10ff90e9c46 named LAN - Johannesburg - Guest WiFi
Exporting networks from group [Network - Teraco - Syrex]
Exporting network with uid e7248c6c-f2a7-404f-946f-1237ac1b038b named LAN - Teraco - Core uplink
Exporting network with uid 8b4171f6-894e-474e-9847-87b2f8f17472 named LAN - Teraco - Hosting
Exporting group with uid f8be31fc-2bcc-44ca-bac5-7ab25d1bf3d5 named Network - Client Name
Exporting group with uid da6a0028-6a76-42b8-86bb-02dc17958b0c named Network - Guest WiFi
Exporting group with uid 9531c411-5e31-4241-a44a-5cd1a9d6e3d4 named Network - Teraco - Syrex
Exporting group with uid 2dbc672f-a834-497a-b154-e9211f6d79b2 named Internal
Exporting networks
Exporting network with uid 22e75d37-812c-46f7-ad40-7eda6f193329 named CP_default_Office_Mode_addresses_pool
Exporting NAT rules
Exporting nat-rule with uid bcd6bdbe-30ca-47f0-8098-6898cd67cd98
Exporting nat-rule with uid 2359440f-d4dd-4adc-b1c2-f6eb38b80e98
Exporting placeholders for unexportable objects from NAT rulebase
Done exporting NAT rulebase.
Exporting general objects to TAR...
Regards
David Herselman