Exemplo n.º 1
0
def update_vls(nsId, vl_list, vls_ids_to_remove):
    """
    Method to update logical links on a network service when required, such as a scaling procedure
    Parameters
    ----------
    nsId: string
        Identifier of the logical link to perform the update operation
    vl_list: list of dicts
        list of vls to deploy by the mtp
    vl_ids_to_remove:
        list of vls_ids to remove
    Returns
    -------
    None
    """
    #links to add
    mtp_vl_ids = []
    if (len(vl_list["logicalLinkPathList"]) > 0):
        mtp_vl_ids = sbi.deploy_vl(vl_list, nsId)
    vl_info = []
    for i in range(0, len(mtp_vl_ids)):
        vl_info.append({mtp_vl_ids[i]: vl_list["logicalLinkPathList"][i]})
    vl_list_prev = nsir_db.get_vls(nsId)
    vl_total = vl_list_prev + vl_info
    nsir_db.save_vls(vl_total, nsId)
    #ids to remove
    for ids in vls_ids_to_remove:
        vl_info.append({"interNfviPopConnnectivityId": ids})
    sbi.uninstall_vl(vl_info, nsId)
    nsir_db.delete_vls(nsId, vls_ids_to_remove)
Exemplo n.º 2
0
def deploy_vls(vl_list, nsId):
    """
    Function description
    Parameters
    ----------
    param1: type
        param1 description
    Returns
    -------
    name: type
        return description
    """
    # save virtual links info related to nsId so it can be freed at terminate
    nsir_db.save_vls(vl_list, nsId)
    # deploy
    mtp_vl_ids = []
    for vl in vl_list:
        vlid = deploy_vl(vl)
        mtp_vl_ids.append(vlid)
    nsir_db.save_vls(mtp_vl_ids, nsId)
Exemplo n.º 3
0
def deploy_vls(vl_list, nsId):
    """
    Function description
    Parameters
    ----------
    vl_list: list of dicts
        list of vls to deploy where each element of the list is a dict with the following format:
    nsId: string
        Identifier of the logical link to perform the update operation
    Returns
    -------
    None
    """
    # deploy: you make only a single call with all the logical links for the network service
    mtp_vl_ids = []
    if (len(vl_list["logicalLinkPathList"]) > 0):
        mtp_vl_ids = sbi.deploy_vl(vl_list, nsId)
    vl_info = []
    for i in range(0, len(mtp_vl_ids)):
        vl_info.append({mtp_vl_ids[i]: vl_list["logicalLinkPathList"][i]})
    nsir_db.save_vls(vl_info, nsId)