Пример #1
0
def step_impl(context):
    context.o0331 = ListVRF(vrf_lst=list())

    context.o0331.vrf_lst.append(
        VRF(vrf_name="default",
            vrf_id=NOT_SET,
            vrf_type=NOT_SET,
            l3_vni=NOT_SET,
            rd=NOT_SET,
            rt_imp=NOT_SET,
            rt_exp=NOT_SET,
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))

    context.o0331.vrf_lst.append(
        VRF(vrf_name='CUSTOMER_001',
            vrf_id='1',
            vrf_type=NOT_SET,
            l3_vni=NOT_SET,
            rd='65123:123',
            rt_imp=NOT_SET,
            rt_exp=NOT_SET,
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))

    context.o0331.vrf_lst.append(
        VRF(vrf_name='CUSTOMER_002',
            vrf_id='2',
            vrf_type=NOT_SET,
            l3_vni=NOT_SET,
            rd='65123:123',
            rt_imp='65222:2',
            rt_exp='65222:1',
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))
Пример #2
0
def step_impl(context):
    context.o0405 = ListVRF(vrf_lst=list())

    context.o0405.vrf_lst.append(
        VRF(vrf_name="EXTERNAL_PEERING",
            vrf_id=NOT_SET,
            vrf_type="Regular",
            l3_vni=NOT_SET,
            rd="65000:100",
            rt_imp="65000:1",
            rt_exp="65000:1",
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))

    context.o0405.vrf_lst.append(
        VRF(vrf_name="MGMT_VRF",
            vrf_id=NOT_SET,
            vrf_type="Regular",
            l3_vni=NOT_SET,
            rd=NOT_SET,
            rt_imp=NOT_SET,
            rt_exp=NOT_SET,
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))

    context.o0405.vrf_lst.append(
        VRF(vrf_name="INTERNAL_PEERING",
            vrf_id=NOT_SET,
            vrf_type="Regular",
            l3_vni=NOT_SET,
            rd="65000:200",
            rt_imp="65000:2",
            rt_exp="65000:2",
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))
Пример #3
0
def step_impl(context):
    context.o0301 = ListVRF(vrf_lst=list())

    context.o0301.vrf_lst.append(
        VRF(vrf_name="default",
            vrf_id="0",
            vrf_type=NOT_SET,
            l3_vni=NOT_SET,
            rd=NOT_SET,
            rt_imp=NOT_SET,
            rt_exp=NOT_SET,
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))

    context.o0301.vrf_lst.append(
        VRF(vrf_name="MGMT_VRF",
            vrf_id="1",
            vrf_type=NOT_SET,
            l3_vni=NOT_SET,
            rd='65000:999',
            rt_imp='65100:9',
            rt_exp='65100:9',
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))

    context.o0301.vrf_lst.append(
        VRF(vrf_name="SECURE_ZONE",
            vrf_id="2",
            vrf_type=NOT_SET,
            l3_vni=NOT_SET,
            rd=NOT_SET,
            rt_imp=NOT_SET,
            rt_exp=NOT_SET,
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))
Пример #4
0
def step_impl(context):
    context.o0001 = ListVRF(vrf_lst=list())

    context.o0001.vrf_lst.append(
        VRF(vrf_name="default",
            vrf_id=NOT_SET,
            vrf_type=NOT_SET,
            l3_vni=NOT_SET,
            rd=NOT_SET,
            rt_imp=NOT_SET,
            rt_exp=NOT_SET,
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))

    context.o0001.vrf_lst.append(
        VRF(vrf_name="CUSTOMER_NETESTS",
            vrf_id=NOT_SET,
            vrf_type=NOT_SET,
            l3_vni=NOT_SET,
            rd=NOT_SET,
            rt_imp=NOT_SET,
            rt_exp=NOT_SET,
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))

    context.o0001.vrf_lst.append(
        VRF(vrf_name="CUSTOMER_WEJOB",
            vrf_id=NOT_SET,
            vrf_type=NOT_SET,
            l3_vni=NOT_SET,
            rd="1111:11",
            rt_imp=NOT_SET,
            rt_exp=NOT_SET,
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))
Пример #5
0
def step_impl(context):
    context.o0201 = ListVRF(vrf_lst=list())

    context.o0201.vrf_lst.append(
        VRF(vrf_name="GlobalRouter",
            vrf_id="0",
            vrf_type=NOT_SET,
            l3_vni=NOT_SET,
            rd=NOT_SET,
            rt_imp=NOT_SET,
            rt_exp=NOT_SET,
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))

    context.o0201.vrf_lst.append(
        VRF(vrf_name="mgmt_vrf",
            vrf_id="1",
            vrf_type=NOT_SET,
            l3_vni=NOT_SET,
            rd=NOT_SET,
            rt_imp=NOT_SET,
            rt_exp=NOT_SET,
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))

    context.o0201.vrf_lst.append(
        VRF(vrf_name="MgmtRouter",
            vrf_id="512",
            vrf_type=NOT_SET,
            l3_vni=NOT_SET,
            rd=NOT_SET,
            rt_imp=NOT_SET,
            rt_exp=NOT_SET,
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))
Пример #6
0
def step_impl(context):
    context.o0501 = ListVRF(vrf_lst=list())

    context.o0501.vrf_lst.append(
        VRF(vrf_name="default",
            vrf_id="100.123.1.0",
            vrf_type="forwarding",
            l3_vni=NOT_SET,
            rd=NOT_SET,
            rt_imp=NOT_SET,
            rt_exp=NOT_SET,
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))

    context.o0501.vrf_lst.append(
        VRF(vrf_name="CUSTOMER_001",
            vrf_id="7.7.7.7",
            vrf_type="vrf",
            l3_vni=NOT_SET,
            rd="65333:333",
            rt_imp="__vrf-import-CUSTOMER_001-internal__",
            rt_exp="__vrf-export-CUSTOMER_001-internal__",
            imp_targ="65333:333",
            exp_targ="65333:333"))

    context.o0501.vrf_lst.append(
        VRF(vrf_name="mgmt_junos",
            vrf_id="0.0.0.0",
            vrf_type="forwarding",
            l3_vni=NOT_SET,
            rd=NOT_SET,
            rt_imp=NOT_SET,
            rt_exp=NOT_SET,
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))
Пример #7
0
def _ios_vrf_ssh_converter(hostname: str(), cmd_output, options={}) -> ListVRF:
    cmd_output = re.sub(pattern=r"communities[\n\r]\s+RT",
                        repl="communities:RT",
                        string=cmd_output)

    if verbose_mode(user_value=os.environ.get("NETESTS_VERBOSE", NSET),
                    needed_value=LEVEL4):
        printline()
        print(cmd_output)

    template = open(f"{TEXTFSM_PATH}cisco_ios_show_ip_vrf_detail.textfsm")
    results_template = textfsm.TextFSM(template)
    # Example : [
    #   ['mgmt', '1', '<not set>'],
    #   ['tenant-1', '2', '10.255.255.103:103']
    # ]
    parsed_results = results_template.ParseText(cmd_output)

    vrf_list = ListVRF(list())
    # Add the default VRF maually
    vrf_list.vrf_lst.append(
        VRF(vrf_name="default",
            vrf_id="0",
            vrf_type=NSET,
            l3_vni=NSET,
            rd=NSET,
            rt_imp=NSET,
            rt_exp=NSET,
            exp_targ=NSET,
            imp_targ=NSET,
            options=options))

    for l in parsed_results:
        vrf_list.vrf_lst.append(
            VRF(vrf_name=l[0] if l[0] != "<not set>" and l[0] != '' else NSET,
                vrf_id=l[1] if l[1] != "<not set>" and l[1] != '' else NSET,
                vrf_type=NSET,
                l3_vni=NSET,
                rd=l[2] if l[2] != "<not set>" and l[2] != '' else NSET,
                rt_imp=l[5] if l[5] != "<not set>" and l[5] != '' else NSET,
                rt_exp=l[6] if l[6] != "<not set>" and l[6] != '' else NSET,
                exp_targ=NSET,
                imp_targ=NSET,
                options=options))

    if verbose_mode(user_value=os.environ.get("NETESTS_VERBOSE", NSET),
                    needed_value=LEVEL1):
        printline()
        print(f">>>>> {hostname}")
        PP.pprint(vrf_list.to_json())

    return vrf_list
Пример #8
0
def _nxos_vrf_ssh_converter(
    hostname: str(),
    cmd_output,
    options={}
) -> ListVRF:
    vrf_list = ListVRF(list())
    for vrf in cmd_output.get('TABLE_vrf', NOT_SET).get('ROW_vrf'):
        vrf_list.vrf_lst.append(
            VRF(
                vrf_name=vrf.get('vrf_name', NOT_SET),
                vrf_id=vrf.get('vrf_id', NOT_SET),
                vrf_type=NOT_SET,
                l3_vni=NOT_SET,
                rd=vrf.get('rd') if vrf.get('rd') != '0:0' else NOT_SET,
                rt_imp=NOT_SET,
                rt_exp=NOT_SET,
                imp_targ=NOT_SET,
                exp_targ=NOT_SET,
                options=options
            )
        )

    if verbose_mode(
        user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
        needed_value=LEVEL1
    ):
        printline()
        print(f">>>>> {hostname}")
        PP.pprint(vrf_list.to_json())

    return vrf_list
Пример #9
0
def _cumulus_vrf_api_converter(hostname: str(), cmd_output) -> ListVRF:
    template = open(
        f"{TEXTFSM_PATH}cumulus_net_show_vrf.textfsm"
    )
    results_template = textfsm.TextFSM(template)
    parsed_results = results_template.ParseText(cmd_output.decode())

    list_vrf = ListVRF(list())

    if verbose_mode(
        user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
        needed_value=LEVEL3
    ):
        printline()
        print(parsed_results)

    for line in parsed_results:
        vrf = VRF(
            vrf_name=line[0],
            vrf_id=line[1]
        )

        list_vrf.vrf_lst.append(vrf)

    if verbose_mode(
        user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
        needed_value=LEVEL1
    ):
        printline()
        print(list_vrf)

    return list_vrf
Пример #10
0
def _juniper_vrf_api_converter(hostname: str,
                               cmd_output: list,
                               options={}) -> ListVRF:
    if verbose_mode(user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
                    needed_value=LEVEL5):
        printline()
        print(type(cmd_output))
        print(cmd_output)

    cmd_output = format_xml_output(cmd_output)

    if verbose_mode(user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
                    needed_value=LEVEL4):
        printline()
        print(type(cmd_output))
        PP.pprint(cmd_output)

    vrf_list = ListVRF(vrf_lst=list())

    for vrf in cmd_output.get('instance-information') \
            .get('instance-core'):
        if _juniper_vrf_filter(vrf.get('instance-name')):
            rd = NOT_SET,
            rt_imp = NOT_SET
            rt_exp = NOT_SET
            imp_targ = NOT_SET
            exp_targ = NOT_SET
            if "instance-vrf" in vrf.keys():
                rd = vrf.get('instance-vrf') \
                        .get('route-distinguisher', NOT_SET)
                rt_imp = vrf.get('instance-vrf') \
                            .get('vrf-import', NOT_SET)
                rt_exp = vrf.get('instance-vrf') \
                            .get('vrf-export', NOT_SET)
                imp_targ = vrf.get('instance-vrf') \
                              .get('vrf-import-target', NOT_SET)
                exp_targ = vrf.get('instance-vrf') \
                              .get('vrf-export-target', NOT_SET)

            vrf_list.vrf_lst.append(
                VRF(vrf_name=_juniper_vrf_default_mapping(
                    vrf.get('instance-name')),
                    vrf_id=vrf.get('router-id', NOT_SET),
                    vrf_type=vrf.get('instance-type', NOT_SET),
                    l3_vni=NOT_SET,
                    rd=rd,
                    rt_imp=rt_imp,
                    rt_exp=rt_exp,
                    imp_targ=imp_targ,
                    exp_targ=exp_targ,
                    options=options))

    if verbose_mode(user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
                    needed_value=LEVEL1):
        printline()
        print(f">>>>> {hostname}")
        PP.pprint(vrf_list.to_json())

    return vrf_list
Пример #11
0
def step_impl(context):
    context.o0701 = ListVRF(vrf_lst=list())

    context.o0701.vrf_lst.append(
        VRF(vrf_name="CUSTOMER_001",
            vrf_id="4",
            vrf_type=NOT_SET,
            l3_vni="1000",
            rd=NOT_SET,
            rt_imp=NOT_SET,
            rt_exp=NOT_SET,
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))

    context.o0701.vrf_lst.append(
        VRF(vrf_name="INTERNAL_PEERING",
            vrf_id="3",
            vrf_type=NOT_SET,
            l3_vni=NOT_SET,
            rd='65432:222',
            rt_imp='65432:22',
            rt_exp='65432:22',
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))

    context.o0701.vrf_lst.append(
        VRF(vrf_name="management",
            vrf_id="2",
            vrf_type=NOT_SET,
            l3_vni=NOT_SET,
            rd=NOT_SET,
            rt_imp=NOT_SET,
            rt_exp=NOT_SET,
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))

    context.o0701.vrf_lst.append(
        VRF(vrf_name="default",
            vrf_id="1",
            vrf_type=NOT_SET,
            l3_vni=NOT_SET,
            rd=NOT_SET,
            rt_imp=NOT_SET,
            rt_exp=NOT_SET,
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))
Пример #12
0
def _juniper_vrf_netconf_converter(hostname: str(), cmd_output,
                                   options={}) -> ListVRF:
    if isinstance(cmd_output, lxml.etree._Element):
        cmd_output = json.dumps(
            xmltodict.parse(ElementTree.tostring(cmd_output)))
    elif isinstance(cmd_output, str):
        cmd_output = json.dumps(xmltodict.parse(cmd_output))

    cmd_output = json.loads(cmd_output)

    if verbose_mode(user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
                    needed_value=LEVEL4):
        printline()
        PP.pprint(cmd_output)

    vrf_list = ListVRF(list())

    for vrf in cmd_output.get('instance-information') \
            .get('instance-core'):
        if _juniper_vrf_filter(vrf.get('instance-name')):
            rd = NOT_SET,
            rt_imp = NOT_SET
            rt_exp = NOT_SET
            imp_targ = NOT_SET
            exp_targ = NOT_SET
            if "instance-vrf" in vrf.keys():
                rd = vrf.get('instance-vrf') \
                        .get('route-distinguisher', NOT_SET)
                rt_imp = vrf.get('instance-vrf') \
                            .get('vrf-import', NOT_SET)
                rt_exp = vrf.get('instance-vrf') \
                            .get('vrf-export', NOT_SET)
                imp_targ = vrf.get('instance-vrf') \
                              .get('vrf-import-target', NOT_SET)
                exp_targ = vrf.get('instance-vrf') \
                              .get('vrf-export-target', NOT_SET)

            vrf_list.vrf_lst.append(
                VRF(vrf_name=_juniper_vrf_default_mapping(
                    vrf.get('instance-name')),
                    vrf_id=vrf.get('router-id', NOT_SET),
                    vrf_type=vrf.get('instance-type', NOT_SET),
                    l3_vni=NOT_SET,
                    rd=rd,
                    rt_imp=rt_imp,
                    rt_exp=rt_exp,
                    imp_targ=imp_targ,
                    exp_targ=exp_targ,
                    options=options))

    if verbose_mode(user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
                    needed_value=LEVEL1):
        printline()
        PP.pprint(vrf_list.to_json())

    return vrf_list
Пример #13
0
def _arista_vrf_ssh_converter(
    hostname: str(),
    cmd_output,
    options={}
) -> ListVRF:

    if not isinstance(cmd_output, dict):
        cmd_output = json.loads(cmd_output)

    if verbose_mode(
        user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
        needed_value=LEVEL3
    ):
        printline()
        print(cmd_output)

    vrf_list = ListVRF(list())
    for vrf_name, facts in cmd_output.get('vrfs').items():
        if (
            facts.get('routeDistinguisher', NOT_SET) == NOT_SET or
            facts.get('routeDistinguisher', NOT_SET) == ''
        ):
            rd = NOT_SET
        else:
            rd = facts.get('routeDistinguisher', NOT_SET)

        vrf_obj = VRF(
            vrf_name=vrf_name,
            vrf_id=NOT_SET,
            vrf_type=NOT_SET,
            l3_vni=NOT_SET,
            rd=rd,
            rt_imp=NOT_SET,
            rt_exp=NOT_SET,
            imp_targ=NOT_SET,
            exp_targ=NOT_SET,
            options=options
        )

        vrf_list.vrf_lst.append(
            vrf_obj
        )

    if verbose_mode(
        user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
        needed_value=LEVEL1
    ):
        printline()
        print(f">>>>> {hostname}")
        PP.pprint(vrf_list.to_json())

    return vrf_list
Пример #14
0
def step_impl(context):
    context.o0311 = ListVRF(vrf_lst=list())

    context.o0311.vrf_lst.append(
        VRF(vrf_name="default",
            vrf_id=NOT_SET,
            vrf_type=NOT_SET,
            l3_vni=NOT_SET,
            rd=NOT_SET,
            rt_imp=NOT_SET,
            rt_exp=NOT_SET,
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))
Пример #15
0
def step_impl(context):
    context.o0421 = ListVRF(vrf_lst=list())

    context.o0421.vrf_lst.append(
        VRF(vrf_name="CUSTOMER_NETESTS",
            vrf_id=NOT_SET,
            vrf_type=NOT_SET,
            l3_vni=NOT_SET,
            rd=NOT_SET,
            rt_imp=NOT_SET,
            rt_exp=NOT_SET,
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))
Пример #16
0
def step_impl(context):
    context.o0601 = ListVRF(vrf_lst=list())

    context.o0601.vrf_lst.append(
        VRF(vrf_name="MGMT_VRF",
            vrf_id=NOT_SET,
            vrf_type="L3VRF",
            l3_vni=NOT_SET,
            rd="65000:999",
            rt_imp=NOT_SET,
            rt_exp=NOT_SET,
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))

    context.o0601.vrf_lst.append(
        VRF(vrf_name="default",
            vrf_id=NOT_SET,
            vrf_type="DEFAULT_INSTANCE",
            l3_vni=NOT_SET,
            rd=NOT_SET,
            rt_imp=NOT_SET,
            rt_exp=NOT_SET,
            imp_targ=NOT_SET,
            exp_targ=NOT_SET))
Пример #17
0
def _cumulus_vrf_ssh_converter(
    hostname: str(),
    cmd_output,
    options={}
) -> ListVRF:
    template = open(
        f"{TEXTFSM_PATH}cumulus_net_show_vrf.textfsm"
    )
    results_template = textfsm.TextFSM(template)
    parsed_results = results_template.ParseText(cmd_output)

    vrf_list = ListVRF(list())

    if verbose_mode(
        user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
        needed_value=LEVEL3
    ):
        printline()
        print(parsed_results)

    for line in parsed_results:
        vrf = VRF(
            vrf_name=line[0],
            vrf_id=line[1],
            vrf_type=NOT_SET,
            l3_vni=NOT_SET,
            rd=NOT_SET,
            rt_imp=NOT_SET,
            rt_exp=NOT_SET,
            imp_targ=NOT_SET,
            exp_targ=NOT_SET,
            options=options
        )

        vrf_list.vrf_lst.append(vrf)

    if verbose_mode(
        user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
        needed_value=LEVEL1
    ):
        printline()
        print(f">>>>> {hostname}")
        PP.pprint(vrf_list.to_json())

    return vrf_list
Пример #18
0
def _iosxr_vrf_ssh_converter(hostname: str(), cmd_output,
                             options={}) -> ListVRF:

    cmd_output = re.sub(pattern=r"communities:[\n\r]\s+RT",
                        repl="communities:RT",
                        string=cmd_output)

    if verbose_mode(user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
                    needed_value=LEVEL4):
        printline()
        print(cmd_output)

    template = open(f"{TEXTFSM_PATH}cisco_xr_show_vrf_all_detail.textfsm")
    results_template = textfsm.TextFSM(template)
    parsed_results = results_template.ParseText(cmd_output)

    list_vrf = ListVRF(list())

    if verbose_mode(user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
                    needed_value=LEVEL3):
        printline()
        print(parsed_results)

    for l in parsed_results:
        vrf = VRF(
            vrf_name=l[0] if l[0] != "not set" and l[0] != '' else NOT_SET,
            vrf_id=NOT_SET,
            vrf_type=l[3] if l[3] != "not set" and l[3] != '' else NOT_SET,
            l3_vni=NOT_SET,
            rd=l[1] if l[1] != "not set" and l[1] != '' else NOT_SET,
            rt_imp=l[5] if l[5] != "not set" and l[5] != '' else NOT_SET,
            rt_exp=l[6] if l[6] != "not set" and l[6] != '' else NOT_SET,
            imp_targ=NOT_SET,
            exp_targ=NOT_SET,
            options=options)

        list_vrf.vrf_lst.append(vrf)

    if verbose_mode(user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
                    needed_value=LEVEL1):
        printline()
        PP.pprint(list_vrf.to_json())

    return list_vrf
Пример #19
0
def _compare_vrf(host_keys,
                 hostname: str,
                 groups: list,
                 vrf_host_data: ListVRF,
                 test=False,
                 options={},
                 task=Task) -> bool:
    verity_vrf = ListVRF(list())

    if ('own_vars' in options.keys() and options.get('own_vars') is not None
            and 'enable' in options.get('own_vars').keys()
            and options.get('own_vars').get('enable') is True):
        raise NetestsOverideTruthVarsKeyUnsupported()
    else:
        if test:
            vrf_yaml_data = open_file(
                path="tests/features/src/vrf_tests.yml").get(hostname)
        else:
            vrf_yaml_data = select_host_vars(hostname=hostname,
                                             groups=groups,
                                             protocol="vrf")

        if (VRF_DATA_KEY in host_keys and vrf_yaml_data is not None):
            if vrf_yaml_data is not None:
                for vrf in vrf_yaml_data:
                    verity_vrf.vrf_lst.append(
                        VRF(vrf_name=vrf.get('vrf_name', NOT_SET),
                            vrf_id=vrf.get('vrf_id', NOT_SET),
                            l3_vni=vrf.get('l3_vni', NOT_SET),
                            rd=vrf.get('rd', NOT_SET),
                            rt_imp=vrf.get('rt_imp', NOT_SET),
                            rt_exp=vrf.get('rt_exp', NOT_SET),
                            imp_targ=vrf.get('imp_targ', NOT_SET),
                            exp_targ=vrf.get('exp_targ', NOT_SET)))
        else:
            print(f"{HEADER} Key {VRF_DATA_KEY} is missing"
                  f"for {hostname} or no VRF data has been found.")

    if verbose_mode(user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
                    needed_value=LEVEL2):
        print(f"{HEADER} Return value for host {hostname}"
              f"is {verity_vrf == vrf_host_data}")
    return verity_vrf == vrf_host_data
Пример #20
0
def _napalm_vrf_converter(
    hostname: str(),
    cmd_output: json,
    options={}
) -> ListVRF:

    vrf_list = ListVRF(list())

    for vrf in cmd_output.get('get_network_instances'):

        vrf_list.vrf_lst.append(
            VRF(
                vrf_name=vrf,
                vrf_type=cmd_output.get('get_network_instances')
                                   .get(vrf)
                                   .get('type', NOT_SET),
                rd=cmd_output.get('get_network_instances')
                             .get(vrf)
                             .get('state')
                             .get('route_distinguisher')
                if cmd_output.get('get_network_instances')
                .get(vrf)
                .get('state')
                .get('route_distinguisher', NOT_SET)
                != "" else NOT_SET
            )
        )

    if verbose_mode(
        user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
        needed_value=LEVEL1
    ):
        printline()
        PP.pprint(vrf_list.to_json())

    return vrf_list
Пример #21
0
def _ios_vrf_api_converter(
    hostname: str(),
    cmd_output,
    options={}
) -> ListVRF:
    if verbose_mode(
        user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
        needed_value=LEVEL5
    ):
        printline()
        print(type(cmd_output))
        print(cmd_output)

    cmd_output = format_xml_output(cmd_output)

    vrf_list = ListVRF(vrf_lst=list())
    vrf_list.vrf_lst.append(
        VRF(
            vrf_name='default',
            vrf_id=NOT_SET,
            vrf_type=NOT_SET,
            l3_vni=NOT_SET,
            rd=NOT_SET,
            rt_imp=NOT_SET,
            rt_exp=NOT_SET,
            imp_targ=NOT_SET,
            exp_targ=NOT_SET,
            options=options
        )
    )

    if (
        'native' in cmd_output.keys() and
        'vrf' in cmd_output.get('native').keys() and
        'definition' in cmd_output.get('native').get('vrf').keys()
    ):
        if isinstance(cmd_output.get('native')
                                .get('vrf')
                                .get('definition'), dict):

            rt_imp = NOT_SET
            rt_exp = NOT_SET
            if 'route-target' in cmd_output.get('native') \
                                           .get('vrf') \
                                           .get('definition').keys():
                if (
                    'export' in cmd_output.get('native')
                                          .get('vrf')
                                          .get('definition')
                                          .get('route-target').keys() and
                    'asn-ip' in cmd_output.get('native')
                                          .get('vrf')
                                          .get('definition')
                                          .get('route-target')
                                          .get('export').keys()
                ):
                    rt_exp = cmd_output.get('native') \
                                       .get('vrf') \
                                       .get('definition') \
                                       .get('route-target') \
                                       .get('export') \
                                       .get('asn-ip')
                if (
                    'import' in cmd_output.get('native')
                                          .get('vrf')
                                          .get('definition')
                                          .get('route-target').keys() and
                    'asn-ip' in cmd_output.get('native')
                                          .get('vrf')
                                          .get('definition')
                                          .get('route-target')
                                          .get('import').keys()
                ):
                    rt_exp = cmd_output.get('native') \
                                       .get('vrf') \
                                       .get('definition') \
                                       .get('route-target') \
                                       .get('import') \
                                       .get('asn-ip')

            vrf_list.vrf_lst.append(
                VRF(
                    vrf_name=cmd_output.get('native')
                                       .get('vrf')
                                       .get('definition')
                                       .get('name'),
                    vrf_id=NOT_SET,
                    vrf_type=NOT_SET,
                    l3_vni=NOT_SET,
                    rd=cmd_output.get('native')
                                 .get('vrf')
                                 .get('definition')
                                 .get('rd', NOT_SET),
                    rt_imp=rt_imp,
                    rt_exp=rt_exp,
                    imp_targ=NOT_SET,
                    exp_targ=NOT_SET
                )
            )

        elif isinstance(cmd_output.get('native')
                                  .get('vrf')
                                  .get('definition'), list):
            for v in cmd_output.get('native') \
                               .get('vrf') \
                               .get('definition'):
                rt_imp = NOT_SET
                rt_exp = NOT_SET
                if 'route-target' in v.keys():
                    if (
                        'export' in v.get('route-target').keys() and
                        'asn-ip' in v.get('route-target').get('export').keys()
                    ):
                        rt_exp = v.get(
                            'route-target').get('export').get('asn-ip')
                    if (
                        'import' in v.get('route-target').keys() and
                        'asn-ip' in v.get('route-target').get('export').keys()
                    ):
                        rt_imp = v.get(
                            'route-target').get('import').get('asn-ip')

                vrf_list.vrf_lst.append(
                    VRF(
                        vrf_name=v.get('name', NOT_SET),
                        vrf_id=NOT_SET,
                        vrf_type=NOT_SET,
                        l3_vni=NOT_SET,
                        rd=v.get('rd', NOT_SET),
                        rt_imp=rt_imp,
                        rt_exp=rt_exp,
                        imp_targ=NOT_SET,
                        exp_targ=NOT_SET
                    )
                )

    if verbose_mode(
        user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
        needed_value=LEVEL1
    ):
        printline()
        print(f">>>>> {hostname}")
        PP.pprint(vrf_list.to_json())

    return vrf_list
Пример #22
0
def _juniper_vrf_ssh_converter(hostname: str(), cmd_output,
                               options={}) -> ListVRF:

    vrf_list = ListVRF(list())

    for vrf in cmd_output.get('instance-information')[0].get('instance-core'):

        if _juniper_vrf_filter(
                vrf.get('instance-name')[0].get('data', NOT_SET)):
            vrf_obj = VRF()

            vrf_obj.vrf_name = _juniper_vrf_default_mapping(
                vrf.get('instance-name')[0].get('data', NOT_SET))
            vrf_obj.vrf_id = vrf.get('router-id')[0].get('data', NOT_SET)
            vrf_obj.vrf_type = vrf.get('instance-type')[0].get('data', NOT_SET)
            vrf_obj.l3_vni = NOT_SET

            if "instance-vrf" in vrf.keys():
                vrf_obj.rd = vrf.get('instance-vrf')[0] \
                                .get('route-distinguisher')[0] \
                                .get('data', NOT_SET)
                vrf_obj.rt_imp = vrf.get('instance-vrf')[0] \
                                    .get('vrf-import')[0] \
                                    .get('data', NOT_SET)
                vrf_obj.rt_exp = vrf.get('instance-vrf')[0]\
                                    .get('vrf-export')[0] \
                                    .get('data', NOT_SET)
                vrf_obj.imp_targ = vrf.get('instance-vrf')[0] \
                                      .get('vrf-import-target')[0] \
                                      .get('data', NOT_SET)
                vrf_obj.exp_targ = vrf.get('instance-vrf')[0] \
                                      .get('vrf-export-target')[0] \
                                      .get('data', NOT_SET)

            vrf_obj.options = options

            vrf_list.vrf_lst.append(vrf_obj)

    if verbose_mode(user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
                    needed_value=LEVEL1):
        printline()
        PP.pprint(vrf_list.to_json())

    return vrf_list
Пример #23
0
def _nxos_vrf_api_converter(hostname: str(), cmd_output,
                            options={}) -> ListVRF:
    if verbose_mode(user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
                    needed_value=LEVEL5):
        printline()
        print(type(cmd_output))
        print(cmd_output)

    cmd_output = format_xml_output(cmd_output)

    if verbose_mode(user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
                    needed_value=LEVEL4):
        printline()
        print(type(cmd_output))
        PP.pprint(cmd_output)

    vrf_list = ListVRF(vrf_lst=list())

    for v in cmd_output.get('inst-items').get('Inst-list'):

        rd = NOT_SET
        rt_exp = NOT_SET
        rt_imp = NOT_SET
        if ('dom-items' in v.keys() and 'Dom-list' in v.get('dom-items')
                and 'af-items' in v.get('dom-items').get('Dom-list').keys()
                and 'DomAf-list'
                in v.get('dom-items').get('Dom-list').get('af-items').keys()
                and 'ctrl-items' in v.get('dom-items').get('Dom-list').get(
                    'af-items').get('DomAf-list').keys()
                and 'AfCtrl-list' in v.get('dom-items').get('Dom-list').get(
                    'af-items').get('DomAf-list').get('ctrl-items').keys()
                and 'rttp-items'
                in v.get('dom-items').get('Dom-list').get('af-items').get(
                    'DomAf-list').get('ctrl-items').get('AfCtrl-list').keys()
                and 'RttP-list' in v.get('dom-items').get('Dom-list').get(
                    'af-items').get('DomAf-list').get('ctrl-items').get(
                        'AfCtrl-list').get('rttp-items').keys()):
            for i in v.get('dom-items') \
                      .get('Dom-list') \
                      .get('af-items') \
                      .get('DomAf-list') \
                      .get('ctrl-items') \
                      .get('AfCtrl-list') \
                      .get('rttp-items') \
                      .get('RttP-list'):
                if i.get('type', NOT_SET) == 'export':
                    if ('ent-items' in i.keys()
                            and 'RttEntry-list' in i.get('ent-items').keys()
                            and 'rtt'
                            in i.get('ent-items').get('RttEntry-list').keys()):
                        y = i.get('ent-items') \
                             .get('RttEntry-list') \
                             .get('rtt').split(':')
                        rt_exp = f"{y[-2]}:{y[-1]}"

                if i.get('type', NOT_SET) == 'import':
                    if ('ent-items' in i.keys()
                            and 'RttEntry-list' in i.get('ent-items').keys()
                            and 'rtt'
                            in i.get('ent-items').get('RttEntry-list').keys()):
                        z = i.get('ent-items') \
                             .get('RttEntry-list') \
                             .get('rtt').split(':')
                        rt_imp = f"{z[-2]}:{z[-1]}"

        if ('dom-items' in v.keys() and 'Dom-list' in v.get('dom-items')
                and 'rd' in v.get('dom-items').get('Dom-list').keys()):
            t = v.get('dom-items') \
                 .get('Dom-list') \
                 .get('rd').split(':')
            rd = f"{t[-2]}:{t[-1]}"

        vrf_list.vrf_lst.append(
            VRF(vrf_name=v.get('name', NOT_SET),
                vrf_id=v.get('id', NOT_SET),
                vrf_type=NOT_SET,
                l3_vni=v.get('encap', NOT_SET),
                rd=rd,
                rt_imp=rt_imp,
                rt_exp=rt_exp,
                imp_targ=NOT_SET,
                exp_targ=NOT_SET,
                options=options))

    if verbose_mode(user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
                    needed_value=LEVEL1):
        printline()
        print(f">>>>> {hostname}")
        PP.pprint(vrf_list.to_json())

    return vrf_list
Пример #24
0
def _arista_vrf_netconf_converter(
    hostname: str(),
    cmd_output,
    options={}
) -> ListVRF:

    cmd_output = format_xml_output(cmd_output)

    if verbose_mode(
        user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
        needed_value=LEVEL3
    ):
        printline()
        PP.pprint(cmd_output)

    if (
        'data' in cmd_output.keys() and
        'network-instances' in cmd_output.get('data').keys() and
        'network-instance' in cmd_output.get('data')
                                        .get('network-instances')
                                        .keys()
    ):
        vrf_list = ListVRF(list())

        if isinstance(
            cmd_output.get('data')
                      .get('network-instances')
                      .get('network-instance'),
            dict
        ):

            vrf_list.vrf_lst.append(
                VRF(
                    vrf_name=cmd_output.get('data')
                                       .get('network-instances')
                                       .get('network-instance')
                                       .get('name', NOT_SET),
                    vrf_id=NOT_SET,
                    vrf_type=NOT_SET,
                    l3_vni=NOT_SET,
                    rd=NOT_SET,
                    rt_imp=NOT_SET,
                    rt_exp=NOT_SET,
                    imp_targ=NOT_SET,
                    exp_targ=NOT_SET,
                    options=options
                )
            )

        elif isinstance(
            cmd_output.get('data')
                      .get('network-instances')
                      .get('network-instance'),
            list
        ):
            for v in cmd_output.get('data') \
                               .get('network-instances') \
                               .get('network-instance'):
                vrf_list.vrf_lst.append(
                    VRF(
                        vrf_name=v.get('name', NOT_SET),
                        vrf_id=NOT_SET,
                        vrf_type=NOT_SET,
                        l3_vni=NOT_SET,
                        rd=NOT_SET,
                        rt_imp=NOT_SET,
                        rt_exp=NOT_SET,
                        imp_targ=NOT_SET,
                        exp_targ=NOT_SET,
                        options=options
                    )
                )

    if verbose_mode(
        user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
        needed_value=LEVEL1
    ):
        printline()
        print(f">>>>> {hostname}")
        PP.pprint(vrf_list.to_json())

    return vrf_list
Пример #25
0
def _iosxr_vrf_netconf_converter(
    hostname: str(),
    cmd_output,
    options={}
) -> ListVRF:
    if verbose_mode(
        user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
        needed_value=LEVEL5
    ):
        printline()
        print(type(cmd_output))
        PP.pprint(cmd_output)

    if cmd_output.get('VRF') is not None:
        cmd_output['VRF'] = format_xml_output(cmd_output.get('VRF'))
    if cmd_output.get('BGP') is not None:
        cmd_output['BGP'] = format_xml_output(cmd_output.get('BGP'))

    if verbose_mode(
        user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
        needed_value=LEVEL4
    ):
        printline()
        print(type(cmd_output))
        PP.pprint(cmd_output)

    vrf_list = ListVRF(vrf_lst=list())

    if (
        'VRF' in cmd_output.keys() and
        'data' in cmd_output.get('VRF').keys() and
        'vrfs' in cmd_output.get('VRF').get('data').keys() and
        'vrf' in cmd_output.get('VRF').get('data').get('vrfs').keys()
    ):
        if isinstance(
            cmd_output.get('VRF').get('data').get('vrfs').get('vrf'),
            dict
        ):
            rias = None
            riin = None
            reas = None
            rein = None
            v = cmd_output.get('VRF').get('data').get('vrfs').get('vrf')
            if (
                    'afs' in v.keys() and
                    'af' in v.get('afs').keys() and
                    'bgp' in v.get('afs').get('af').keys()
            ):
                rias = v.get('afs').get('af').get('bgp') \
                                             .get('import-route-targets') \
                                             .get('route-targets') \
                                             .get('route-target') \
                                             .get('as-or-four-byte-as') \
                                             .get('as')

                riin = v.get('afs').get('af').get('bgp') \
                                             .get('import-route-targets') \
                                             .get('route-targets') \
                                             .get('route-target') \
                                             .get('as-or-four-byte-as') \
                                             .get('as-index')

                reas = v.get('afs').get('af').get('bgp') \
                                             .get('export-route-targets') \
                                             .get('route-targets') \
                                             .get('route-target') \
                                             .get('as-or-four-byte-as') \
                                             .get('as')

                rein = v.get('afs').get('af').get('bgp') \
                                             .get('export-route-targets') \
                                             .get('route-targets') \
                                             .get('route-target') \
                                             .get('as-or-four-byte-as') \
                                             .get('as-index')

            rd = NOT_SET
            if (
                cmd_output.get('BGP') is not None and
                'data' in cmd_output.get('BGP').keys() and
                'bgp' in cmd_output.get('BGP')
                                .get('data').keys() and
                'instance' in cmd_output.get('BGP')
                                        .get('data')
                                        .get('bgp').keys() and
                'instance-as' in cmd_output.get('BGP')
                                        .get('data')
                                        .get('bgp')
                                        .get('instance').keys() and
                'four-byte-as' in cmd_output.get('BGP')
                                        .get('data')
                                        .get('bgp')
                                        .get('instance')
                                        .get('instance-as').keys() and
                'vrfs' in cmd_output.get('BGP')
                                    .get('data')
                                    .get('bgp')
                                    .get('instance')
                                    .get('instance-as')
                                    .get('four-byte-as').keys() and
                'vrf' in cmd_output.get('BGP')
                                    .get('data')
                                    .get('bgp')
                                    .get('instance')
                                    .get('instance-as')
                                    .get('four-byte-as')
                                    .get('vrfs').keys()
            ):
                if isinstance(cmd_output.get('BGP')
                                        .get('data')
                                        .get('bgp')
                                        .get('instance')
                                        .get('instance-as')
                                        .get('four-byte-as')
                                        .get('vrfs')
                                        .get('vrf'), dict):
                    vrf = cmd_output.get('BGP') \
                                    .get('data') \
                                    .get('bgp') \
                                    .get('instance') \
                                    .get('instance-as') \
                                    .get('four-byte-as') \
                                    .get('vrfs') \
                                    .get('vrf')
                    if vrf.get('vrf-name') == v.get('vrf-name'):
                        if (
                            'vrf-global' in vrf.keys() and
                            'route-distinguisher' in vrf.get('vrf-global')
                                                            .keys()
                        ):
                            rd = vrf.get('vrf-global') \
                                    .get('route-distinguisher') \
                                    .get('as') + ":" + \
                                vrf.get('vrf-global') \
                                    .get('route-distinguisher') \
                                    .get('as-index')

                elif isinstance(cmd_output.get('BGP')
                                          .get('data')
                                          .get('bgp')
                                          .get('instance')
                                          .get('instance-as')
                                          .get('four-byte-as')
                                          .get('vrfs')
                                          .get('vrf'), list):

                    for vrf in cmd_output.get('BGP') \
                                         .get('data') \
                                         .get('bgp') \
                                         .get('instance') \
                                         .get('instance-as') \
                                         .get('four-byte-as') \
                                         .get('vrfs') \
                                         .get('vrf'):
                        if vrf.get('vrf-name') == v.get('vrf-name'):
                            if (
                                'vrf-global' in vrf.keys() and
                                'route-distinguisher' in
                                vrf.get('vrf-global').keys()
                            ):
                                rd = vrf.get('vrf-global') \
                                        .get('route-distinguisher') \
                                        .get('as') + ":" + \
                                    vrf.get('vrf-global') \
                                        .get('route-distinguisher') \
                                        .get('as-index')
            vrf_list.vrf_lst.append(
                VRF(
                    vrf_name=v.get('vrf-name'),
                    vrf_id=NOT_SET,
                    vrf_type=NOT_SET,
                    l3_vni=NOT_SET,
                    rd=rd,
                    rt_imp=f"{rias}:{riin}" if rias is not None else NOT_SET,
                    rt_exp=f"{reas}:{rein}" if reas is not None else NOT_SET,
                    imp_targ=NOT_SET,
                    exp_targ=NOT_SET,
                    options=options
                )
            )

        elif isinstance(
            cmd_output.get('VRF').get('data').get('vrfs').get('vrf'),
            list
        ):
            for v in cmd_output.get('VRF').get('data').get('vrfs').get('vrf'):
                rias = None
                riin = None
                reas = None
                rein = None
                if (
                    'afs' in v.keys() and 'af' in v.get('afs').keys() and
                    'bgp' in v.get('afs').get('af').keys()
                ):
                    rias = v.get('afs').get('af').get('bgp') \
                                                 .get('import-route-targets') \
                                                 .get('route-targets') \
                                                 .get('route-target') \
                                                 .get('as-or-four-byte-as') \
                                                 .get('as')

                    riin = v.get('afs').get('af').get('bgp') \
                                                 .get('import-route-targets') \
                                                 .get('route-targets') \
                                                 .get('route-target') \
                                                 .get('as-or-four-byte-as') \
                                                 .get('as-index')

                    reas = v.get('afs').get('af').get('bgp') \
                                                 .get('export-route-targets') \
                                                 .get('route-targets') \
                                                 .get('route-target') \
                                                 .get('as-or-four-byte-as') \
                                                 .get('as')

                    rein = v.get('afs').get('af').get('bgp') \
                                                 .get('export-route-targets') \
                                                 .get('route-targets') \
                                                 .get('route-target') \
                                                 .get('as-or-four-byte-as') \
                                                 .get('as-index')

                rd = NOT_SET
                if (
                    cmd_output.get('BGP') is not None and
                    'data' in cmd_output.get('BGP').keys() and
                    'bgp' in cmd_output.get('BGP')
                                    .get('data').keys() and
                    'instance' in cmd_output.get('BGP')
                                            .get('data')
                                            .get('bgp').keys() and
                    'instance-as' in cmd_output.get('BGP')
                                            .get('data')
                                            .get('bgp')
                                            .get('instance').keys() and
                    'four-byte-as' in cmd_output.get('BGP')
                                            .get('data')
                                            .get('bgp')
                                            .get('instance')
                                            .get('instance-as').keys() and
                    'vrfs' in cmd_output.get('BGP')
                                        .get('data')
                                        .get('bgp')
                                        .get('instance')
                                        .get('instance-as')
                                        .get('four-byte-as').keys() and
                    'vrf' in cmd_output.get('BGP')
                                        .get('data')
                                        .get('bgp')
                                        .get('instance')
                                        .get('instance-as')
                                        .get('four-byte-as')
                                        .get('vrfs').keys()
                ):
                    if isinstance(cmd_output.get('BGP')
                                            .get('data')
                                            .get('bgp')
                                            .get('instance')
                                            .get('instance-as')
                                            .get('four-byte-as')
                                            .get('vrfs')
                                            .get('vrf'), dict):
                        vrf = cmd_output.get('BGP') \
                                        .get('data') \
                                        .get('bgp') \
                                        .get('instance') \
                                        .get('instance-as') \
                                        .get('four-byte-as') \
                                        .get('vrfs') \
                                        .get('vrf')
                        if vrf.get('vrf-name') == v.get('vrf-name'):
                            if (
                                'vrf-global' in vrf.keys() and
                                'route-distinguisher' in vrf.get('vrf-global')
                                                                .keys()
                            ):
                                rd = vrf.get('vrf-global') \
                                        .get('route-distinguisher') \
                                        .get('as') + ":" + \
                                    vrf.get('vrf-global') \
                                        .get('route-distinguisher') \
                                        .get('as-index')

                    elif isinstance(cmd_output.get('BGP')
                                              .get('data')
                                              .get('bgp')
                                              .get('instance')
                                              .get('instance-as')
                                              .get('four-byte-as')
                                              .get('vrfs')
                                              .get('vrf'), list):

                        for vrf in cmd_output.get('BGP') \
                                             .get('data') \
                                             .get('bgp') \
                                             .get('instance') \
                                             .get('instance-as') \
                                             .get('four-byte-as') \
                                             .get('vrfs') \
                                             .get('vrf'):
                            if vrf.get('vrf-name') == v.get('vrf-name'):
                                if (
                                    'vrf-global' in vrf.keys() and
                                    'route-distinguisher' in
                                    vrf.get('vrf-global').keys()
                                ):
                                    rd = vrf.get('vrf-global') \
                                            .get('route-distinguisher') \
                                            .get('as') + ":" + \
                                        vrf.get('vrf-global') \
                                            .get('route-distinguisher') \
                                            .get('as-index')

                vrf_list.vrf_lst.append(
                    VRF(
                        vrf_name=v.get('vrf-name'),
                        vrf_id=NOT_SET,
                        vrf_type=NOT_SET,
                        l3_vni=NOT_SET,
                        rd=rd,
                        rt_imp=f"{rias}:{riin}"
                                    if rias is not None else NOT_SET,
                        rt_exp=f"{reas}:{rein}"
                                    if reas is not None else NOT_SET,
                        imp_targ=NOT_SET,
                        exp_targ=NOT_SET,
                        options=options
                    )
                )

    if verbose_mode(
        user_value=os.environ.get("NETESTS_VERBOSE", NOT_SET),
        needed_value=LEVEL1
    ):
        printline()
        print(f">>>>> {hostname}")
        PP.pprint(vrf_list.to_json())

    return vrf_list