Ejemplo n.º 1
0
 def Args(parser):
   """Register flags for this command."""
   flags.AddRegionFlag(parser)
   base.LIMIT_FLAG.RemoveFromParser(parser)
   parser.add_argument(
       'name', nargs='?',
       help=('Name of the function which logs are to be displayed. If no name '
             'is specified, logs from all functions are displayed.'))
   parser.add_argument(
       '--execution-id',
       help=('Execution ID for which logs are to be displayed.'))
   parser.add_argument(
       '--start-time', required=False, type=arg_parsers.Datetime.Parse,
       help=('Return only log entries which timestamps are not earlier than '
             'the specified time. The timestamp must be in RFC3339 UTC "Zulu" '
             'format. If --start-time is specified, the command returns '
             '--limit earliest log entries which appeared after '
             '--start-time.'))
   parser.add_argument(
       '--end-time', required=False, type=arg_parsers.Datetime.Parse,
       help=('Return only log entries which timestamps are not later than '
             'the specified time. The timestamp must be in RFC3339 UTC "Zulu" '
             'format. If --end-time is specified but --start-time is not, the '
             'command returns --limit latest log entries which appeared '
             'before --end-time.'))
   parser.add_argument(
       '--limit', required=False, type=arg_parsers.BoundedInt(1, 1000),
       default=20,
       help=('Number of log entries to be fetched; must not be greater than '
             '1000.'))
   flags.AddMinLogLevelFlag(parser)
Ejemplo n.º 2
0
 def Args(parser):
   """Register flags for this command."""
   flags.AddRegionFlag(
       parser,
       help_text='Only show logs generated by functions in the region.',
   )
   base.LIMIT_FLAG.RemoveFromParser(parser)
   parser.add_argument(
       'name', nargs='?',
       help=('Name of the function which logs are to be displayed. If no name '
             'is specified, logs from all functions are displayed.'))
   parser.add_argument(
       '--execution-id',
       help=('Execution ID for which logs are to be displayed.'))
   parser.add_argument(
       '--start-time', required=False, type=arg_parsers.Datetime.Parse,
       help=('Return only log entries which timestamps are not earlier than '
             'the specified time. If *--start-time* is specified, the command '
             'returns *--limit* earliest log entries which appeared after '
             '*--start-time*. See $ gcloud topic datetimes for information '
             'on time formats.'))
   parser.add_argument(
       '--end-time', required=False, type=arg_parsers.Datetime.Parse,
       help=('Return only log entries which timestamps are not later than '
             'the specified time. If *--end-time* is specified but '
             '*--start-time* is not, the command returns *--limit* latest '
             'log entries which appeared before --end-time. See '
             '$ gcloud topic datetimes for information on time formats.'))
   parser.add_argument(
       '--limit', required=False, type=arg_parsers.BoundedInt(1, 1000),
       default=20,
       help=('Number of log entries to be fetched; must not be greater than '
             '1000.'))
   flags.AddMinLogLevelFlag(parser)
   parser.display_info.AddCacheUpdater(None)