Exemplo n.º 1
0
def create_routed_outside(fv_tenant, routed_outside_name, **args):
    """Create a Routed Outside policy"""
    args = args['optional_args'] if 'optional_args' in args.keys() else args
    l3ext_out = Out(fv_tenant, routed_outside_name)
    if 'private_network' in args.keys():
        l3ext_rsectx = RsEctx(l3ext_out, tnFvCtxName=args['private_network'])
    if 'bgp' in args.keys() and args['bgp']:
        bgp_extp = bgpExtP(l3ext_out)
    if 'ospf' in args.keys() and args['ospf']:
        ospf_extp = ospfExtP(l3ext_out, areaId='0.0.0.' + str(get_value(args, 'ospf_area_id', '1')))
    if 'tags' in args.keys() and is_valid(args['tags']):
        tag_inst = Inst(l3ext_out, args['tags'])
    return l3ext_out
Exemplo n.º 2
0
def create_routed_outside(modir, tenant_name, routed_outside_name, **args):
    fv_tenant = check_if_tenant_exist(modir, tenant_name)
    args = args["args_from_CLI"] if "args_from_CLI" in args.keys() else args
    l3ext_out = Out(fv_tenant, routed_outside_name)
    if "tnFvCtxName" in args.keys():
        l3ext_rsectx = RsEctx(l3ext_out, tnFvCtxName=args["tnFvCtxName"])
    if "BGP" in args.keys() and args["BGP"]:
        bgp_extp = bgpExtP(l3ext_out)
    if "OSPF" in args.keys() and args["OSPF"]:
        print get_value(args, "areaId", "1")
        ospf_extp = ospfExtP(l3ext_out, areaId="0.0.0." + str(get_value(args, "areaId", "1")))
    if "tags" in args.keys() and args["tags"] != "":
        tag_inst = Inst(l3ext_out, args["tags"])

    print_query_xml(fv_tenant)
    commit_change(modir, fv_tenant)
Exemplo n.º 3
0
def create_routed_outside(modir, tenant_name, routed_outside_name, **args):
    fv_tenant = check_if_tenant_exist(modir, tenant_name)
    args = args['args_from_CLI'] if 'args_from_CLI' in args.keys() else args
    l3ext_out = Out(fv_tenant, routed_outside_name)
    if 'tnFvCtxName' in args.keys():
        l3ext_rsectx = RsEctx(l3ext_out, tnFvCtxName=args['tnFvCtxName'])
    if 'BGP' in args.keys() and args['BGP']:
        bgp_extp = bgpExtP(l3ext_out)
    if 'OSPF' in args.keys() and args['OSPF']:
        ospf_extp = ospfExtP(l3ext_out,
                             areaId='0.0.0.' + get_value(args, 'areaId', '1'))
    if 'tags' in args.keys() and args['tags'] != '':
        tag_inst = Inst(l3ext_out, args['tags'])

    print_query_xml(fv_tenant)
    commit_change(modir, fv_tenant)