示例#1
0
 def Args(parser):
     """Register flags for this command."""
     parser.add_argument('sink_name', help='The name for the sink.')
     parser.add_argument('destination',
                         help='The destination for the sink.')
     parser.add_argument(
         '--log-filter',
         required=False,
         help=('A filter expression for the sink. If present, the filter '
               'specifies which log entries to export.'))
     parser.add_argument(
         '--output-version-format',
         required=False,
         help=
         ('DEPRECATED. Format of the log entries being exported. Detailed '
          'information: '
          'https://cloud.google.com/logging/docs/api/introduction_v2'),
         choices=('V1', 'V2'),
         default='V1')
     parser.add_argument(
         '--unique-writer-identity',
         required=False,
         action='store_true',
         default=True,
         help=(
             'DEPRECATED. Whether to create a new writer identity for this '
             'sink. Only available for v2 sinks.'))
     util.AddNonProjectArgs(parser, 'Create a sink')
示例#2
0
 def Args(parser):
     """Register flags for this command."""
     base.PAGE_SIZE_FLAG.RemoveFromParser(parser)
     base.URI_FLAG.RemoveFromParser(parser)
     util.AddNonProjectArgs(parser, 'List sinks')
     parser.display_info.AddFormat('table(name, destination, filter)')
     parser.display_info.AddCacheUpdater(None)
示例#3
0
 def Args(parser):
     """Register flags for this command."""
     parser.add_argument('sink_name',
                         help='The name of the sink to update.')
     parser.add_argument(
         'destination',
         nargs='?',
         help=(
             'A new destination for the sink. '
             'If omitted, the sink\'s existing destination is unchanged.'))
     parser.add_argument(
         '--log-filter',
         required=False,
         help=(
             'A new filter expression for the sink. '
             'If omitted, the sink\'s existing filter (if any) is unchanged.'
         ))
     parser.add_argument(
         '--output-version-format',
         required=False,
         help=('DEPRECATED. Format of the log entries being exported. '
               'Detailed information: '
               'https://cloud.google.com/logging/docs/api/introduction_v2'),
         choices=('V2', ))
     util.AddNonProjectArgs(parser, 'Update a sink')
示例#4
0
文件: read.py 项目: Akiho-Yasuda/wip
 def Args(parser):
   """Register flags for this command."""
   base.LIMIT_FLAG.AddToParser(parser)
   parser.add_argument(
       'log_filter', help=('Filter expression that specifies the '
                           'log entries to return. A detailed guide on '
                           'basic and advanced filters can be found at: '
                           'https://cloud.google.com/logging/docs/view/'
                           'overview'),
       nargs='?')
   order_arg = base.ChoiceArgument(
       '--order',
       choices=('desc', 'asc'),
       required=False,
       default='desc',
       help_str='Ordering of returned log entries based on timestamp field.'
   )
   order_arg.AddToParser(parser)
   parser.add_argument(
       '--freshness', required=False, type=arg_parsers.Duration(),
       help=('Return entries that are not older than this value. '
             'Works only with DESC ordering and filters without a timestamp. '
             'See $ gcloud topic datetimes for information on '
             'duration formats.'),
       default='1d')
   util.AddNonProjectArgs(parser, 'Read log entries')
示例#5
0
 def Args(parser):
     """Register flags for this command."""
     base.LIMIT_FLAG.AddToParser(parser)
     parser.add_argument('log_filter',
                         help=('A filter expression that specifies the '
                               'log entries to return.'),
                         nargs='?')
     order_arg = base.ChoiceArgument(
         '--order',
         choices=('desc', 'asc'),
         required=False,
         default='desc',
         help_str=
         'Ordering of returned log entries based on timestamp field.')
     order_arg.AddToParser(parser)
     parser.add_argument(
         '--freshness',
         required=False,
         type=arg_parsers.Duration(),
         help=(
             'Return entries that are not older than this value. '
             'Works only with DESC ordering and filters without a timestamp.'
         ),
         default='1d')
     util.AddNonProjectArgs(parser, 'Read log entries')
示例#6
0
 def Args(parser):
   """Register flags for this command."""
   base.PAGE_SIZE_FLAG.RemoveFromParser(parser)
   base.URI_FLAG.RemoveFromParser(parser)
   parser.add_argument(
       '--only-v2-sinks', required=False, action='store_true',
       help='Display only v2 sinks.')
   util.AddNonProjectArgs(parser, 'List sinks')
示例#7
0
 def Args(parser):
     """Register flags for this command."""
     util.AddNonProjectArgs(parser, 'List buckets')
     util.AddBucketLocationArg(
         parser, False,
         'Location from which to list buckets. By default, buckets in all '
         'locations will be listed')
     parser.display_info.AddFormat(
         'table(name, display_name, retentionDays, locked, create_time,'
         'update_time, description)')
     parser.display_info.AddCacheUpdater(None)
示例#8
0
 def Args(parser):
     """Register flags for this command."""
     parser.add_argument('sink_name', help='The name for the sink.')
     parser.add_argument('destination',
                         help='The destination for the sink.')
     parser.add_argument(
         '--log-filter',
         required=False,
         help=('A filter expression for the sink. If present, the filter '
               'specifies which log entries to export.'))
     util.AddNonProjectArgs(parser, 'Create a sink')
示例#9
0
 def Args(parser):
   """Register flags for this command."""
   parser.add_argument(
       'sink_name', help='The name of the sink to update.')
   parser.add_argument(
       'destination', nargs='?',
       help=('A new destination for the sink. '
             'If omitted, the sink\'s existing destination is unchanged.'))
   parser.add_argument(
       '--log-filter', required=False,
       help=('A new filter expression for the sink. '
             'If omitted, the sink\'s existing filter (if any) is unchanged.'))
   util.AddNonProjectArgs(parser, 'Update a sink')
示例#10
0
 def Args(parser):
   """Register flags for this command."""
   parser.add_argument(
       'sink_name', help='The name for the sink.')
   parser.add_argument(
       'destination', help='The destination for the sink.')
   parser.add_argument(
       '--log-filter', required=False,
       help=('A filter expression for the sink. If present, the filter '
             'specifies which log entries to export.'))
   parser.add_argument(
       '--include-children', required=False, action='store_true',
       help=('Whether to export logs from all child projects and folders. '
             'Only applies to sinks for organizations and folders.'))
   util.AddNonProjectArgs(parser, 'Create a sink')
示例#11
0
 def Args(parser):
     """Register flags for this command."""
     group = parser.add_mutually_exclusive_group()
     group.add_argument(
         '--log',
         help=('DEPRECATED. The name of a log. Use this argument only '
               'if the sink applies to a single log.'))
     group.add_argument(
         '--log-service',
         dest='service',
         help=('DEPRECATED. The name of a log service. Use this argument '
               'only if the sink applies to all logs from '
               'a log service.'))
     parser.add_argument('sink_name',
                         help='The name of the sink to delete.')
     util.AddNonProjectArgs(parser, 'Delete a sink')
示例#12
0
  def Args(parser):
    """Register flags for this command."""
    parser.add_argument(
        'log_name', help=('The name of the log where the log entry will '
                          'be written.'))
    parser.add_argument(
        'message', help=('The message to put in the log entry. It can be '
                         'JSON if you include --payload-type=json.'))
    parser.add_argument(
        '--payload-type',
        choices=Write.PAYLOAD_TYPE, default='text',
        help=('Type of the log entry payload.'))
    parser.add_argument(
        '--severity', required=False,
        choices=Write.SEVERITY_ENUM, default='DEFAULT',
        help='Severity level of the log entry.')

    util.AddNonProjectArgs(parser, 'Write log entries')
示例#13
0
 def Args(parser):
     """Register flags for this command."""
     base.PAGE_SIZE_FLAG.RemoveFromParser(parser)
     base.URI_FLAG.RemoveFromParser(parser)
     group = parser.add_mutually_exclusive_group()
     group.add_argument(
         '--log',
         help=('DEPRECATED. The name of a log. Use this argument only '
               'if the sink applies to a single log.'))
     group.add_argument(
         '--log-service',
         dest='service',
         help=('DEPRECATED. The name of a log service. Use this argument '
               'only if the sink applies to all logs from '
               'a log service.'))
     parser.add_argument('--only-v2-sinks',
                         required=False,
                         action='store_true',
                         help='Display only v2 sinks.')
     util.AddNonProjectArgs(parser, 'List sinks')
示例#14
0
 def Args(parser):
   """Register flags for this command."""
   parser.add_argument(
       'sink_name', help='The name of the sink to update.')
   parser.add_argument(
       'destination', nargs='?',
       help=('A new destination for the sink. '
             'If omitted, the sink\'s existing destination is unchanged.'))
   parser.add_argument(
       '--log-filter', required=False,
       help=('A new filter expression for the sink. '
             'If omitted, the sink\'s existing filter (if any) is unchanged.'))
   parser.add_argument(
       '--output-version-format', required=False,
       help=('Format of the log entries being exported. Detailed information: '
             'https://cloud.google.com/logging/docs/api/introduction_v2'),
       choices=('V1', 'V2'))
   parser.add_argument(
       '--unique-writer-identity', required=False, action='store_true',
       default=True,
       help=('Whether to create a new writer identity for this sink. Only '
             'available for project sinks.'))
   util.AddNonProjectArgs(parser, 'Update a sink')
示例#15
0
 def Args(parser):
     """Register flags for this command."""
     parser.add_argument('sink_name',
                         help='The name of the sink to delete.')
     util.AddNonProjectArgs(parser, 'Delete a sink')
     parser.display_info.AddCacheUpdater(None)
示例#16
0
 def Args(parser):
     """Register flags for this command."""
     parser.add_argument('sink_name',
                         help='The name of the sink to describe.')
     util.AddNonProjectArgs(parser, 'Describe a sink')
示例#17
0
 def Args(parser):
     """Register flags for this command."""
     parser.add_argument('BUCKET_ID',
                         help='The id of the bucket to describe.')
     util.AddNonProjectArgs(parser, 'Describe a bucket')
     util.AddBucketLocationArg(parser, True, 'Location of the bucket.')