How to use the greynoise.cli.subcommand.actors 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_actors(self):
        """Actors subcommand called."""
        args = parse_arguments(["actors"])
        assert args.func == actors
github GreyNoise-Intelligence / pygreynoise / src / greynoise / cli / parser.py View on Github external
)
    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)

    actors_parser = subparsers.add_parser("actors", help=actors.__doc__.rstrip("."))
    actors_parser.set_defaults(func=actors)

    args = parser.parse_args(argv)
    if not args.api_key:
        config = load_config()
        if not config["api_key"]:
            prog = os.path.basename(sys.argv[0])
            print(
                "Error: API key not found.\n\n"
                "To fix this problem, please use any of the following methods "
                "(in order of precedence):\n"
                "- Pass it using the -k/--api-key option.\n"
                "- Set it in the GREYNOISE_API_KEY environment variable.\n"
                "- Run {!r} to save it to the configuration file.\n".format(
                    "{} setup".format(prog)
                )
            )
github GreyNoise-Intelligence / pygreynoise / src / greynoise / cli / parser.py View on Github external
"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)

    actors_parser = subparsers.add_parser("actors", help=actors.__doc__.rstrip("."))
    actors_parser.set_defaults(func=actors)

    args = parser.parse_args(argv)
    if not args.api_key:
        config = load_config()
        if not config["api_key"]:
            prog = os.path.basename(sys.argv[0])
            print(
                "Error: API key not found.\n\n"
                "To fix this problem, please use any of the following methods "
                "(in order of precedence):\n"
                "- Pass it using the -k/--api-key option.\n"
                "- Set it in the GREYNOISE_API_KEY environment variable.\n"
                "- Run {!r} to save it to the configuration file.\n".format(
                    "{} setup".format(prog)
                )