本文整理汇总了Python中quantum.plugins.cisco.common.cisco_utils.make_port_dict函数的典型用法代码示例。如果您正苦于以下问题:Python make_port_dict函数的具体用法?Python make_port_dict怎么用?Python make_port_dict使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了make_port_dict函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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.
"""
LOG.debug("update_port() called\n")
network = db.network_get(net_id)
self._invoke_device_plugins(self._func_name(), [tenant_id, net_id, port_id, kwargs])
self._validate_port_state(kwargs["state"])
db.port_update(port_id, net_id, **kwargs)
new_port_dict = cutil.make_port_dict(port_id, kwargs["state"], net_id, None)
return new_port_dict
开发者ID:wendy-king,项目名称:x7_venv,代码行数:12,代码来源:l2network_plugin.py
示例2: 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("get_port_details() called\n")
network = db.network_get(net_id)
self._invoke_device_plugins(self._func_name(), [tenant_id, net_id, port_id])
port = db.port_get(net_id, port_id)
new_port_dict = cutil.make_port_dict(
port[const.UUID], port[const.PORTSTATE], port[const.NETWORKID], port[const.INTERFACEID]
)
return new_port_dict
开发者ID:wendy-king,项目名称:x7_venv,代码行数:13,代码来源:l2network_plugin.py
示例3: create_port
def create_port(self, tenant_id, net_id, port_state=None, **kwargs):
"""
Creates a port on the specified Virtual Network.
"""
LOG.debug("create_port() called\n")
port = db.port_create(net_id, port_state)
unique_port_id_string = port[const.UUID]
self._invoke_device_plugins(self._func_name(), [tenant_id, net_id, port_state, unique_port_id_string])
new_port_dict = cutil.make_port_dict(
port[const.UUID], port[const.PORTSTATE], port[const.NETWORKID], port[const.INTERFACEID]
)
return new_port_dict
开发者ID:wendy-king,项目名称:x7_venv,代码行数:13,代码来源:l2network_plugin.py
示例4: get_all_ports
def get_all_ports(self, tenant_id, net_id):
"""
Retrieves all port identifiers belonging to the
specified Virtual Network.
"""
LOG.debug("get_all_ports() called\n")
network = db.network_get(net_id)
self._invoke_device_plugins(self._func_name(), [tenant_id, 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)
return ports_on_net
开发者ID:wendy-king,项目名称:x7_venv,代码行数:17,代码来源:l2network_plugin.py
示例5: 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 should first be un-plugged and
then the port can be deleted.
"""
LOG.debug("delete_port() called\n")
network = db.network_get(net_id)
port = db.port_get(net_id, port_id)
attachment_id = port[const.INTERFACEID]
if not attachment_id:
self._invoke_device_plugins(self._func_name(), [tenant_id, net_id, port_id])
db.port_destroy(net_id, port_id)
new_port_dict = cutil.make_port_dict(port_id, None, None, None)
return new_port_dict
else:
raise exc.PortInUse(port_id=port_id, net_id=net_id, att_id=attachment_id)
开发者ID:wendy-king,项目名称:x7_venv,代码行数:18,代码来源:l2network_plugin.py
示例6: get_network_details
def get_network_details(self, tenant_id, net_id):
"""
Gets the details of a particular network
"""
LOG.debug("get_network_details() called\n")
network = db.network_get(net_id)
self._invoke_device_plugins(self._func_name(), [tenant_id, 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:wendy-king,项目名称:x7_venv,代码行数:18,代码来源:l2network_plugin.py
示例7: 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:nitishb,项目名称:quantum,代码行数:19,代码来源:cisco_ucs_plugin.py
注:本文中的quantum.plugins.cisco.common.cisco_utils.make_port_dict函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论