2

I wanted to update vif_model of already created port. I use following command in CLI

neutron port-update --binding:vif_model=avp <port_id>

How to achieve the same using python apis of neutron. I'm trying to use update_port() api. But not sure about parameters.

>>> from neutronclient.neutron import client
>>> neutron = client.Client('2.0', endpoint_url=neutron_endpoint, token=tok)
>>> help(neutron.update_port)

gives below hint :

Help on function with_params in module neutronclient.v2_0.client:

with_params(*args, **kwargs)

Community
  • 1
  • 1
anoop.babu
  • 405
  • 2
  • 6
  • 13
  • Is that a valid command line? Looking through the [API reference](http://developer.openstack.org/api-ref-networking-v2-ext.html#port_binding-ext) I see support for `binding:vnic_type`, `binding:host_id`, and `binding:profile`, but nothing for `binding:vif_model`. – larsks Jul 21 '15 at 13:49
  • I am using Windriver Openstack Havana release. This is windriver's addition to port since they are supporting accelerated virtual port (avp) – anoop.babu Jul 21 '15 at 15:13

1 Answers1

2

I looked at the Nova source for an example of how the update_port call is usually used, and it looks like you would call it something like this:

client.update_port('1fe691a6-f3a0-4586-b126-9fabb11e962a',
                   {'port': 
                     {'binding:vif_type': 'avp'}})
larsks
  • 277,717
  • 41
  • 399
  • 399