Exemple #1
0
def get(config, output_format, poids):
    """ get an object from peeringdb """
    pdb = client.PeeringDB()
    codec = munge.get_codec(output_format)()

    for poid in poids:
        res = parse_objid(poid)
        data = pdb.get(res[0], res[1])
        codec.dump(data, sys.stdout)
Exemple #2
0
def get(config, depth, output_format, poids):
    """ get an object from peeringdb """
    pdb = client.PeeringDB(conf_dir=config)
    codec = munge.get_codec(output_format)()

    for poid in poids:
        (typ, pk) = util.split_ref(poid)
        data = pdb.get(typ, pk, depth=depth)
        codec.dump(data, sys.stdout)
Exemple #3
0
def get(config, depth, output_format, poids):
    """ get an object from peeringdb """
    pdb = client.PeeringDB(conf_dir=config)
    codec = munge.get_codec(output_format)()

    for poid in poids:
        (typ, pk) = util.split_ref(poid)
        data = pdb.get(typ, pk, depth=depth)
        codec.dump(data, sys.stdout)
Exemple #4
0
def try_dump_obj(args):
    res = parse_objid(args.cmd)
    if not res:
        return False

    pdb = client.PeeringDB()
    data = pdb.get(res[0], res[1])
    codec = munge.get_codec(args.output_format)()
    codec.dump(data, sys.stdout)
    return True
Exemple #5
0
def conf_dump(config, output_format):
    """ output current config """
    cfg = peeringdb.config.get_config(config)
    codec = munge.get_codec(output_format)()
    codec.dump(cfg, sys.stdout)
    return 0
Exemple #6
0
def conf_dump(config, output_format):
    """ output current config """
    cfg = peeringdb.config.get_config(config)
    codec = munge.get_codec(output_format)()
    codec.dump(cfg, sys.stdout)
    return 0