#!/usr/bin/python3

import argparse

import central_dop.firewall as firewall
from netops.ngcs import client


def main():
    parser = argparse.ArgumentParser(description='runs in central-dop and configures a remote node via the rest api')
    parser.add_argument('--address', type=str, nargs=1, required=True, dest='address', help='remote node api address (ip or dns name)')
    parser.add_argument('--cert', type=str, nargs=1, required=True, dest='cert', help='client cert for remote node api authentication')
    parser.add_argument('--key', type=str, nargs=1, required=True, dest='key', help='client key for remote node api authentication')
    args = parser.parse_args()
    api = client.Api(
        address=args.address[0],
        cert=(args.cert[0], args.key[0]),
    )
    firewall.configure_remote(api)


if __name__ == '__main__':
    main()
