Example #1
0
 def _get_vlan_id_for_network(self, tenant_id, network_id, context,
                              base_plugin_ref):
     """
     Obtain the VLAN ID given the Network ID
     """
     vlan = cdb.get_vlan_binding(network_id)
     return vlan.vlan_id
 def _get_vlan_id_for_network(self, tenant_id, network_id, context,
                              base_plugin_ref):
     """
     Obtain the VLAN ID given the Network ID
     """
     vlan = cdb.get_vlan_binding(network_id)
     return vlan.vlan_id
 def _get_network(self, tenant_id, network_id, context, base_plugin_ref):
     """
     Gets the NETWORK ID
     """
     network = base_plugin_ref._get_network(context, network_id)
     if not network:
         raise exc.NetworkNotFound(net_id=network_id)
     vlan = cdb.get_vlan_binding(network_id)
     return {const.NET_ID: network_id, const.NET_NAME: network.name,
             const.NET_PORTS: network.ports,
             const.NET_VLAN_NAME: vlan.vlan_name,
             const.NET_VLAN_ID: vlan.vlan_id}
Example #4
0
 def delete_network(self, tenant_id, net_id, **kwargs):
     """
     Deletes the network with the specified network identifier
     belonging to the specified tenant.
     """
     LOG.debug("UCSVICPlugin:delete_network() called\n")
     self._set_ucsm(kwargs[const.DEVICE_IP])
     vlan_binding = cdb.get_vlan_binding(net_id)
     vlan_name = vlan_binding[const.VLANNAME]
     self._driver.delete_vlan(vlan_name, self._ucsm_ip, self._ucsm_username,
                              self._ucsm_password)
     #Rohit:passing empty network name, might not need fixing
     net_dict = cutil.make_net_dict(net_id, "", [])
     return net_dict
 def update_network(self, context, id, network):
     """
     Perform this operation in the context of the configured device
     plugins.
     """
     n = network
     vlan = cdb.get_vlan_binding(id)
     args = [n['tenant_id'], id, {'vlan_id': vlan.vlan_id},
             {'net_admin_state': n['admin_state_up']},
             {'vlan_ids': ''}]
     nexus_output = self._invoke_plugin_per_device(const.NEXUS_PLUGIN,
                                                   self._func_name(),
                                                   args)
     return nexus_output
Example #6
0
 def delete_network(self, tenant_id, net_id, **kwargs):
     """
     Deletes the network with the specified network identifier
     belonging to the specified tenant.
     """
     LOG.debug("UCSVICPlugin:delete_network() called\n")
     self._set_ucsm(kwargs[const.DEVICE_IP])
     vlan_binding = cdb.get_vlan_binding(net_id)
     vlan_name = vlan_binding[const.VLANNAME]
     self._driver.delete_vlan(vlan_name, self._ucsm_ip,
                              self._ucsm_username, self._ucsm_password)
     #Rohit:passing empty network name, might not need fixing
     net_dict = cutil.make_net_dict(net_id,
                                    "",
                                    [])
     return net_dict
 def update_network(self, context, id, network):
     """
     Perform this operation in the context of the configured device
     plugins.
     """
     n = network
     vlan = cdb.get_vlan_binding(id)
     args = [
         n['tenant_id'], id, {
             'vlan_id': vlan.vlan_id
         }, {
             'net_admin_state': n['admin_state_up']
         }, {
             'vlan_ids': ''
         }
     ]
     nexus_output = self._invoke_plugin_per_device(const.NEXUS_PLUGIN,
                                                   self._func_name(), args)
     return nexus_output
Example #8
0
 def _get_vlan_id_for_network(self, tenant_id, network_id):
     """Return the VLAN id as set by the L2 network plugin"""
     vlan_binding = cdb.get_vlan_binding(network_id)
     return vlan_binding[const.VLANID]
Example #9
0
 def _get_vlan_id_for_network(self, tenant_id, network_id):
     """Return the VLAN id as set by the L2 network plugin"""
     vlan_binding = cdb.get_vlan_binding(network_id)
     return vlan_binding[const.VLANID]
 def release_segmentation_id(self, tenant_id, net_id, **kwargs):
     """Release the ID"""
     vlan_binding = cdb.get_vlan_binding(net_id)
     return cdb.release_vlanid(vlan_binding[const.VLANID])
Example #11
0
 def release_segmentation_id(self, tenant_id, net_id, **kwargs):
     """Release the ID"""
     vlan_binding = cdb.get_vlan_binding(net_id)
     return cdb.release_vlanid(vlan_binding[const.VLANID])