How to use the octodns.cmds.args.ArgumentParser function in octodns

To help you get started, we’ve selected a few octodns examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github github / octodns / octodns / cmds / report.py View on Github external
def main():
    parser = ArgumentParser(description=__doc__.split('\n')[1])

    parser.add_argument('--config-file', required=True,
                        help='The Manager configuration file to use')
    parser.add_argument('--zone', required=True, help='Zone to dump')
    parser.add_argument('--source', required=True, default=[], action='append',
                        help='Source(s) to pull data from')
    parser.add_argument('--num-workers', default=4,
                        help='Number of background workers')
    parser.add_argument('--timeout', default=1,
                        help='Number seconds to wait for an answer')
    parser.add_argument('server', nargs='+', help='Servers to query')

    args = parser.parse_args()

    manager = Manager(args.config_file)
github github / octodns / octodns / cmds / validate.py View on Github external
def main():
    parser = ArgumentParser(description=__doc__.split('\n')[1])

    parser.add_argument('--config-file', required=True,
                        help='The Manager configuration file to use')

    args = parser.parse_args(WARN)

    manager = Manager(args.config_file)
    manager.validate_configs()
github github / octodns / octodns / cmds / dump.py View on Github external
def main():
    parser = ArgumentParser(description=__doc__.split('\n')[1])

    parser.add_argument('--config-file', required=True,
                        help='The Manager configuration file to use')
    parser.add_argument('--output-dir', required=True,
                        help='The directory into which the results will be '
                        'written (Note: will overwrite existing files)')
    parser.add_argument('--lenient', action='store_true', default=False,
                        help='Ignore record validations and do a best effort '
                        'dump')
    parser.add_argument('--split', action='store_true', default=False,
                        help='Split the dumped zone into a YAML file per '
                        'record')
    parser.add_argument('zone', help='Zone to dump')
    parser.add_argument('source', nargs='+',
                        help='Source(s) to pull data from')
github github / octodns / octodns / cmds / sync.py View on Github external
def main():
    parser = ArgumentParser(description=__doc__.split('\n')[1])

    parser.add_argument('--config-file', required=True,
                        help='The Manager configuration file to use')
    parser.add_argument('--doit', action='store_true', default=False,
                        help='Whether to take action or just show what would '
                        'change')
    parser.add_argument('--force', action='store_true', default=False,
                        help='Acknowledge that significant changes are being '
                        'made and do them')

    parser.add_argument('zone', nargs='*', default=[],
                        help='Limit sync to the specified zone(s)')

    # --sources isn't an option here b/c filtering sources out would be super
    # dangerous since you could easily end up with an empty zone and delete
    # everything, or even just part of things when there are multiple sources
github github / octodns / octodns / cmds / compare.py View on Github external
def main():
    parser = ArgumentParser(description=__doc__.split('\n')[1])

    parser.add_argument('--config-file', required=True,
                        help='The Manager configuration file to use')
    parser.add_argument('--a', nargs='+', required=True,
                        help='First source(s) to pull data from')
    parser.add_argument('--b', nargs='+', required=True,
                        help='Second source(s) to pull data from')
    parser.add_argument('--zone', default=None, required=True,
                        help='Zone to compare')

    args = parser.parse_args()

    manager = Manager(args.config_file)
    changes = manager.compare(args.a, args.b, args.zone)
    pprint(changes)
github github / octodns / octodns / cmds / args.py View on Github external
def __init__(self, *args, **kwargs):
        super(ArgumentParser, self).__init__(*args, **kwargs)