def create_parser(subparsers): ''' :param subparsers: :return: ''' parser = subparsers.add_parser( 'restart', help='Restart a topology', usage="%(prog)s [options] cluster/[role]/[env] topology-name [container-id]", add_help=False) args.add_titles(parser) args.add_cluster_role_env(parser) args.add_topology(parser) parser.add_argument( 'container-id', nargs='?', type=int, default=-1, help='Identifier of the container to be restarted') args.add_config(parser) args.add_verbose(parser) parser.set_defaults(subcommand='restart') return parser
def create_parser(subparsers): ''' Create a subparser for the submit command :param subparsers: :return: ''' parser = subparsers.add_parser( 'submit', help='Submit a topology', usage="%(prog)s [options] cluster/[role]/[env] " + \ "topology-file-name topology-class-name [topology-args]", add_help=False ) cli_args.add_titles(parser) cli_args.add_cluster_role_env(parser) cli_args.add_topology_file(parser) cli_args.add_topology_class(parser) cli_args.add_config(parser) cli_args.add_deactive_deploy(parser) cli_args.add_system_property(parser) cli_args.add_verbose(parser) parser.set_defaults(subcommand='submit') return parser
def create_parser(subparsers): ''' :param subparsers: :return: ''' parser = subparsers.add_parser( 'restart', help='Restart a topology', usage= "%(prog)s [options] cluster/[role]/[env] topology-name [container-id]", add_help=False) args.add_titles(parser) args.add_cluster_role_env(parser) args.add_topology(parser) parser.add_argument('container-id', nargs='?', type=int, default=-1, help='Identifier of the container to be restarted') args.add_config(parser) args.add_verbose(parser) parser.set_defaults(subcommand='restart') return parser
def create_parser(subparsers): parser = subparsers.add_parser( "kill", help="Kill a topology", usage="%(prog)s [options] cluster/[role]/[env] topology-name", add_help=False ) args.add_titles(parser) args.add_cluster_role_env(parser) args.add_topology(parser) args.add_config(parser) args.add_verbose(parser) parser.set_defaults(subcommand="kill") return parser
def create_parser(subparsers): parser = subparsers.add_parser( 'deactivate', help='Deactivate a topology', usage = "%(prog)s [options] cluster/[role]/[env] topology-name", add_help = False) args.add_titles(parser) args.add_cluster_role_env(parser) args.add_topology(parser) args.add_config(parser) args.add_verbose(parser) parser.set_defaults(subcommand='deactivate') return parser
def create_parser(subparsers): parser = subparsers.add_parser( 'activate', help='Activate a topology', usage="%(prog)s [options] cluster/[role]/[env] topology-name", add_help=False) args.add_titles(parser) args.add_cluster_role_env(parser) args.add_topology(parser) args.add_config(parser) args.add_verbose(parser) parser.set_defaults(subcommand='activate') return parser
def create_parser(subparsers, action, help_arg): ''' :param subparsers: :param action: :param help_arg: :return: ''' parser = subparsers.add_parser( action, help=help_arg, usage="%(prog)s [options] cluster/[role]/[env] topology-name", add_help=False) args.add_titles(parser) args.add_cluster_role_env(parser) args.add_topology(parser) args.add_config(parser) args.add_verbose(parser) parser.set_defaults(subcommand=action) return parser