Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenStack Python Programming - Network

I'm trying to build Python programs to connect to OpenStack. I've just created two interfaces on a router with the neutron.create_port command but I need one of them to point to my 'public' network and I can't see how to do this, i.e. set a gateway. I know how to do it from the CLI but not from neutronclient. I'm creating the port as follows (note this does work):

pub_port = {'admin_state_up':True, 'device_id':router_id, 'network_id':pubnet_id}
neutron.create_port({'port':pub_port})

So my general question is also where do I find detailed documentation on all the neutronclient parameters and/or openstackclient parameters than can be used in Python programs - I can find it all for the CLI.