Beispiel #1
0
def AddFlags(arg_parser):
    """Handle command line flags unique to this script.

  Args:
    arg_parser: object from argparse.ArgumentParser() to accumulate flags.
  """
    common_flags.DefineAppsDomainFlagWithDefault(arg_parser)
    common_flags.DefineForceFlagWithDefaultFalse(arg_parser)
    common_flags.DefineVerboseFlagWithDefaultFalse(arg_parser)

    arg_parser.add_argument('--output_file',
                            '-o',
                            default=_REPORT_USERS_FILE_NAME,
                            help='Supply a name for the output report file.',
                            type=validators.NoWhitespaceValidatorType())
    arg_parser.add_argument('--query_filter',
                            help='Optionally filter on a field.',
                            type=validators.NoWhitespaceValidatorType())
    arg_parser.add_argument('--csv_fields',
                            help='List of fields to emit to csv.',
                            type=validators.ListValidatorType())
    arg_parser.add_argument('--first_n',
                            type=int,
                            default=0,
                            help='Show the first n users in the list.')
Beispiel #2
0
def AddFlags(arg_parser):
  """Handle command line flags unique to this script.

  Args:
    arg_parser: object from argparse.ArgumentParser() to accumulate flags.
  """
  common_flags.DefineAppsDomainFlagWithDefault(arg_parser)
  common_flags.DefineForceFlagWithDefaultFalse(arg_parser)
  common_flags.DefineVerboseFlagWithDefaultFalse(arg_parser)

  arg_parser.add_argument('--create_state_report_csv', action='store_true',
                          default=False,
                          help=('Output user email addresses and profile state '
                                'to a csv file.'))
  arg_parser.add_argument('--first_n', type=int, default=0,
                          help='Gather profile status for the first n users.')
  arg_parser.add_argument('--resume', '-r', action='store_true', default=False,
                          help=('Resume if interrupted while gathering '
                                'profiles.'))
  arg_parser.add_argument('--show_users', '-u', action='store_true',
                          default=False,
                          help='Show list of users who are missing profiles.')
  arg_parser.add_argument('--use_local_profile_data', action='store_true',
                          default=False,
                          help='Use local, previously-retrieved profile data.')
Beispiel #3
0
def AddFlags(arg_parser):
    """Handle command line flags unique to this script.

  Args:
    arg_parser: object from argparse.ArgumentParser() to accumulate flags.
  """
    common_flags.DefineAppsDomainFlagWithDefault(arg_parser, required=True)
    common_flags.DefineForceFlagWithDefaultFalse(arg_parser)
    common_flags.DefineVerboseFlagWithDefaultFalse(arg_parser)
def AddFlags(arg_parser):
    """Handle command line flags unique to this script.

  Args:
    arg_parser: object from argparse.ArgumentParser() to accumulate flags.
  """
    common_flags.DefineAppsDomainFlagWithDefault(arg_parser)
    common_flags.DefineForceFlagWithDefaultFalse(arg_parser)
    common_flags.DefineVerboseFlagWithDefaultFalse(arg_parser)

    arg_parser.add_argument('--csv',
                            action='store_true',
                            default=False,
                            help='Output results to a csv file.')
def AddFlags(arg_parser):
  """Handle command line flags unique to this script.

  Args:
    arg_parser: object from argparse.ArgumentParser() to accumulate flags.
  """
  common_flags.DefineAppsDomainFlagWithDefault(arg_parser)
  common_flags.DefineForceFlagWithDefaultFalse(arg_parser, required=True)
  common_flags.DefineVerboseFlagWithDefaultFalse(arg_parser)

  arg_parser.add_argument(
      '--user_email', '-u', required=True,
      help='User email address [REQUIRED].',
      type=validators.EmailValidatorType())
def AddFlags(arg_parser):
  """Handle command line flags unique to this script.

  Args:
    arg_parser: object from argparse.ArgumentParser() to accumulate flags.
  """
  common_flags.DefineAppsDomainFlagWithDefault(arg_parser)
  common_flags.DefineForceFlagWithDefaultFalse(arg_parser)
  common_flags.DefineVerboseFlagWithDefaultFalse(arg_parser)

  arg_parser.add_argument('--first_n', type=int, default=0,
                          help=('Gather tokens for the first n users in the '
                                'domain.'))
  arg_parser.add_argument('--resume', '-r', action='store_true', default=False,
                          help='Resume an interrupted gather command.')
Beispiel #7
0
def AddFlags(arg_parser):
    """Handle command line flags unique to this script.

  Args:
    arg_parser: object from argparse.ArgumentParser() to accumulate flags.
  """
    common_flags.DefineAppsDomainFlagWithDefault(arg_parser)
    common_flags.DefineForceFlagWithDefaultFalse(arg_parser)
    common_flags.DefineVerboseFlagWithDefaultFalse(arg_parser)

    arg_parser.add_argument('--json',
                            action='store_true',
                            default=False,
                            help='Output results to a json file.')
    arg_parser.add_argument('--first_n',
                            type=int,
                            default=0,
                            help='Show the first n users in the list.')
def AddFlags(arg_parser):
    """Handle command line flags unique to this script.

  Args:
    arg_parser: object from argparse.ArgumentParser() to accumulate flags.
  """
    common_flags.DefineAppsDomainFlagWithDefault(arg_parser)
    common_flags.DefineForceFlagWithDefaultFalse(
        arg_parser,
        required=True,
        help_string=(
            'This is a destructive command. Please confirm your intent '
            'to irreversibly revoke tokens by adding --force.'))
    common_flags.DefineVerboseFlagWithDefaultFalse(arg_parser)

    blacklist_help = (
        'Name of a text file under ./working/<domain> that lists '
        'unapproved %ss one to a line.\n  (suggested: %s).')
    arg_parser.add_argument('--client_blacklist_file',
                            '-c',
                            default=None,
                            help=blacklist_help %
                            ('client', _CLIENT_BLACKLIST_FILE_NAME),
                            type=validators.NoWhitespaceValidatorType())
    arg_parser.add_argument('--scope_blacklist_file',
                            '-s',
                            default=None,
                            help=blacklist_help %
                            ('scope', _SCOPE_BLACKLIST_FILE_NAME),
                            type=validators.NoWhitespaceValidatorType())
    arg_parser.add_argument(
        '--hide_timing',
        action='store_true',
        default=False,
        help='Stop logging the elapsed time of longer functions.')
    arg_parser.add_argument('--use_local_token_stats',
                            action='store_true',
                            default=False,
                            help='Avoid regenerating token stats.')
    arg_parser.add_argument('--use_local_users_list',
                            action='store_true',
                            default=False,
                            help='Avoid regenerating domain users list.')
Beispiel #9
0
def AddFlags(arg_parser):
  """Handle command line flags unique to this script.

  Args:
    arg_parser: object from argparse.ArgumentParser() to accumulate flags.
  """
  common_flags.DefineAppsDomainFlagWithDefault(arg_parser)
  common_flags.DefineForceFlagWithDefaultFalse(arg_parser)
  common_flags.DefineVerboseFlagWithDefaultFalse(arg_parser)

  arg_parser.add_argument('--console', action='store_true', default=True,
                          help='Print output on console.')
  arg_parser.add_argument('--csv', action='store_true', default=False,
                          help='Output results to a csv file.')
  arg_parser.add_argument('--long_list', '-l', action='store_true',
                          default=False,
                          help='Show details of client_ids and scopes.')
  arg_parser.add_argument('--show_users', '-u', action='store_true',
                          default=False,
                          help='Show details of users (enables --long_list).')
  arg_parser.add_argument('--top_n', type=int, default=0,
                          help='Show top n elements in each report.')