• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python api.network_get函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中quantum.db.api.network_get函数的典型用法代码示例。如果您正苦于以下问题:Python network_get函数的具体用法?Python network_get怎么用?Python network_get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了network_get函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: delete_vifinfo

 def delete_vifinfo(self, interface_id):
     LOG.debug("delete_vifinfo() called")
     port = dbe.get_plugged_port(interface_id)
     if self._port_attachable(port):
         network = db.network_get(port.network_id)
         self._detach(network.tenant_id, network.uuid, port.uuid)
     ndb.del_vifinfo(interface_id)
开发者ID:yasuhito,项目名称:quantum-nec-of-plugin,代码行数:7,代码来源:nec_plugin.py


示例2: delete_network

    def delete_network(self, tenant_id, net_id):
        """
        Deletes the network with the specified network identifier
        belonging to the specified tenant.
        """
        LOG.debug("LinuxBridgePlugin.delete_network() called")
        net = db.network_get(net_id)
        if net:
            ports_on_net = db.port_list(net_id)
            if len(ports_on_net) > 0:
                for port in ports_on_net:
                    if port[const.INTERFACEID]:
                        raise exc.NetworkInUse(net_id=net_id)
                for port in ports_on_net:
                    self.delete_port(tenant_id, net_id, port[const.UUID])

            net_dict = cutil.make_net_dict(net[const.UUID],
                                           net[const.NETWORKNAME],
                                           [], net[const.OPSTATUS])
            try:
                self._release_vlan_for_tenant(tenant_id, net_id)
                cdb.remove_vlan_binding(net_id)
            except Exception as excp:
                LOG.warning("Exception: %s" % excp)
                db.network_update(net_id, tenant_id, {const.OPSTATUS:
                                                      OperationalStatus.DOWN})
            db.network_destroy(net_id)
            return net_dict
        # Network not found
        raise exc.NetworkNotFound(net_id=net_id)
开发者ID:CiscoSystems,项目名称:QL3Proto,代码行数:30,代码来源:LinuxBridgePlugin.py


示例3: get_network

 def get_network(self, tenant_id, network_id):
     db.validate_network_ownership(tenant_id, network_id)
     try:
         network = db.network_get(network_id)
     except:
         raise exc.NetworkNotFound(net_id=network_id)
     return network
开发者ID:mobilipia,项目名称:quantum-restproxy,代码行数:7,代码来源:plugins.py


示例4: add_vifinfo

 def add_vifinfo(self, interface_id, datapath_id, port_no, vlan_id=65535):
     LOG.debug("add_vifinfo() called")
     ndb.add_vifinfo(interface_id, datapath_id, port_no, vlan_id)
     port = dbe.get_plugged_port(interface_id)
     if self._port_attachable(port):
         network = db.network_get(port.network_id)
         self._attach(network.tenant_id, network.uuid, port.uuid,
                      interface_id)
开发者ID:yasuhito,项目名称:quantum-nec-of-plugin,代码行数:8,代码来源:nec_plugin.py


示例5: _get_network

 def _get_network(self, tenant_id, network_id):
     network = db.network_get(network_id)
     # Network must exist and belong to the appropriate tenant.
     if network.tenant_id != tenant_id:
         LOG.warning("_get_network(): mismatch tenant_id = %s, "
                     "network_id = %s, network.tenant_id = %s" %
                     (tenant_id, network_id, network.tenant_id))
         raise exc.NetworkNotFound(net_id=network_id)
     return network
开发者ID:yasuhito,项目名称:quantum-nec-of-plugin,代码行数:9,代码来源:nec_plugin.py


示例6: get_port_details

 def get_port_details(self, tenant_id, net_id, port_id):
     """
     This method allows the user to retrieve a remote interface
     that is attached to this particular port.
     """
     LOG.debug("LinuxBridgePlugin.get_port_details() called")
     network = db.network_get(net_id)
     port = db.port_get(port_id, net_id)
     new_port_dict = cutil.make_port_dict(port)
     return new_port_dict
开发者ID:CiscoSystems,项目名称:QL3Proto,代码行数:10,代码来源:LinuxBridgePlugin.py


示例7: update_port

    def update_port(self, tenant_id, net_id, port_id, **kwargs):
        """
        Updates the attributes of a port on the specified Virtual Network.
        """
        LOG.debug("LinuxBridgePlugin.update_port() called")
        network = db.network_get(net_id)
        self._validate_port_state(kwargs["state"])
        port = db.port_update(port_id, net_id, **kwargs)

        new_port_dict = cutil.make_port_dict(port)
        return new_port_dict
开发者ID:CiscoSystems,项目名称:QL3Proto,代码行数:11,代码来源:LinuxBridgePlugin.py


示例8: delete_network

    def delete_network(self, tenant_id, net_id):
        net = db.network_get(net_id)

        # Verify that no attachments are plugged into the network
        for port in db.port_list(net_id):
            if port.interface_id:
                raise q_exc.NetworkInUse(net_id=net_id)
        net = db.network_destroy(net_id)
        ovs_db.remove_vlan_binding(net_id)
        self.vmap.release(net_id)
        return self._make_net_dict(str(net.uuid), net.name, [])
开发者ID:Oneiroi,项目名称:quantum,代码行数:11,代码来源:ovs_quantum_plugin.py


示例9: delete_network

    def delete_network(self, tenant_id, net_id):
        db.validate_network_ownership(tenant_id, net_id)
        net = db.network_get(net_id)

        # Verify that no attachments are plugged into the network
        for port in db.port_list(net_id):
            if port.interface_id:
                raise q_exc.NetworkInUse(net_id=net_id)
        net = db.network_destroy(net_id)
        self.driver.delete_network(net)
        return self._make_net_dict(str(net.uuid), net.name, [], net.op_status)
开发者ID:codeoedoc,项目名称:quantum,代码行数:11,代码来源:ovs_quantum_plugin_base.py


示例10: update_network

 def update_network(self, tenant_id, net_id, **kwargs):
     """
     Updates the symbolic name belonging to a particular
     Virtual Network.
     """
     LOG.debug("UCSVICPlugin:update_network() called\n")
     self._set_ucsm(kwargs[const.DEVICE_IP])
     network = db.network_get(net_id)
     net_dict = cutil.make_net_dict(network[const.UUID],
                                    network[const.NETWORKNAME],
                                    [])
     return net_dict
开发者ID:Blackspan,项目名称:quantum,代码行数:12,代码来源:cisco_ucs_plugin_v2.py


示例11: get_network

 def get_network(self, network_id):
     """Get a network"""
     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.append(net_dict)
     except Exception, exc:
         LOG.error("Failed to get network: %s" % str(exc))
开发者ID:AnyBucket,项目名称:OpenStack-Install-and-Understand-Guide,代码行数:13,代码来源:test_database.py


示例12: plug_interface

 def plug_interface(self, tenant_id, net_id, port_id, remote_interface_id):
     """
     Attaches a remote interface to the specified port on the
     specified Virtual Network.
     """
     LOG.debug("LinuxBridgePlugin.plug_interface() called")
     network = db.network_get(net_id)
     port = db.port_get(port_id, net_id)
     attachment_id = port[const.INTERFACEID]
     if attachment_id:
         raise exc.PortInUse(port_id=port_id, net_id=net_id,
                             att_id=attachment_id)
     db.port_set_attachment(port_id, net_id, remote_interface_id)
开发者ID:CiscoSystems,项目名称:QL3Proto,代码行数:13,代码来源:LinuxBridgePlugin.py


示例13: unplug_interface

 def unplug_interface(self, tenant_id, net_id, port_id):
     """
     Detaches a remote interface from the specified port on the
     specified Virtual Network.
     """
     LOG.debug("LinuxBridgePlugin.unplug_interface() called")
     network = db.network_get(net_id)
     port = db.port_get(port_id, net_id)
     attachment_id = port[const.INTERFACEID]
     if attachment_id == None:
         raise exc.InvalidDetach(port_id=port_id, net_id=net_id,
                                 att_id=remote_interface_id)
     db.port_unset_attachment(port_id, net_id)
     db.port_update(port_id, net_id, op_status=OperationalStatus.DOWN)
开发者ID:CiscoSystems,项目名称:QL3Proto,代码行数:14,代码来源:LinuxBridgePlugin.py


示例14: get_all_ports

    def get_all_ports(self, tenant_id, net_id, **kwargs):
        """
        Retrieves all port identifiers belonging to the
        specified Virtual Network.
        """
        LOG.debug("UCSVICPlugin:get_all_ports() called\n")
        self._set_ucsm(kwargs[const.DEVICE_IP])
        network = db.network_get(net_id)
        ports_list = network[const.NETWORKPORTS]
        ports_on_net = []
        for port in ports_list:
            port_binding = udb.get_portbinding(port[const.UUID])
            ports_on_net.append(port_binding)

        return ports_on_net
开发者ID:Blackspan,项目名称:quantum,代码行数:15,代码来源:cisco_ucs_plugin_v2.py


示例15: get_all_ports

    def get_all_ports(self, tenant_id, net_id, **kwargs):
        """
        Retrieves all port identifiers belonging to the
        specified Virtual Network.
        """
        LOG.debug("LinuxBridgePlugin.get_all_ports() called")
        network = db.network_get(net_id)
        ports_list = db.port_list(net_id)
        ports_on_net = []
        for port in ports_list:
            new_port = cutil.make_port_dict(port)
            ports_on_net.append(new_port)

        # This plugin does not perform filtering at the moment
        return ports_on_net
开发者ID:CiscoSystems,项目名称:QL3Proto,代码行数:15,代码来源:LinuxBridgePlugin.py


示例16: delete_port

 def delete_port(self, tenant_id, net_id, port_id):
     """
     Deletes a port on a specified Virtual Network,
     if the port contains a remote interface attachment,
     the remote interface is first un-plugged and then the port
     is deleted.
     """
     LOG.debug("LinuxBridgePlugin.delete_port() called")
     network = db.network_get(net_id)
     port = db.port_get(port_id, net_id)
     attachment_id = port[const.INTERFACEID]
     if not attachment_id:
         db.port_destroy(port_id, net_id)
         new_port_dict = cutil.make_port_dict(port)
         return new_port_dict
     else:
         raise exc.PortInUse(port_id=port_id, net_id=net_id,
                             att_id=attachment_id)
开发者ID:CiscoSystems,项目名称:QL3Proto,代码行数:18,代码来源:LinuxBridgePlugin.py


示例17: get_network_details

    def get_network_details(self, tenant_id, net_id):
        """
        retrieved a list of all the remote vifs that
        are attached to the network
        """
        LOG.debug("LinuxBridgePlugin.get_network_details() called")
        network = db.network_get(net_id)
        ports_list = db.port_list(net_id)
        ports_on_net = []
        for port in ports_list:
            new_port = cutil.make_port_dict(port)
            ports_on_net.append(new_port)

        new_network = cutil.make_net_dict(network[const.UUID],
                                          network[const.NETWORKNAME],
                                          ports_on_net,
                                          network[const.OPSTATUS])

        return new_network
开发者ID:CiscoSystems,项目名称:QL3Proto,代码行数:19,代码来源:LinuxBridgePlugin.py


示例18: get_network_details

    def get_network_details(self, tenant_id, net_id, **kwargs):
        """
        Deletes the Virtual Network belonging to a the
        spec
        """
        LOG.debug("UCSVICPlugin:get_network_details() called\n")
        self._set_ucsm(kwargs[const.DEVICE_IP])
        network = db.network_get(net_id)
        ports_list = network[const.NETWORKPORTS]
        ports_on_net = []
        for port in ports_list:
            new_port = cutil.make_port_dict(port[const.UUID],
                                            port[const.PORTSTATE],
                                            port[const.NETWORKID],
                                            port[const.INTERFACEID])
            ports_on_net.append(new_port)

        new_network = cutil.make_net_dict(network[const.UUID],
                                          network[const.NETWORKNAME],
                                          ports_on_net)

        return new_network
开发者ID:Blackspan,项目名称:quantum,代码行数:22,代码来源:cisco_ucs_plugin_v2.py


示例19: get_network_details

 def get_network_details(self, tenant_id, net_id):
     db.validate_network_ownership(tenant_id, net_id)
     net = db.network_get(net_id)
     ports = self.get_all_ports(tenant_id, net_id)
     return self._make_net_dict(str(net.uuid), net.name,
                                ports, net.op_status)
开发者ID:jkoelker,项目名称:quantum,代码行数:6,代码来源:ovs_quantum_plugin.py


示例20: get_network_details

 def get_network_details(self, tenant_id, net_id):
     net = db.network_get(net_id)
     ports = self.get_all_ports(tenant_id, net_id)
     return self._make_net_dict(str(net.uuid), net.name, ports)
开发者ID:Oneiroi,项目名称:quantum,代码行数:4,代码来源:ovs_quantum_plugin.py



注:本文中的quantum.db.api.network_get函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python api.network_list函数代码示例发布时间:2022-05-26
下一篇:
Python api.network_create函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap