desc
stringlengths
3
26.7k
decl
stringlengths
11
7.89k
bodies
stringlengths
8
553k
'Enables trunk mode an interface on Nexus Switch'
def enable_port_trunk(self, mgr, interface):
pass
'Disables trunk mode an interface on Nexus Switch'
def disable_switch_port(self, mgr, interface):
pass
'Enables trunk mode vlan access an interface on Nexus Switch given VLANID'
def enable_vlan_on_trunk_int(self, mgr, interface, vlanid):
pass
'Enables trunk mode vlan access an interface on Nexus Switch given VLANID'
def disable_vlan_on_trunk_int(self, mgr, interface, vlanid):
pass
'Creates a VLAN and Enable on trunk mode an interface on Nexus Switch given the VLAN ID and Name and Interface Number'
def create_vlan(self, vlan_name, vlan_id, nexus_host, nexus_user, nexus_password, nexus_ports, nexus_ssh_port, vlan_ids):
pass
'Delete a VLAN and Disables trunk mode an interface on Nexus Switch given the VLAN ID and Interface Number'
def delete_vlan(self, vlan_id, nexus_host, nexus_user, nexus_password, nexus_ports, nexus_ssh_port):
pass
'Builds a string with all the VLANs on the same Switch'
def build_vlans_cmd(self):
pass
'Adds a vlan from interfaces on the Nexus switch given the VLAN ID'
def add_vlan_int(self, vlan_id, nexus_host, nexus_user, nexus_password, nexus_ports, nexus_ssh_port, vlan_ids=None):
pass
'Removes a vlan from interfaces on the Nexus switch given the VLAN ID'
def remove_vlan_int(self, vlan_id, nexus_host, nexus_user, nexus_password, nexus_ports, nexus_ssh_port):
pass
'get all nexus port bindings'
def get_all_nexusportbindings(self):
bindings = [] try: for bind in nexus_db.get_all_nexusport_bindings(): LOG.debug(('Getting nexus port binding : %s' % bind.port_id)) bind_dict = {} bind_dict['port-id'] = str(bind.port_id) bind_dict['vlan-id'] = str(bind.vlan_id) ...
'get nexus port binding'
def get_nexusportbinding(self, vlan_id):
binding = [] try: for bind in nexus_db.get_nexusport_binding(vlan_id): LOG.debug(('Getting nexus port binding : %s' % bind.port_id)) bind_dict = {} bind_dict['port-id'] = str(bind.port_id) bind_dict['vlan-id'] = str(bind.vlan_id) ...
'create nexus port binding'
def create_nexusportbinding(self, port_id, vlan_id):
bind_dict = {} try: res = nexus_db.add_nexusport_binding(port_id, vlan_id) LOG.debug(('Created nexus port binding : %s' % res.port_id)) bind_dict['port-id'] = str(res.port_id) bind_dict['vlan-id'] = str(res.vlan_id) return bind_dict except Exception as ...
'delete nexus port binding'
def delete_nexusportbinding(self, vlan_id):
bindings = [] try: bind = nexus_db.remove_nexusport_binding(vlan_id) for res in bind: LOG.debug(('Deleted nexus port binding: %s' % res.vlan_id)) bind_dict = {} bind_dict['port-id'] = res.port_id bindings.append(bind_dict) retur...
'update nexus port binding'
def update_nexusport_binding(self, port_id, new_vlan_id):
try: res = nexus_db.update_nexusport_binding(port_id, new_vlan_id) LOG.debug(('Updating nexus port binding : %s' % res.port_id)) bind_dict = {} bind_dict['port-id'] = str(res.port_id) bind_dict['vlan-id'] = str(res.vlan_id) return bind_dict except E...
'Get all vlan binding into a list of dict'
def get_all_vlan_bindings(self):
vlans = [] try: for vlan_bind in l2network_db.get_all_vlan_bindings(): LOG.debug(('Getting vlan bindings for vlan: %s' % vlan_bind.vlan_id)) vlan_dict = {} vlan_dict['vlan-id'] = str(vlan_bind.vlan_id) vlan_dict['vlan-name'] = vlan_bind.vlan...
'Get a vlan binding'
def get_vlan_binding(self, network_id):
vlan = [] try: for vlan_bind in l2network_db.get_vlan_binding(network_id): LOG.debug(('Getting vlan binding for vlan: %s' % vlan_bind.vlan_id)) vlan_dict = {} vlan_dict['vlan-id'] = str(vlan_bind.vlan_id) vlan_dict['vlan-name'] = vlan_bind.v...
'Create a vlan binding'
def create_vlan_binding(self, vlan_id, vlan_name, network_id):
vlan_dict = {} try: res = l2network_db.add_vlan_binding(vlan_id, vlan_name, network_id) LOG.debug(('Created vlan binding for vlan: %s' % res.vlan_id)) vlan_dict['vlan-id'] = str(res.vlan_id) vlan_dict['vlan-name'] = res.vlan_name vlan_dict['net-id'] = str(r...
'Delete a vlan binding'
def delete_vlan_binding(self, network_id):
try: res = l2network_db.remove_vlan_binding(network_id) LOG.debug(('Deleted vlan binding for vlan: %s' % res.vlan_id)) vlan_dict = {} vlan_dict['vlan-id'] = str(res.vlan_id) return vlan_dict except Exception as exc: raise Exception(('Failed to ...
'Update a vlan binding'
def update_vlan_binding(self, network_id, vlan_id, vlan_name):
try: res = l2network_db.update_vlan_binding(network_id, vlan_id, vlan_name) LOG.debug(('Updating vlan binding for vlan: %s' % res.vlan_id)) vlan_dict = {} vlan_dict['vlan-id'] = str(res.vlan_id) vlan_dict['vlan-name'] = res.vlan_name vlan_dict['net-id']...
'Get all networks'
def get_all_networks(self, tenant_id):
nets = [] try: for net in db.network_list(tenant_id): LOG.debug(('Getting network: %s' % net.uuid)) net_dict = {} net_dict['tenant-id'] = net.tenant_id net_dict['net-id'] = str(net.uuid) net_dict['net-name'] = net.name nets.ap...
'Get a network'
def get_network(self, network_id):
net = [] try: for net in db.network_get(network_id): LOG.debug(('Getting network: %s' % net.uuid)) net_dict = {} net_dict['tenant-id'] = net.tenant_id net_dict['net-id'] = str(net.uuid) net_dict['net-name'] = net.name net.appe...
'Create a network'
def create_network(self, tenant_id, net_name):
net_dict = {} try: res = db.network_create(tenant_id, net_name) LOG.debug(('Created network: %s' % res.uuid)) net_dict['tenant-id'] = res.tenant_id net_dict['net-id'] = str(res.uuid) net_dict['net-name'] = res.name return net_dict except Exception as exc...
'Delete a network'
def delete_network(self, net_id):
try: net = db.network_destroy(net_id) LOG.debug(('Deleted network: %s' % net.uuid)) net_dict = {} net_dict['net-id'] = str(net.uuid) return net_dict except Exception as exc: raise Exception(('Failed to delete port: %s' % str(exc)))
'Update a network'
def update_network(self, tenant_id, net_id, **kwargs):
try: net = db.network_update(net_id, tenant_id, **kwargs) LOG.debug(('Updated network: %s' % net.uuid)) net_dict = {} net_dict['net-id'] = str(net.uuid) net_dict['net-name'] = net.name return net_dict except Exception as exc: raise Exception(('Failed...
'Get all ports'
def get_all_ports(self, net_id):
ports = [] try: for port in db.port_list(net_id): LOG.debug(('Getting port: %s' % port.uuid)) port_dict = {} port_dict['port-id'] = str(port.uuid) port_dict['net-id'] = str(port.network_id) port_dict['int-id'] = port.interface_id ...
'Get a port'
def get_port(self, net_id, port_id):
port_list = [] port = db.port_get(net_id, port_id) try: LOG.debug(('Getting port: %s' % port.uuid)) port_dict = {} port_dict['port-id'] = str(port.uuid) port_dict['net-id'] = str(port.network_id) port_dict['int-id'] = port.interface_id port_dict['state']...
'Add a port'
def create_port(self, net_id):
port_dict = {} try: port = db.port_create(net_id) LOG.debug(('Creating port %s' % port.uuid)) port_dict['port-id'] = str(port.uuid) port_dict['net-id'] = str(port.network_id) port_dict['int-id'] = port.interface_id port_dict['state'] = port.state ret...
'Delete a port'
def delete_port(self, net_id, port_id):
try: port = db.port_destroy(net_id, port_id) LOG.debug(('Deleted port %s' % port.uuid)) port_dict = {} port_dict['port-id'] = str(port.uuid) return port_dict except Exception as exc: raise Exception(('Failed to delete port: %s' % str(exc)))
'Update a port'
def update_port(self, net_id, port_id, port_state):
try: port = db.port_set_state(net_id, port_id, port_state) LOG.debug(('Updated port %s' % port.uuid)) port_dict = {} port_dict['port-id'] = str(port.uuid) port_dict['net-id'] = str(port.network_id) port_dict['int-id'] = port.interface_id port_dict['state...
'Plug interface to a port'
def plug_interface(self, net_id, port_id, int_id):
try: port = db.port_set_attachment(net_id, port_id, int_id) LOG.debug(('Attached interface to port %s' % port.uuid)) port_dict = {} port_dict['port-id'] = str(port.uuid) port_dict['net-id'] = str(port.network_id) port_dict['int-id'] = port.interface_id ...
'Unplug interface to a port'
def unplug_interface(self, net_id, port_id):
try: port = db.port_unset_attachment(net_id, port_id) LOG.debug(('Detached interface from port %s' % port.uuid)) port_dict = {} port_dict['port-id'] = str(port.uuid) port_dict['net-id'] = str(port.network_id) port_dict['int-id'] = port.interface_id ...
'create nexus port binding'
def testa_create_nexusportbinding(self):
binding1 = self.dbtest.create_nexusportbinding('port1', 10) self.assertTrue((binding1['port-id'] == 'port1')) self.tearDown_nexusportbinding()
'get all nexus port binding'
def testb_getall_nexusportbindings(self):
binding1 = self.dbtest.create_nexusportbinding('port1', 10) binding2 = self.dbtest.create_nexusportbinding('port2', 10) bindings = self.dbtest.get_all_nexusportbindings() count = 0 for bind in bindings: if ('port' in bind['port-id']): count += 1 self.assertTrue((count == 2)) ...
'delete nexus port binding'
def testc_delete_nexusportbinding(self):
binding1 = self.dbtest.create_nexusportbinding('port1', 10) self.dbtest.delete_nexusportbinding(10) bindings = self.dbtest.get_all_nexusportbindings() count = 0 for bind in bindings: if ('port ' in bind['port-id']): count += 1 self.assertTrue((count == 0)) self.tearDow...
'update nexus port binding'
def testd_update_nexusportbinding(self):
binding1 = self.dbtest.create_nexusportbinding('port1', 10) binding1 = self.dbtest.update_nexusport_binding(binding1['port-id'], 20) bindings = self.dbtest.get_all_nexusportbindings() count = 0 for bind in bindings: if ('20' in str(bind['vlan-id'])): count += 1 self.assertTru...
'tear down nexusport binding table'
def tearDown_nexusportbinding(self):
LOG.debug('Tearing Down Nexus port Bindings') binds = self.dbtest.get_all_nexusportbindings() for bind in binds: vlan_id = bind['vlan-id'] self.dbtest.delete_nexusportbinding(vlan_id)
'Setup for tests'
def setUp(self):
super(L2networkDBTest, self).setUp() l2network_db.initialize() self.dbtest = L2networkDB() self.quantum = QuantumDB() self.addCleanup(db.clear_db) LOG.debug('Setup')
'test add vlan binding'
def testa_create_vlanbinding(self):
net1 = self.quantum.create_network('t1', 'netid1') vlan1 = self.dbtest.create_vlan_binding(10, 'vlan1', net1['net-id']) self.assertTrue((vlan1['vlan-id'] == '10')) self.teardown_vlanbinding() self.teardown_network()
'test get all vlan binding'
def testb_getall_vlanbindings(self):
net1 = self.quantum.create_network('t1', 'netid1') net2 = self.quantum.create_network('t1', 'netid2') vlan1 = self.dbtest.create_vlan_binding(10, 'vlan1', net1['net-id']) self.assertTrue((vlan1['vlan-id'] == '10')) vlan2 = self.dbtest.create_vlan_binding(20, 'vlan2', net2['net-id']) self.assertT...
'test delete vlan binding'
def testc_delete_vlanbinding(self):
net1 = self.quantum.create_network('t1', 'netid1') vlan1 = self.dbtest.create_vlan_binding(10, 'vlan1', net1['net-id']) self.assertTrue((vlan1['vlan-id'] == '10')) self.dbtest.delete_vlan_binding(net1['net-id']) vlans = self.dbtest.get_all_vlan_bindings() count = 0 for vlan in vlans: ...
'test update vlan binding'
def testd_update_vlanbinding(self):
net1 = self.quantum.create_network('t1', 'netid1') vlan1 = self.dbtest.create_vlan_binding(10, 'vlan1', net1['net-id']) self.assertTrue((vlan1['vlan-id'] == '10')) vlan1 = self.dbtest.update_vlan_binding(net1['net-id'], 11, 'newvlan1') vlans = self.dbtest.get_all_vlan_bindings() count = 0 fo...
'test vlanid methods'
def testm_test_vlanids(self):
l2network_db.create_vlanids() vlanids = l2network_db.get_all_vlanids() self.assertTrue((len(vlanids) > 0)) vlanid = l2network_db.reserve_vlanid() used = l2network_db.is_vlanid_used(vlanid) self.assertTrue(used) used = l2network_db.release_vlanid(vlanid) self.assertFalse(used)
'tearDown Network table'
def teardown_network(self):
LOG.debug('Tearing Down Network') nets = self.quantum.get_all_networks('t1') for net in nets: netid = net['net-id'] self.quantum.delete_network(netid)
'tearDown Port table'
def teardown_port(self):
LOG.debug('Tearing Down Port') nets = self.quantum.get_all_networks('t1') for net in nets: netid = net['net-id'] ports = self.quantum.get_all_ports(netid) for port in ports: portid = port['port-id'] self.quantum.delete_port(netid, portid)
'tearDown VlanBinding table'
def teardown_vlanbinding(self):
LOG.debug('Tearing Down Vlan Binding') vlans = self.dbtest.get_all_vlan_bindings() for vlan in vlans: netid = vlan['net-id'] self.dbtest.delete_vlan_binding(netid)
'Setup for tests'
def setUp(self):
super(QuantumDBTest, self).setUp() l2network_db.initialize() self.addCleanup(db.clear_db) self.dbtest = QuantumDB() self.tenant_id = 't1' LOG.debug('Setup')
'test to create network'
def testa_create_network(self):
net1 = self.dbtest.create_network(self.tenant_id, 'plugin_test1') self.assertTrue((net1['net-name'] == 'plugin_test1')) self.teardown_network_port()
'test to get all networks'
def testb_get_networks(self):
net1 = self.dbtest.create_network(self.tenant_id, 'plugin_test1') self.assertTrue((net1['net-name'] == 'plugin_test1')) net2 = self.dbtest.create_network(self.tenant_id, 'plugin_test2') self.assertTrue((net2['net-name'] == 'plugin_test2')) nets = self.dbtest.get_all_networks(self.tenant_id) coun...
'test to delete network'
def testc_delete_network(self):
net1 = self.dbtest.create_network(self.tenant_id, 'plugin_test1') self.assertTrue((net1['net-name'] == 'plugin_test1')) self.dbtest.delete_network(net1['net-id']) nets = self.dbtest.get_all_networks(self.tenant_id) count = 0 for net in nets: if ('plugin_test1' in net['net-name']): ...
'test to update (rename) network'
def testd_update_network(self):
net1 = self.dbtest.create_network(self.tenant_id, 'plugin_test1') self.assertTrue((net1['net-name'] == 'plugin_test1')) net = self.dbtest.update_network(self.tenant_id, net1['net-id'], name='plugin_test1_renamed') self.assertTrue((net['net-name'] == 'plugin_test1_renamed')) self.teardown_network_por...
'test to create port'
def teste_create_port(self):
net1 = self.dbtest.create_network(self.tenant_id, 'plugin_test1') port = self.dbtest.create_port(net1['net-id']) self.assertTrue((port['net-id'] == net1['net-id'])) ports = self.dbtest.get_all_ports(net1['net-id']) count = 0 for por in ports: count += 1 self.assertTrue((count == 1)) ...
'test to delete port'
def testf_delete_port(self):
net1 = self.dbtest.create_network(self.tenant_id, 'plugin_test1') port = self.dbtest.create_port(net1['net-id']) self.assertTrue((port['net-id'] == net1['net-id'])) ports = self.dbtest.get_all_ports(net1['net-id']) count = 0 for por in ports: count += 1 self.assertTrue((count == 1)) ...
'test to plug/unplug interface'
def testg_plug_unplug_interface(self):
net1 = self.dbtest.create_network(self.tenant_id, 'plugin_test1') port1 = self.dbtest.create_port(net1['net-id']) self.dbtest.plug_interface(net1['net-id'], port1['port-id'], 'vif1.1') port = self.dbtest.get_port(net1['net-id'], port1['port-id']) self.assertTrue((port[0]['int-id'] == 'vif1.1')) ...
'test to get network and port'
def testh_joined_test(self):
net1 = self.dbtest.create_network('t1', 'net1') port1 = self.dbtest.create_port(net1['net-id']) self.assertTrue((port1['net-id'] == net1['net-id'])) port2 = self.dbtest.create_port(net1['net-id']) self.assertTrue((port2['net-id'] == net1['net-id'])) ports = self.dbtest.get_all_ports(net1['net-id...
'tearDown for Network and Port table'
def teardown_network_port(self):
networks = self.dbtest.get_all_networks(self.tenant_id) for net in networks: netid = net['net-id'] name = net['net-name'] if ('plugin_test' in name): ports = self.dbtest.get_all_ports(netid) for por in ports: self.dbtest.delete_port(netid, por['por...
'tearDown for joined Network and Port test'
def teardown_joined_test(self):
LOG.debug('Tearing Down Network and Ports') nets = self.dbtest.get_all_networks('t1') for net in nets: netid = net['net-id'] ports = self.dbtest.get_all_ports(netid) for port in ports: self.dbtest.delete_port(port['net-id'], port['port-id']) self.dbtes...
':returns: :raises:'
@abstractmethod def get_all_networks(self, tenant_id, **kwargs):
pass
':returns: :raises:'
@abstractmethod def create_network(self, tenant_id, net_name, net_id, vlan_name, vlan_id, **kwargs):
pass
':returns: :raises:'
@abstractmethod def delete_network(self, tenant_id, net_id, **kwargs):
pass
':returns: :raises:'
@abstractmethod def get_network_details(self, tenant_id, net_id, **kwargs):
pass
':returns: :raises:'
@abstractmethod def update_network(self, tenant_id, net_id, name, **kwargs):
pass
':returns: :raises:'
@abstractmethod def get_all_ports(self, tenant_id, net_id, **kwargs):
pass
':returns: :raises:'
@abstractmethod def create_port(self, tenant_id, net_id, port_state, port_id, **kwargs):
pass
':returns: :raises:'
@abstractmethod def delete_port(self, tenant_id, net_id, port_id, **kwargs):
pass
':returns: :raises:'
@abstractmethod def update_port(self, tenant_id, net_id, port_id, **kwargs):
pass
':returns: :raises:'
@abstractmethod def get_port_details(self, tenant_id, net_id, port_id, **kwargs):
pass
':returns: :raises:'
@abstractmethod def plug_interface(self, tenant_id, net_id, port_id, remote_interface_id, **kwargs):
pass
':returns: :raises:'
@abstractmethod def unplug_interface(self, tenant_id, net_id, port_id, **kwargs):
pass
':returns: :raises:'
def create_subnet(self, tenant_id, net_id, ip_version, subnet_cidr, **kwargs):
pass
':returns: :raises:'
def get_subnets(self, tenant_id, net_id, **kwargs):
pass
':returns: :raises:'
def get_subnet(self, tenant_id, net_id, subnet_id, **kwargs):
pass
':returns: :raises:'
def update_subnet(self, tenant_id, net_id, subnet_id, **kwargs):
pass
':returns: :raises:'
def delete_subnet(self, tenant_id, net_id, subnet_id, **kwargs):
pass
'The __subclasshook__ method is a class method that will be called everytime a class is tested using issubclass(klass, Plugin). In that case, it will check that every method marked with the abstractmethod decorator is provided by the plugin class.'
@classmethod def __subclasshook__(cls, klass):
if (cls is L2DevicePluginBase): for method in cls.__abstractmethods__: method_ok = False for base in klass.__mro__: if (method in base.__dict__): fn_obj = base.__dict__[method] if inspect.isfunction(fn_obj): ...
'Loads the model class.'
def __init__(self):
self._model = importutils.import_object(conf.MODEL_CLASS) if (hasattr(self._model, 'MANAGE_STATE') and self._model.MANAGE_STATE): self._master = False LOG.debug(_('Model %s manages state'), conf.MODEL_CLASS) native_bulk_attr_name = ('_%s__native_bulk_support' % self._model.__cla...
'When the configured model class offers to manage the state of the logical resources, we delegate the core API calls directly to it. Note: Bulking calls will be handled by this class, and turned into non-bulking calls to be considered for delegation.'
def __getattribute__(self, name):
master = object.__getattribute__(self, '_master') methods = object.__getattribute__(self, '_methods_to_delegate') if ((not master) and (name in methods)): return getattr(object.__getattribute__(self, '_model'), name) else: return object.__getattribute__(self, name)
'This delegates the calls to the extensions explicitly implemented by the model.'
def __getattr__(self, name):
if hasattr(self._model, name): return getattr(self._model, name) else: raise AttributeError(("'%s' object has no attribute '%s'" % (self._model, name)))
'Creates a new Virtual Network, and assigns it a symbolic name.'
def create_network(self, context, network):
LOG.debug(_('create_network() called')) new_network = super(PluginV2, self).create_network(context, network) try: self._invoke_device_plugins(self._func_name(), [context, new_network]) return new_network except: super(PluginV2, self).delete_network(context, new_network['id']) ...
'Updates the symbolic name belonging to a particular Virtual Network.'
def update_network(self, context, id, network):
LOG.debug(_('update_network() called')) upd_net_dict = super(PluginV2, self).update_network(context, id, network) self._invoke_device_plugins(self._func_name(), [context, id, upd_net_dict]) return upd_net_dict
'Deletes the network with the specified network identifier belonging to the specified tenant.'
def delete_network(self, context, id):
LOG.debug(_('delete_network() called')) with context.session.begin(): network = self._get_network(context, id) filter = {'network_id': [id]} ports = self.get_ports(context, filters=filter) prefix = db_base_plugin_v2.AGENT_OWNER_PREFIX only_svc = all((p['device_owner']....
'Gets a particular network'
def get_network(self, context, id, fields=None):
LOG.debug(_('get_network() called')) return super(PluginV2, self).get_network(context, id, fields)
'Gets all networks'
def get_networks(self, context, filters=None, fields=None):
LOG.debug(_('get_networks() called')) return super(PluginV2, self).get_networks(context, filters, fields)
'Creates a port on the specified Virtual Network.'
def create_port(self, context, port):
LOG.debug(_('create_port() called')) new_port = super(PluginV2, self).create_port(context, port) try: self._invoke_device_plugins(self._func_name(), [context, new_port]) return new_port except: super(PluginV2, self).delete_port(context, new_port['id']) raise
'Deletes a port'
def delete_port(self, context, id):
LOG.debug(_('delete_port() called')) port = self._get_port(context, id) "\n TODO (Sumit): Disabling this check for now, check later\n #Allow deleting a port only if the administrative state is...
'Updates the state of a port and returns the updated port'
def update_port(self, context, id, port):
LOG.debug(_('update_port() called')) try: self._invoke_device_plugins(self._func_name(), [context, id, port]) return super(PluginV2, self).update_port(context, id, port) except: raise
'Create a subnet, which represents a range of IP addresses that can be allocated to devices.'
def create_subnet(self, context, subnet):
LOG.debug(_('create_subnet() called')) new_subnet = super(PluginV2, self).create_subnet(context, subnet) try: self._invoke_device_plugins(self._func_name(), [context, new_subnet]) return new_subnet except: super(PluginV2, self).delete_subnet(context, new_subnet['id']) ...
'Updates the state of a subnet and returns the updated subnet'
def update_subnet(self, context, id, subnet):
LOG.debug(_('update_subnet() called')) try: self._invoke_device_plugins(self._func_name(), [context, id, subnet]) return super(PluginV2, self).update_subnet(context, id, subnet) except: raise
'Deletes a subnet'
def delete_subnet(self, context, id):
LOG.debug(_('delete_subnet() called')) with context.session.begin(): subnet = self._get_subnet(context, id) allocated_qry = context.session.query(models_v2.IPAllocation) allocated_qry = allocated_qry.options(orm.joinedload('ports')) allocated = allocated_qry.filter_by(subnet_i...
'Get all QoS levels'
def get_all_qoss(self, tenant_id):
LOG.debug(_('get_all_qoss() called')) qoslist = cdb.get_all_qoss(tenant_id) return qoslist
'Get QoS Details'
def get_qos_details(self, tenant_id, qos_id):
LOG.debug(_('get_qos_details() called')) try: qos_level = cdb.get_qos(tenant_id, qos_id) except Exception: raise cexc.QosNotFound(tenant_id=tenant_id, qos_id=qos_id) return qos_level
'Create a QoS level'
def create_qos(self, tenant_id, qos_name, qos_desc):
LOG.debug(_('create_qos() called')) qos = cdb.add_qos(tenant_id, qos_name, str(qos_desc)) return qos
'Delete a QoS level'
def delete_qos(self, tenant_id, qos_id):
LOG.debug(_('delete_qos() called')) try: qos_level = cdb.get_qos(tenant_id, qos_id) except Exception: raise cexc.QosNotFound(tenant_id=tenant_id, qos_id=qos_id) return cdb.remove_qos(tenant_id, qos_id)
'Rename QoS level'
def rename_qos(self, tenant_id, qos_id, new_name):
LOG.debug(_('rename_qos() called')) try: qos_level = cdb.get_qos(tenant_id, qos_id) except Exception: raise cexc.QosNotFound(tenant_id=tenant_id, qos_id=qos_id) qos = cdb.update_qos(tenant_id, qos_id, new_name) return qos
'Get all credentials'
def get_all_credentials(self, tenant_id):
LOG.debug(_('get_all_credentials() called')) credential_list = cdb.get_all_credentials(tenant_id) return credential_list
'Get a particular credential'
def get_credential_details(self, tenant_id, credential_id):
LOG.debug(_('get_credential_details() called')) try: credential = cdb.get_credential(tenant_id, credential_id) except Exception: raise cexc.CredentialNotFound(tenant_id=tenant_id, credential_id=credential_id) return credential
'Create a new credential'
def create_credential(self, tenant_id, credential_name, user_name, password):
LOG.debug(_('create_credential() called')) credential = cdb.add_credential(tenant_id, credential_name, user_name, password) return credential
'Delete a credential'
def delete_credential(self, tenant_id, credential_id):
LOG.debug(_('delete_credential() called')) try: credential = cdb.get_credential(tenant_id, credential_id) except Exception: raise cexc.CredentialNotFound(tenant_id=tenant_id, credential_id=credential_id) credential = cdb.remove_credential(tenant_id, credential_id) return credentia...
'Rename the particular credential resource'
def rename_credential(self, tenant_id, credential_id, new_name):
LOG.debug(_('rename_credential() called')) try: credential = cdb.get_credential(tenant_id, credential_id) except Exception: raise cexc.CredentialNotFound(tenant_id=tenant_id, credential_id=credential_id) credential = cdb.update_credential(tenant_id, credential_id, new_name) return...
'Provides the hostname on which a dynamic vnic is reserved'
def schedule_host(self, tenant_id, instance_id, instance_desc):
LOG.debug(_('schedule_host() called')) host_list = self._invoke_device_plugins(self._func_name(), [tenant_id, instance_id, instance_desc]) return host_list
'Get the portprofile name and the device name for the dynamic vnic'
def associate_port(self, tenant_id, instance_id, instance_desc):
LOG.debug(_('associate_port() called')) return self._invoke_device_plugins(self._func_name(), [tenant_id, instance_id, instance_desc])