本文整理汇总了Python中quantum.db.api.validate_port_ownership函数的典型用法代码示例。如果您正苦于以下问题:Python validate_port_ownership函数的具体用法?Python validate_port_ownership怎么用?Python validate_port_ownership使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了validate_port_ownership函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: delete_port
def delete_port(self, tenant_id, net_id, port_id):
db.validate_port_ownership(tenant_id, net_id, port_id)
port = db.port_destroy(port_id, net_id)
#delete from port_properties
neuca_db.remove_port_properties(port_id)
return self._make_port_dict(port)
开发者ID:RENCI-NRIG,项目名称:neuca-agent,代码行数:8,代码来源:neuca_quantum_plugin.py
示例2: 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
示例3: 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
示例4: 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")
db.validate_port_ownership(tenant_id, net_id, port_id)
port = db.port_get(port_id, net_id)
new_port_dict = cutil.make_port_dict(port)
return new_port_dict
开发者ID:LuizOz,项目名称:quantum,代码行数:10,代码来源:LinuxBridgePlugin.py
示例5: 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")
db.validate_port_ownership(tenant_id, net_id, port_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:LuizOz,项目名称:quantum,代码行数:11,代码来源:LinuxBridgePlugin.py
示例6: get_port
def get_port(self, tenant_id, network_id, port_id):
db.validate_port_ownership(tenant_id, network_id, port_id)
net = self.get_network(tenant_id, network_id)
try:
port = db.port_get(port_id, network_id)
except:
raise exc.PortNotFound(net_id=network_id, port_id=port_id)
# Port must exist and belong to the appropriate network.
if port['network_id'] != net['uuid']:
raise exc.PortNotFound(net_id=network_id, port_id=port_id)
return port
开发者ID:mobilipia,项目名称:quantum-restproxy,代码行数:12,代码来源:plugins.py
示例7: 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
示例8: 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")
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:
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:LuizOz,项目名称:quantum,代码行数:13,代码来源:LinuxBridgePlugin.py
示例9: plug_interface
def plug_interface(self, tenant_id, net_id, port_id, remote_iface_id):
db.validate_port_ownership(tenant_id, net_id, port_id)
db.port_set_attachment(port_id, net_id, remote_iface_id)
iface_properties = remote_iface_id.split('.')
LOG.debug("PRUTH: len(iface_properties) = %d" % (len(iface_properties)))
if len(iface_properties) >= 2 and tenant_id == self.config.get("NEUCA", "neuca_tenant_id"):
# vm_id.vm_iface
vm_id = iface_properties[0]
vm_mac = iface_properties[1]
#vm_mac = str(quantum.common.utils.generate_mac())
else:
LOG.debug("PRUTH: not enough iface properites or not neuca: len(iface_properties) = %d, %s" % (len(iface_properties),remote_iface_id))
vm_id = None
vm_mac = None
neuca_db.update_port_properties_iface(port_id, vm_id, vm_mac)
开发者ID:RENCI-NRIG,项目名称:neuca-agent,代码行数:18,代码来源:neuca_quantum_plugin.py
示例10: 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")
db.validate_port_ownership(tenant_id, net_id, port_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:LuizOz,项目名称:quantum,代码行数:18,代码来源:LinuxBridgePlugin.py
示例11: get_interface_details
def get_interface_details(self, tenant_id, net_id, port_id):
db.validate_port_ownership(tenant_id, net_id, port_id)
res = db.port_get(port_id, net_id)
return res.interface_id
开发者ID:jkoelker,项目名称:quantum,代码行数:4,代码来源:ovs_quantum_plugin.py
示例12: 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
示例13: plug_interface
def plug_interface(self, tenant_id, net_id, port_id, remote_iface_id):
db.validate_port_ownership(tenant_id, net_id, port_id)
db.port_set_attachment(port_id, net_id, remote_iface_id)
开发者ID:jkoelker,项目名称:quantum,代码行数:3,代码来源:ovs_quantum_plugin.py
示例14: get_port_details
def get_port_details(self, tenant_id, net_id, port_id):
db.validate_port_ownership(tenant_id, net_id, port_id)
port = db.port_get(port_id, net_id)
return self._make_port_dict(port)
开发者ID:jkoelker,项目名称:quantum,代码行数:4,代码来源:ovs_quantum_plugin.py
示例15: delete_port
def delete_port(self, tenant_id, net_id, port_id):
db.validate_port_ownership(tenant_id, net_id, port_id)
port = db.port_destroy(port_id, net_id)
return self._make_port_dict(port)
开发者ID:jkoelker,项目名称:quantum,代码行数:4,代码来源:ovs_quantum_plugin.py
注:本文中的quantum.db.api.validate_port_ownership函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论