In the older versions and even in R80.10 cpmiquerybin tool (cpwiki.net) might be used.
The following query to returns firewalls and cluster members:
cpmiquerybin attr "" network_objects "(type='cluster_member') | (type='gateway') & (location='internal')" -a __name__,ipaddr
It should return
object1 IP
object2 IP
In a Multi-Domain Server either run this query in each CMA or use the next query in the MDS context
cpmiquerybin attr "mdsdb" network_objects "(type='gateway') | (type='cluster_member')" -a __name__,ipaddr
Some awk or sed is necessary to get desired output.