示例#1
0
文件: restart.py 项目: TPNguyen/heron
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
示例#2
0
文件: submit.py 项目: TPNguyen/heron
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
示例#3
0
文件: submit.py 项目: BanzaiMan/heron
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
示例#4
0
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
示例#5
0
文件: kill.py 项目: XBurnerAir/heron
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
示例#6
0
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
示例#7
0
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
示例#8
0
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
示例#9
0
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