Python code posted down-here utilizes NeutronClient V2 API. It creates router RouterDVS for particular tenant, interface to private sub-net "demo1_network" (188.8.131.52/24) and gateway to external flat network "public" (184.108.40.206/24). As usual posting was inspired by question been posted at ask.openstack.org. Actually, API calls core design I was able to find at openstack/python-neutronclient at github.com
Code is intentionally updated and simplified to become understandable by people without strong python development background.
Complete text may be found here