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

Python api.port_update函数代码示例

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

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



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

示例1: update_port

 def update_port(self, tenant_id, net_id, port_id, **kwargs):
     """
     Updates the state of a port on the specified Virtual Network.
     """
     db.validate_port_ownership(tenant_id, net_id, port_id)
     port = db.port_get(port_id, net_id)
     db.port_update(port_id, net_id, **kwargs)
     return self._make_port_dict(port)
开发者ID:jkoelker,项目名称:quantum,代码行数:8,代码来源:ovs_quantum_plugin.py


示例2: unplug_interface

    def unplug_interface(self, tenant_id, net_id, port_id):
        db.validate_port_ownership(tenant_id, net_id, port_id)
        db.port_set_attachment(port_id, net_id, "")
        db.port_update(port_id, net_id, op_status=OperationalStatus.DOWN)

        #unplug in port_properties
        vm_id = None
        neuca_db.update_port_properties_iface(port_id, vm_id, None)
开发者ID:RENCI-NRIG,项目名称:neuca-agent,代码行数:8,代码来源:neuca_quantum_plugin.py


示例3: update_port

 def update_port(self, tenant_id, net_id, port_id, **kwargs):
     """
     Updates the state of a port on the specified Virtual Network.
     """
     LOG.debug("update_port() called\n")
     port = db.port_get(port_id, net_id)
     db.port_update(port_id, net_id, **kwargs)
     return self._make_port_dict(port)
开发者ID:OpenStack-Kha,项目名称:quantum,代码行数:8,代码来源:ovs_quantum_plugin.py


示例4: create_port

 def create_port(self, tenant_id, net_id, port_state=None, **kwargs):
     """
     Creates a port on the specified Virtual Network.
     """
     LOG.debug("FakePlugin.create_port() called")
     # verify net_id
     self._get_network(tenant_id, net_id)
     port = db.port_create(net_id, port_state)
     # Put operational status UP
     db.port_update(port.uuid, net_id, op_status=OperationalStatus.UP)
     port_item = {'port-id': str(port.uuid)}
     return port_item
开发者ID:AsylumCorp,项目名称:quantum,代码行数:12,代码来源:SamplePlugin.py


示例5: 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")
     db.validate_port_ownership(tenant_id, net_id, port_id)
     port = db.port_get(port_id, net_id)
     attachment_id = port[const.INTERFACEID]
     if attachment_id is None:
         return
     db.port_unset_attachment(port_id, net_id)
     db.port_update(port_id, net_id, op_status=OperationalStatus.DOWN)
开发者ID:LuizOz,项目名称:quantum,代码行数:13,代码来源:LinuxBridgePlugin.py


示例6: 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


示例7: update_port

    def update_port(self, tenant_id, net_id, port_id, **kwargs):
        """
        Updates the attributes of a specific port on the
        specified Virtual Network.

        :returns: a mapping sequence with the following signature:
                    {'port-id': uuid representing the
                                 updated port on specified quantum network
                     'port-state': update port state( UP or DOWN)
                    }
        :raises: exception.StateInvalid
        :raises: exception.PortNotFound
        """
        LOG.debug("QuantumRestProxy: update_port() called")
        self.get_network(tenant_id, net_id)
        orig_port = self.get_port(tenant_id, net_id, port_id)

        # Update DB
        port = db.port_update(port_id, net_id, **kwargs)

        # update on networl ctrl
        try:
            resource = '/tenants/%s/networks/%s/ports/%s' % (
                    tenant_id, net_id, port_id)
            data = {
                    "port": kwargs,
            }
            ret = self.servers.put(resource, data)
            if not self.servers.action_success(ret):
                raise RemoteRestError(ret[2])
        except RemoteRestError as e:
            LOG.error(
                'QuantumRestProxy: Unable to create remote port: %s' %
                e.message)
            # reset port to original state
            orig_port = dict((k.split('-')[-1], v)
                for k, v in orig_port.items())
            if 'id' in orig_port:
                orig_port.pop('id')
            db.port_update(net_id, tenant_id, **orig_port)
            raise

        return self.make_port_dict(port)
开发者ID:mobilipia,项目名称:quantum-restproxy,代码行数:43,代码来源:plugins.py


示例8: 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


示例9: 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("FakePlugin.update_port() called")
     #validate port and network ids
     self._get_network(tenant_id, net_id)
     self._get_port(tenant_id, net_id, port_id)
     port = db.port_update(port_id, net_id, **kwargs)
     port_item = {'port-id': port_id, 'port-state': port['state']}
     return port_item
开发者ID:AsylumCorp,项目名称:quantum,代码行数:11,代码来源:SamplePlugin.py


示例10: update_port

 def update_port(self, net_id, port_id, **kwargs):
     """Update a port"""
     try:
         port = db.port_update(port_id, net_id, **kwargs)
         LOG.debug("Updated port %s", port.uuid)
         port_dict = {}
         port_dict["id"] = str(port.uuid)
         port_dict["net-id"] = str(port.network_id)
         port_dict["attachment"] = port.interface_id
         port_dict["state"] = port.state
         return port_dict
     except Exception, exc:
         LOG.error("Failed to update port state: %s", str(exc))
开发者ID:Blackspan,项目名称:quantum,代码行数:13,代码来源:database_stubs.py


示例11: unplug_interface

 def unplug_interface(self, tenant_id, net_id, port_id):
     db.validate_port_ownership(tenant_id, net_id, port_id)
     db.port_set_attachment(port_id, net_id, "")
     db.port_update(port_id, net_id, op_status=OperationalStatus.DOWN)
开发者ID:jkoelker,项目名称:quantum,代码行数:4,代码来源:ovs_quantum_plugin.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python api.validate_network_ownership函数代码示例发布时间:2022-05-26
下一篇:
Python api.port_set_attachment函数代码示例发布时间: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