How to use the greynoise.cli.subcommand.context function in greynoise

To help you get started, we’ve selected a few greynoise 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 GreyNoise-Intelligence / pygreynoise / tests / cli / test_parser.py View on Github external
def test_context(self):
        """Context subcommand called."""
        args = parse_arguments(["context", "0.0.0.0"])
        assert args.func == context
github GreyNoise-Intelligence / pygreynoise / src / greynoise / cli / parser.py View on Github external
setup_parser = subparsers.add_parser("setup", help=setup.__doc__.rstrip("."))
    setup_parser.add_argument(
        "-k", "--api-key", required=True, help="Key to include in API requests"
    )
    setup_parser.set_defaults(func=setup)

    noise_parser = subparsers.add_parser("noise", help=noise.__doc__.rstrip("."))
    noise_parser.add_argument(
        "-d",
        "--date",
        type=date_parameter,
        help="Date to use as filter (format: YYYY-MM-DD)",
    )
    noise_parser.set_defaults(func=noise)

    context_parser = subparsers.add_parser("context", help=context.__doc__.rstrip("."))
    context_parser.add_argument(
        "ip_address", type=ip_address_parameter, help="IP address"
    )
    context_parser.set_defaults(func=context)

    quick_check_parser = subparsers.add_parser(
        "quick_check", help=quick_check.__doc__.rstrip(".")
    )
    quick_check_parser.add_argument(
        "ip_address", type=ip_address_parameter, help="IP address"
    )
    quick_check_parser.set_defaults(func=quick_check)

    multi_quick_check_parser = subparsers.add_parser(
        "multi_quick_check", help=multi_quick_check.__doc__.rstrip(".")
    )
github GreyNoise-Intelligence / pygreynoise / src / greynoise / cli / parser.py View on Github external
setup_parser.set_defaults(func=setup)

    noise_parser = subparsers.add_parser("noise", help=noise.__doc__.rstrip("."))
    noise_parser.add_argument(
        "-d",
        "--date",
        type=date_parameter,
        help="Date to use as filter (format: YYYY-MM-DD)",
    )
    noise_parser.set_defaults(func=noise)

    context_parser = subparsers.add_parser("context", help=context.__doc__.rstrip("."))
    context_parser.add_argument(
        "ip_address", type=ip_address_parameter, help="IP address"
    )
    context_parser.set_defaults(func=context)

    quick_check_parser = subparsers.add_parser(
        "quick_check", help=quick_check.__doc__.rstrip(".")
    )
    quick_check_parser.add_argument(
        "ip_address", type=ip_address_parameter, help="IP address"
    )
    quick_check_parser.set_defaults(func=quick_check)

    multi_quick_check_parser = subparsers.add_parser(
        "multi_quick_check", help=multi_quick_check.__doc__.rstrip(".")
    )
    multi_quick_check_parser.add_argument(
        "ip_address", type=ip_address_parameter, nargs="+", help="IP address"
    )
    multi_quick_check_parser.set_defaults(func=multi_quick_check)