示例#1
0
def _get_ext_virtual_link_port(ext_v_l_port_id,
                               cp_instance_id,
                               set_resource_id=False):
    if set_resource_id:
        resource_id = uuidsentinel.ext_virtual_link_port_resource_id
    else:
        resource_id = ""

    resource_handle = objects.ResourceHandle(
        resource_id=resource_id, vim_level_resource_type="OS::Neutron::Port")

    ext_v_l_port = objects.VnfLinkPortInfo(id=ext_v_l_port_id,
                                           cp_instance_id=cp_instance_id,
                                           resource_handle=resource_handle)

    return ext_v_l_port
示例#2
0
文件: utils.py 项目: shuwenCai/tacker
    def _get_vnf_link_port_info(cp):
        vnf_link_port_info = objects.VnfLinkPortInfo()
        vnf_link_port_info.id = uuidutils.generate_uuid()

        resource_handle = objects.ResourceHandle()
        for ext_virt_link in instantiate_vnf_req.ext_virtual_links:
            for extcp in ext_virt_link.ext_cps:
                if extcp.cpd_id == cp:
                    for cpconfig in extcp.cp_config:
                        if cpconfig.link_port_id:
                            resource_handle.resource_id = \
                                cpconfig.link_port_id
                            # TODO(tpatil): This shouldn't be set here.
                            resource_handle.vim_level_resource_type = \
                                'OS::Neutron::Port'
                            break

        vnf_link_port_info.resource_handle = resource_handle

        return vnf_link_port_info