google-cloud-logging 3.13.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. google/cloud/logging/__init__.py +53 -0
  2. google/cloud/logging/gapic_version.py +16 -0
  3. google/cloud/logging/handlers/__init__.py +31 -0
  4. google/cloud/logging/handlers/middleware/__init__.py +17 -0
  5. google/cloud/logging/handlers/transports/__init__.py +28 -0
  6. google/cloud/logging/py.typed +2 -0
  7. google/cloud/logging_v2/__init__.py +61 -0
  8. google/cloud/logging_v2/_gapic.py +647 -0
  9. google/cloud/logging_v2/_helpers.py +152 -0
  10. google/cloud/logging_v2/_http.py +549 -0
  11. google/cloud/logging_v2/_instrumentation.py +92 -0
  12. google/cloud/logging_v2/client.py +429 -0
  13. google/cloud/logging_v2/entries.py +358 -0
  14. google/cloud/logging_v2/gapic_metadata.json +481 -0
  15. google/cloud/logging_v2/gapic_version.py +16 -0
  16. google/cloud/logging_v2/handlers/__init__.py +31 -0
  17. google/cloud/logging_v2/handlers/_helpers.py +283 -0
  18. google/cloud/logging_v2/handlers/_monitored_resources.py +303 -0
  19. google/cloud/logging_v2/handlers/app_engine.py +139 -0
  20. google/cloud/logging_v2/handlers/container_engine.py +62 -0
  21. google/cloud/logging_v2/handlers/handlers.py +340 -0
  22. google/cloud/logging_v2/handlers/middleware/__init__.py +17 -0
  23. google/cloud/logging_v2/handlers/middleware/request.py +52 -0
  24. google/cloud/logging_v2/handlers/structured_log.py +150 -0
  25. google/cloud/logging_v2/handlers/transports/__init__.py +29 -0
  26. google/cloud/logging_v2/handlers/transports/background_thread.py +343 -0
  27. google/cloud/logging_v2/handlers/transports/base.py +61 -0
  28. google/cloud/logging_v2/handlers/transports/sync.py +68 -0
  29. google/cloud/logging_v2/logger.py +541 -0
  30. google/cloud/logging_v2/metric.py +180 -0
  31. google/cloud/logging_v2/py.typed +2 -0
  32. google/cloud/logging_v2/resource.py +51 -0
  33. google/cloud/logging_v2/services/__init__.py +15 -0
  34. google/cloud/logging_v2/services/config_service_v2/__init__.py +22 -0
  35. google/cloud/logging_v2/services/config_service_v2/async_client.py +4232 -0
  36. google/cloud/logging_v2/services/config_service_v2/client.py +4686 -0
  37. google/cloud/logging_v2/services/config_service_v2/pagers.py +820 -0
  38. google/cloud/logging_v2/services/config_service_v2/transports/__init__.py +33 -0
  39. google/cloud/logging_v2/services/config_service_v2/transports/base.py +748 -0
  40. google/cloud/logging_v2/services/config_service_v2/transports/grpc.py +1345 -0
  41. google/cloud/logging_v2/services/config_service_v2/transports/grpc_asyncio.py +1660 -0
  42. google/cloud/logging_v2/services/logging_service_v2/__init__.py +22 -0
  43. google/cloud/logging_v2/services/logging_service_v2/async_client.py +1272 -0
  44. google/cloud/logging_v2/services/logging_service_v2/client.py +1686 -0
  45. google/cloud/logging_v2/services/logging_service_v2/pagers.py +516 -0
  46. google/cloud/logging_v2/services/logging_service_v2/transports/__init__.py +33 -0
  47. google/cloud/logging_v2/services/logging_service_v2/transports/base.py +361 -0
  48. google/cloud/logging_v2/services/logging_service_v2/transports/grpc.py +566 -0
  49. google/cloud/logging_v2/services/logging_service_v2/transports/grpc_asyncio.py +703 -0
  50. google/cloud/logging_v2/services/metrics_service_v2/__init__.py +22 -0
  51. google/cloud/logging_v2/services/metrics_service_v2/async_client.py +1119 -0
  52. google/cloud/logging_v2/services/metrics_service_v2/client.py +1534 -0
  53. google/cloud/logging_v2/services/metrics_service_v2/pagers.py +196 -0
  54. google/cloud/logging_v2/services/metrics_service_v2/transports/__init__.py +33 -0
  55. google/cloud/logging_v2/services/metrics_service_v2/transports/base.py +320 -0
  56. google/cloud/logging_v2/services/metrics_service_v2/transports/grpc.py +520 -0
  57. google/cloud/logging_v2/services/metrics_service_v2/transports/grpc_asyncio.py +629 -0
  58. google/cloud/logging_v2/sink.py +233 -0
  59. google/cloud/logging_v2/types/__init__.py +178 -0
  60. google/cloud/logging_v2/types/log_entry.py +435 -0
  61. google/cloud/logging_v2/types/logging.py +602 -0
  62. google/cloud/logging_v2/types/logging_config.py +2418 -0
  63. google/cloud/logging_v2/types/logging_metrics.py +412 -0
  64. google_cloud_logging-3.13.0.dist-info/METADATA +143 -0
  65. google_cloud_logging-3.13.0.dist-info/RECORD +68 -0
  66. google_cloud_logging-3.13.0.dist-info/WHEEL +5 -0
  67. google_cloud_logging-3.13.0.dist-info/licenses/LICENSE +202 -0
  68. google_cloud_logging-3.13.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,2418 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2025 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ from __future__ import annotations
17
+
18
+ from typing import MutableMapping, MutableSequence
19
+
20
+ import proto # type: ignore
21
+
22
+ from google.protobuf import field_mask_pb2 # type: ignore
23
+ from google.protobuf import timestamp_pb2 # type: ignore
24
+
25
+
26
+ __protobuf__ = proto.module(
27
+ package="google.logging.v2",
28
+ manifest={
29
+ "OperationState",
30
+ "LifecycleState",
31
+ "IndexType",
32
+ "IndexConfig",
33
+ "LogBucket",
34
+ "LogView",
35
+ "LogSink",
36
+ "BigQueryDataset",
37
+ "Link",
38
+ "BigQueryOptions",
39
+ "ListBucketsRequest",
40
+ "ListBucketsResponse",
41
+ "CreateBucketRequest",
42
+ "UpdateBucketRequest",
43
+ "GetBucketRequest",
44
+ "DeleteBucketRequest",
45
+ "UndeleteBucketRequest",
46
+ "ListViewsRequest",
47
+ "ListViewsResponse",
48
+ "CreateViewRequest",
49
+ "UpdateViewRequest",
50
+ "GetViewRequest",
51
+ "DeleteViewRequest",
52
+ "ListSinksRequest",
53
+ "ListSinksResponse",
54
+ "GetSinkRequest",
55
+ "CreateSinkRequest",
56
+ "UpdateSinkRequest",
57
+ "DeleteSinkRequest",
58
+ "CreateLinkRequest",
59
+ "DeleteLinkRequest",
60
+ "ListLinksRequest",
61
+ "ListLinksResponse",
62
+ "GetLinkRequest",
63
+ "LogExclusion",
64
+ "ListExclusionsRequest",
65
+ "ListExclusionsResponse",
66
+ "GetExclusionRequest",
67
+ "CreateExclusionRequest",
68
+ "UpdateExclusionRequest",
69
+ "DeleteExclusionRequest",
70
+ "GetCmekSettingsRequest",
71
+ "UpdateCmekSettingsRequest",
72
+ "CmekSettings",
73
+ "GetSettingsRequest",
74
+ "UpdateSettingsRequest",
75
+ "Settings",
76
+ "CopyLogEntriesRequest",
77
+ "CopyLogEntriesMetadata",
78
+ "CopyLogEntriesResponse",
79
+ "BucketMetadata",
80
+ "LinkMetadata",
81
+ "LocationMetadata",
82
+ },
83
+ )
84
+
85
+
86
+ class OperationState(proto.Enum):
87
+ r"""List of different operation states.
88
+ High level state of the operation. This is used to report the
89
+ job's current state to the user. Once a long running operation
90
+ is created, the current state of the operation can be queried
91
+ even before the operation is finished and the final result is
92
+ available.
93
+
94
+ Values:
95
+ OPERATION_STATE_UNSPECIFIED (0):
96
+ Should not be used.
97
+ OPERATION_STATE_SCHEDULED (1):
98
+ The operation is scheduled.
99
+ OPERATION_STATE_WAITING_FOR_PERMISSIONS (2):
100
+ Waiting for necessary permissions.
101
+ OPERATION_STATE_RUNNING (3):
102
+ The operation is running.
103
+ OPERATION_STATE_SUCCEEDED (4):
104
+ The operation was completed successfully.
105
+ OPERATION_STATE_FAILED (5):
106
+ The operation failed.
107
+ OPERATION_STATE_CANCELLED (6):
108
+ The operation was cancelled by the user.
109
+ """
110
+ OPERATION_STATE_UNSPECIFIED = 0
111
+ OPERATION_STATE_SCHEDULED = 1
112
+ OPERATION_STATE_WAITING_FOR_PERMISSIONS = 2
113
+ OPERATION_STATE_RUNNING = 3
114
+ OPERATION_STATE_SUCCEEDED = 4
115
+ OPERATION_STATE_FAILED = 5
116
+ OPERATION_STATE_CANCELLED = 6
117
+
118
+
119
+ class LifecycleState(proto.Enum):
120
+ r"""LogBucket lifecycle states.
121
+
122
+ Values:
123
+ LIFECYCLE_STATE_UNSPECIFIED (0):
124
+ Unspecified state. This is only used/useful
125
+ for distinguishing unset values.
126
+ ACTIVE (1):
127
+ The normal and active state.
128
+ DELETE_REQUESTED (2):
129
+ The resource has been marked for deletion by
130
+ the user. For some resources (e.g. buckets),
131
+ this can be reversed by an un-delete operation.
132
+ UPDATING (3):
133
+ The resource has been marked for an update by
134
+ the user. It will remain in this state until the
135
+ update is complete.
136
+ CREATING (4):
137
+ The resource has been marked for creation by
138
+ the user. It will remain in this state until the
139
+ creation is complete.
140
+ FAILED (5):
141
+ The resource is in an INTERNAL error state.
142
+ """
143
+ LIFECYCLE_STATE_UNSPECIFIED = 0
144
+ ACTIVE = 1
145
+ DELETE_REQUESTED = 2
146
+ UPDATING = 3
147
+ CREATING = 4
148
+ FAILED = 5
149
+
150
+
151
+ class IndexType(proto.Enum):
152
+ r"""IndexType is used for custom indexing. It describes the type
153
+ of an indexed field.
154
+
155
+ Values:
156
+ INDEX_TYPE_UNSPECIFIED (0):
157
+ The index's type is unspecified.
158
+ INDEX_TYPE_STRING (1):
159
+ The index is a string-type index.
160
+ INDEX_TYPE_INTEGER (2):
161
+ The index is a integer-type index.
162
+ """
163
+ INDEX_TYPE_UNSPECIFIED = 0
164
+ INDEX_TYPE_STRING = 1
165
+ INDEX_TYPE_INTEGER = 2
166
+
167
+
168
+ class IndexConfig(proto.Message):
169
+ r"""Configuration for an indexed field.
170
+
171
+ Attributes:
172
+ field_path (str):
173
+ Required. The LogEntry field path to index.
174
+
175
+ Note that some paths are automatically indexed, and other
176
+ paths are not eligible for indexing. See `indexing
177
+ documentation <https://cloud.google.com/logging/docs/view/advanced-queries#indexed-fields>`__
178
+ for details.
179
+
180
+ For example: ``jsonPayload.request.status``
181
+ type_ (google.cloud.logging_v2.types.IndexType):
182
+ Required. The type of data in this index.
183
+ create_time (google.protobuf.timestamp_pb2.Timestamp):
184
+ Output only. The timestamp when the index was
185
+ last modified.
186
+ This is used to return the timestamp, and will
187
+ be ignored if supplied during update.
188
+ """
189
+
190
+ field_path: str = proto.Field(
191
+ proto.STRING,
192
+ number=1,
193
+ )
194
+ type_: "IndexType" = proto.Field(
195
+ proto.ENUM,
196
+ number=2,
197
+ enum="IndexType",
198
+ )
199
+ create_time: timestamp_pb2.Timestamp = proto.Field(
200
+ proto.MESSAGE,
201
+ number=3,
202
+ message=timestamp_pb2.Timestamp,
203
+ )
204
+
205
+
206
+ class LogBucket(proto.Message):
207
+ r"""Describes a repository in which log entries are stored.
208
+
209
+ Attributes:
210
+ name (str):
211
+ Output only. The resource name of the bucket.
212
+
213
+ For example:
214
+
215
+ ``projects/my-project/locations/global/buckets/my-bucket``
216
+
217
+ For a list of supported locations, see `Supported
218
+ Regions <https://cloud.google.com/logging/docs/region-support>`__
219
+
220
+ For the location of ``global`` it is unspecified where log
221
+ entries are actually stored.
222
+
223
+ After a bucket has been created, the location cannot be
224
+ changed.
225
+ description (str):
226
+ Describes this bucket.
227
+ create_time (google.protobuf.timestamp_pb2.Timestamp):
228
+ Output only. The creation timestamp of the
229
+ bucket. This is not set for any of the default
230
+ buckets.
231
+ update_time (google.protobuf.timestamp_pb2.Timestamp):
232
+ Output only. The last update timestamp of the
233
+ bucket.
234
+ retention_days (int):
235
+ Logs will be retained by default for this
236
+ amount of time, after which they will
237
+ automatically be deleted. The minimum retention
238
+ period is 1 day. If this value is set to zero at
239
+ bucket creation time, the default time of 30
240
+ days will be used.
241
+ locked (bool):
242
+ Whether the bucket is locked.
243
+
244
+ The retention period on a locked bucket cannot
245
+ be changed. Locked buckets may only be deleted
246
+ if they are empty.
247
+ lifecycle_state (google.cloud.logging_v2.types.LifecycleState):
248
+ Output only. The bucket lifecycle state.
249
+ analytics_enabled (bool):
250
+ Whether log analytics is enabled for this
251
+ bucket.
252
+ Once enabled, log analytics features cannot be
253
+ disabled.
254
+ restricted_fields (MutableSequence[str]):
255
+ Log entry field paths that are denied access in this bucket.
256
+
257
+ The following fields and their children are eligible:
258
+ ``textPayload``, ``jsonPayload``, ``protoPayload``,
259
+ ``httpRequest``, ``labels``, ``sourceLocation``.
260
+
261
+ Restricting a repeated field will restrict all values.
262
+ Adding a parent will block all child fields. (e.g.
263
+ ``foo.bar`` will block ``foo.bar.baz``)
264
+ index_configs (MutableSequence[google.cloud.logging_v2.types.IndexConfig]):
265
+ A list of indexed fields and related
266
+ configuration data.
267
+ cmek_settings (google.cloud.logging_v2.types.CmekSettings):
268
+ The CMEK settings of the log bucket. If
269
+ present, new log entries written to this log
270
+ bucket are encrypted using the CMEK key provided
271
+ in this configuration. If a log bucket has CMEK
272
+ settings, the CMEK settings cannot be disabled
273
+ later by updating the log bucket. Changing the
274
+ KMS key is allowed.
275
+ """
276
+
277
+ name: str = proto.Field(
278
+ proto.STRING,
279
+ number=1,
280
+ )
281
+ description: str = proto.Field(
282
+ proto.STRING,
283
+ number=3,
284
+ )
285
+ create_time: timestamp_pb2.Timestamp = proto.Field(
286
+ proto.MESSAGE,
287
+ number=4,
288
+ message=timestamp_pb2.Timestamp,
289
+ )
290
+ update_time: timestamp_pb2.Timestamp = proto.Field(
291
+ proto.MESSAGE,
292
+ number=5,
293
+ message=timestamp_pb2.Timestamp,
294
+ )
295
+ retention_days: int = proto.Field(
296
+ proto.INT32,
297
+ number=11,
298
+ )
299
+ locked: bool = proto.Field(
300
+ proto.BOOL,
301
+ number=9,
302
+ )
303
+ lifecycle_state: "LifecycleState" = proto.Field(
304
+ proto.ENUM,
305
+ number=12,
306
+ enum="LifecycleState",
307
+ )
308
+ analytics_enabled: bool = proto.Field(
309
+ proto.BOOL,
310
+ number=14,
311
+ )
312
+ restricted_fields: MutableSequence[str] = proto.RepeatedField(
313
+ proto.STRING,
314
+ number=15,
315
+ )
316
+ index_configs: MutableSequence["IndexConfig"] = proto.RepeatedField(
317
+ proto.MESSAGE,
318
+ number=17,
319
+ message="IndexConfig",
320
+ )
321
+ cmek_settings: "CmekSettings" = proto.Field(
322
+ proto.MESSAGE,
323
+ number=19,
324
+ message="CmekSettings",
325
+ )
326
+
327
+
328
+ class LogView(proto.Message):
329
+ r"""Describes a view over log entries in a bucket.
330
+
331
+ Attributes:
332
+ name (str):
333
+ The resource name of the view.
334
+
335
+ For example:
336
+
337
+ ``projects/my-project/locations/global/buckets/my-bucket/views/my-view``
338
+ description (str):
339
+ Describes this view.
340
+ create_time (google.protobuf.timestamp_pb2.Timestamp):
341
+ Output only. The creation timestamp of the
342
+ view.
343
+ update_time (google.protobuf.timestamp_pb2.Timestamp):
344
+ Output only. The last update timestamp of the
345
+ view.
346
+ filter (str):
347
+ Filter that restricts which log entries in a bucket are
348
+ visible in this view.
349
+
350
+ Filters are restricted to be a logical AND of ==/!= of any
351
+ of the following:
352
+
353
+ - originating project/folder/organization/billing account.
354
+ - resource type
355
+ - log id
356
+
357
+ For example:
358
+
359
+ SOURCE("projects/myproject") AND resource.type =
360
+ "gce_instance" AND LOG_ID("stdout")
361
+ """
362
+
363
+ name: str = proto.Field(
364
+ proto.STRING,
365
+ number=1,
366
+ )
367
+ description: str = proto.Field(
368
+ proto.STRING,
369
+ number=3,
370
+ )
371
+ create_time: timestamp_pb2.Timestamp = proto.Field(
372
+ proto.MESSAGE,
373
+ number=4,
374
+ message=timestamp_pb2.Timestamp,
375
+ )
376
+ update_time: timestamp_pb2.Timestamp = proto.Field(
377
+ proto.MESSAGE,
378
+ number=5,
379
+ message=timestamp_pb2.Timestamp,
380
+ )
381
+ filter: str = proto.Field(
382
+ proto.STRING,
383
+ number=7,
384
+ )
385
+
386
+
387
+ class LogSink(proto.Message):
388
+ r"""Describes a sink used to export log entries to one of the
389
+ following destinations in any project: a Cloud Storage bucket, a
390
+ BigQuery dataset, a Pub/Sub topic or a Cloud Logging log bucket.
391
+ A logs filter controls which log entries are exported. The sink
392
+ must be created within a project, organization, billing account,
393
+ or folder.
394
+
395
+
396
+ .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
397
+
398
+ Attributes:
399
+ name (str):
400
+ Required. The client-assigned sink identifier, unique within
401
+ the project.
402
+
403
+ For example: ``"my-syslog-errors-to-pubsub"``. Sink
404
+ identifiers are limited to 100 characters and can include
405
+ only the following characters: upper and lower-case
406
+ alphanumeric characters, underscores, hyphens, and periods.
407
+ First character has to be alphanumeric.
408
+ destination (str):
409
+ Required. The export destination:
410
+
411
+ ::
412
+
413
+ "storage.googleapis.com/[GCS_BUCKET]"
414
+ "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
415
+ "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
416
+
417
+ The sink's ``writer_identity``, set when the sink is
418
+ created, must have permission to write to the destination or
419
+ else the log entries are not exported. For more information,
420
+ see `Exporting Logs with
421
+ Sinks <https://cloud.google.com/logging/docs/api/tasks/exporting-logs>`__.
422
+ filter (str):
423
+ Optional. An `advanced logs
424
+ filter <https://cloud.google.com/logging/docs/view/advanced-queries>`__.
425
+ The only exported log entries are those that are in the
426
+ resource owning the sink and that match the filter.
427
+
428
+ For example:
429
+
430
+ ``logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR``
431
+ description (str):
432
+ Optional. A description of this sink.
433
+
434
+ The maximum length of the description is 8000
435
+ characters.
436
+ disabled (bool):
437
+ Optional. If set to true, then this sink is
438
+ disabled and it does not export any log entries.
439
+ exclusions (MutableSequence[google.cloud.logging_v2.types.LogExclusion]):
440
+ Optional. Log entries that match any of these exclusion
441
+ filters will not be exported.
442
+
443
+ If a log entry is matched by both ``filter`` and one of
444
+ ``exclusion_filters`` it will not be exported.
445
+ output_version_format (google.cloud.logging_v2.types.LogSink.VersionFormat):
446
+ Deprecated. This field is unused.
447
+ writer_identity (str):
448
+ Output only. An IAM identity—a service account or
449
+ group—under which Cloud Logging writes the exported log
450
+ entries to the sink's destination. This field is either set
451
+ by specifying ``custom_writer_identity`` or set
452
+ automatically by
453
+ [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink]
454
+ and
455
+ [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink]
456
+ based on the value of ``unique_writer_identity`` in those
457
+ methods.
458
+
459
+ Until you grant this identity write-access to the
460
+ destination, log entry exports from this sink will fail. For
461
+ more information, see `Granting Access for a
462
+ Resource <https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource>`__.
463
+ Consult the destination service's documentation to determine
464
+ the appropriate IAM roles to assign to the identity.
465
+
466
+ Sinks that have a destination that is a log bucket in the
467
+ same project as the sink cannot have a writer_identity and
468
+ no additional permissions are required.
469
+ include_children (bool):
470
+ Optional. This field applies only to sinks owned by
471
+ organizations and folders. If the field is false, the
472
+ default, only the logs owned by the sink's parent resource
473
+ are available for export. If the field is true, then log
474
+ entries from all the projects, folders, and billing accounts
475
+ contained in the sink's parent resource are also available
476
+ for export. Whether a particular log entry from the children
477
+ is exported depends on the sink's filter expression.
478
+
479
+ For example, if this field is true, then the filter
480
+ ``resource.type=gce_instance`` would export all Compute
481
+ Engine VM instance log entries from all projects in the
482
+ sink's parent.
483
+
484
+ To only export entries from certain child projects, filter
485
+ on the project part of the log name:
486
+
487
+ logName:("projects/test-project1/" OR
488
+ "projects/test-project2/") AND resource.type=gce_instance
489
+ bigquery_options (google.cloud.logging_v2.types.BigQueryOptions):
490
+ Optional. Options that affect sinks exporting
491
+ data to BigQuery.
492
+
493
+ This field is a member of `oneof`_ ``options``.
494
+ create_time (google.protobuf.timestamp_pb2.Timestamp):
495
+ Output only. The creation timestamp of the
496
+ sink.
497
+ This field may not be present for older sinks.
498
+ update_time (google.protobuf.timestamp_pb2.Timestamp):
499
+ Output only. The last update timestamp of the
500
+ sink.
501
+ This field may not be present for older sinks.
502
+ """
503
+
504
+ class VersionFormat(proto.Enum):
505
+ r"""Deprecated. This is unused.
506
+
507
+ Values:
508
+ VERSION_FORMAT_UNSPECIFIED (0):
509
+ An unspecified format version that will
510
+ default to V2.
511
+ V2 (1):
512
+ ``LogEntry`` version 2 format.
513
+ V1 (2):
514
+ ``LogEntry`` version 1 format.
515
+ """
516
+ VERSION_FORMAT_UNSPECIFIED = 0
517
+ V2 = 1
518
+ V1 = 2
519
+
520
+ name: str = proto.Field(
521
+ proto.STRING,
522
+ number=1,
523
+ )
524
+ destination: str = proto.Field(
525
+ proto.STRING,
526
+ number=3,
527
+ )
528
+ filter: str = proto.Field(
529
+ proto.STRING,
530
+ number=5,
531
+ )
532
+ description: str = proto.Field(
533
+ proto.STRING,
534
+ number=18,
535
+ )
536
+ disabled: bool = proto.Field(
537
+ proto.BOOL,
538
+ number=19,
539
+ )
540
+ exclusions: MutableSequence["LogExclusion"] = proto.RepeatedField(
541
+ proto.MESSAGE,
542
+ number=16,
543
+ message="LogExclusion",
544
+ )
545
+ output_version_format: VersionFormat = proto.Field(
546
+ proto.ENUM,
547
+ number=6,
548
+ enum=VersionFormat,
549
+ )
550
+ writer_identity: str = proto.Field(
551
+ proto.STRING,
552
+ number=8,
553
+ )
554
+ include_children: bool = proto.Field(
555
+ proto.BOOL,
556
+ number=9,
557
+ )
558
+ bigquery_options: "BigQueryOptions" = proto.Field(
559
+ proto.MESSAGE,
560
+ number=12,
561
+ oneof="options",
562
+ message="BigQueryOptions",
563
+ )
564
+ create_time: timestamp_pb2.Timestamp = proto.Field(
565
+ proto.MESSAGE,
566
+ number=13,
567
+ message=timestamp_pb2.Timestamp,
568
+ )
569
+ update_time: timestamp_pb2.Timestamp = proto.Field(
570
+ proto.MESSAGE,
571
+ number=14,
572
+ message=timestamp_pb2.Timestamp,
573
+ )
574
+
575
+
576
+ class BigQueryDataset(proto.Message):
577
+ r"""Describes a BigQuery dataset that was created by a link.
578
+
579
+ Attributes:
580
+ dataset_id (str):
581
+ Output only. The full resource name of the BigQuery dataset.
582
+ The DATASET_ID will match the ID of the link, so the link
583
+ must match the naming restrictions of BigQuery datasets
584
+ (alphanumeric characters and underscores only).
585
+
586
+ The dataset will have a resource path of
587
+ "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]".
588
+ """
589
+
590
+ dataset_id: str = proto.Field(
591
+ proto.STRING,
592
+ number=1,
593
+ )
594
+
595
+
596
+ class Link(proto.Message):
597
+ r"""Describes a link connected to an analytics enabled bucket.
598
+
599
+ Attributes:
600
+ name (str):
601
+ The resource name of the link. The name can have up to 100
602
+ characters. A valid link id (at the end of the link name)
603
+ must only have alphanumeric characters and underscores
604
+ within it.
605
+
606
+ ::
607
+
608
+ "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
609
+ "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
610
+ "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
611
+ "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
612
+
613
+ For example:
614
+
615
+ \`projects/my-project/locations/global/buckets/my-bucket/links/my_link
616
+ description (str):
617
+ Describes this link.
618
+
619
+ The maximum length of the description is 8000
620
+ characters.
621
+ create_time (google.protobuf.timestamp_pb2.Timestamp):
622
+ Output only. The creation timestamp of the
623
+ link.
624
+ lifecycle_state (google.cloud.logging_v2.types.LifecycleState):
625
+ Output only. The resource lifecycle state.
626
+ bigquery_dataset (google.cloud.logging_v2.types.BigQueryDataset):
627
+ The information of a BigQuery Dataset. When a
628
+ link is created, a BigQuery dataset is created
629
+ along with it, in the same project as the
630
+ LogBucket it's linked to. This dataset will also
631
+ have BigQuery Views corresponding to the
632
+ LogViews in the bucket.
633
+ """
634
+
635
+ name: str = proto.Field(
636
+ proto.STRING,
637
+ number=1,
638
+ )
639
+ description: str = proto.Field(
640
+ proto.STRING,
641
+ number=2,
642
+ )
643
+ create_time: timestamp_pb2.Timestamp = proto.Field(
644
+ proto.MESSAGE,
645
+ number=3,
646
+ message=timestamp_pb2.Timestamp,
647
+ )
648
+ lifecycle_state: "LifecycleState" = proto.Field(
649
+ proto.ENUM,
650
+ number=4,
651
+ enum="LifecycleState",
652
+ )
653
+ bigquery_dataset: "BigQueryDataset" = proto.Field(
654
+ proto.MESSAGE,
655
+ number=5,
656
+ message="BigQueryDataset",
657
+ )
658
+
659
+
660
+ class BigQueryOptions(proto.Message):
661
+ r"""Options that change functionality of a sink exporting data to
662
+ BigQuery.
663
+
664
+ Attributes:
665
+ use_partitioned_tables (bool):
666
+ Optional. Whether to use `BigQuery's partition
667
+ tables <https://cloud.google.com/bigquery/docs/partitioned-tables>`__.
668
+ By default, Cloud Logging creates dated tables based on the
669
+ log entries' timestamps, e.g. syslog_20170523. With
670
+ partitioned tables the date suffix is no longer present and
671
+ `special query
672
+ syntax <https://cloud.google.com/bigquery/docs/querying-partitioned-tables>`__
673
+ has to be used instead. In both cases, tables are sharded
674
+ based on UTC timezone.
675
+ uses_timestamp_column_partitioning (bool):
676
+ Output only. True if new timestamp column based partitioning
677
+ is in use, false if legacy ingestion-time partitioning is in
678
+ use.
679
+
680
+ All new sinks will have this field set true and will use
681
+ timestamp column based partitioning. If
682
+ use_partitioned_tables is false, this value has no meaning
683
+ and will be false. Legacy sinks using partitioned tables
684
+ will have this field set to false.
685
+ """
686
+
687
+ use_partitioned_tables: bool = proto.Field(
688
+ proto.BOOL,
689
+ number=1,
690
+ )
691
+ uses_timestamp_column_partitioning: bool = proto.Field(
692
+ proto.BOOL,
693
+ number=3,
694
+ )
695
+
696
+
697
+ class ListBucketsRequest(proto.Message):
698
+ r"""The parameters to ``ListBuckets``.
699
+
700
+ Attributes:
701
+ parent (str):
702
+ Required. The parent resource whose buckets are to be
703
+ listed:
704
+
705
+ ::
706
+
707
+ "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
708
+ "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
709
+ "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
710
+ "folders/[FOLDER_ID]/locations/[LOCATION_ID]"
711
+
712
+ Note: The locations portion of the resource must be
713
+ specified, but supplying the character ``-`` in place of
714
+ [LOCATION_ID] will return all buckets.
715
+ page_token (str):
716
+ Optional. If present, then retrieve the next batch of
717
+ results from the preceding call to this method.
718
+ ``pageToken`` must be the value of ``nextPageToken`` from
719
+ the previous response. The values of other method parameters
720
+ should be identical to those in the previous call.
721
+ page_size (int):
722
+ Optional. The maximum number of results to return from this
723
+ request. Non-positive values are ignored. The presence of
724
+ ``nextPageToken`` in the response indicates that more
725
+ results might be available.
726
+ """
727
+
728
+ parent: str = proto.Field(
729
+ proto.STRING,
730
+ number=1,
731
+ )
732
+ page_token: str = proto.Field(
733
+ proto.STRING,
734
+ number=2,
735
+ )
736
+ page_size: int = proto.Field(
737
+ proto.INT32,
738
+ number=3,
739
+ )
740
+
741
+
742
+ class ListBucketsResponse(proto.Message):
743
+ r"""The response from ListBuckets.
744
+
745
+ Attributes:
746
+ buckets (MutableSequence[google.cloud.logging_v2.types.LogBucket]):
747
+ A list of buckets.
748
+ next_page_token (str):
749
+ If there might be more results than appear in this response,
750
+ then ``nextPageToken`` is included. To get the next set of
751
+ results, call the same method again using the value of
752
+ ``nextPageToken`` as ``pageToken``.
753
+ """
754
+
755
+ @property
756
+ def raw_page(self):
757
+ return self
758
+
759
+ buckets: MutableSequence["LogBucket"] = proto.RepeatedField(
760
+ proto.MESSAGE,
761
+ number=1,
762
+ message="LogBucket",
763
+ )
764
+ next_page_token: str = proto.Field(
765
+ proto.STRING,
766
+ number=2,
767
+ )
768
+
769
+
770
+ class CreateBucketRequest(proto.Message):
771
+ r"""The parameters to ``CreateBucket``.
772
+
773
+ Attributes:
774
+ parent (str):
775
+ Required. The resource in which to create the log bucket:
776
+
777
+ ::
778
+
779
+ "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
780
+
781
+ For example:
782
+
783
+ ``"projects/my-project/locations/global"``
784
+ bucket_id (str):
785
+ Required. A client-assigned identifier such as
786
+ ``"my-bucket"``. Identifiers are limited to 100 characters
787
+ and can include only letters, digits, underscores, hyphens,
788
+ and periods.
789
+ bucket (google.cloud.logging_v2.types.LogBucket):
790
+ Required. The new bucket. The region
791
+ specified in the new bucket must be compliant
792
+ with any Location Restriction Org Policy. The
793
+ name field in the bucket is ignored.
794
+ """
795
+
796
+ parent: str = proto.Field(
797
+ proto.STRING,
798
+ number=1,
799
+ )
800
+ bucket_id: str = proto.Field(
801
+ proto.STRING,
802
+ number=2,
803
+ )
804
+ bucket: "LogBucket" = proto.Field(
805
+ proto.MESSAGE,
806
+ number=3,
807
+ message="LogBucket",
808
+ )
809
+
810
+
811
+ class UpdateBucketRequest(proto.Message):
812
+ r"""The parameters to ``UpdateBucket``.
813
+
814
+ Attributes:
815
+ name (str):
816
+ Required. The full resource name of the bucket to update.
817
+
818
+ ::
819
+
820
+ "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
821
+ "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
822
+ "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
823
+ "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
824
+
825
+ For example:
826
+
827
+ ``"projects/my-project/locations/global/buckets/my-bucket"``
828
+ bucket (google.cloud.logging_v2.types.LogBucket):
829
+ Required. The updated bucket.
830
+ update_mask (google.protobuf.field_mask_pb2.FieldMask):
831
+ Required. Field mask that specifies the fields in ``bucket``
832
+ that need an update. A bucket field will be overwritten if,
833
+ and only if, it is in the update mask. ``name`` and output
834
+ only fields cannot be updated.
835
+
836
+ For a detailed ``FieldMask`` definition, see:
837
+ https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
838
+
839
+ For example: ``updateMask=retention_days``
840
+ """
841
+
842
+ name: str = proto.Field(
843
+ proto.STRING,
844
+ number=1,
845
+ )
846
+ bucket: "LogBucket" = proto.Field(
847
+ proto.MESSAGE,
848
+ number=2,
849
+ message="LogBucket",
850
+ )
851
+ update_mask: field_mask_pb2.FieldMask = proto.Field(
852
+ proto.MESSAGE,
853
+ number=4,
854
+ message=field_mask_pb2.FieldMask,
855
+ )
856
+
857
+
858
+ class GetBucketRequest(proto.Message):
859
+ r"""The parameters to ``GetBucket``.
860
+
861
+ Attributes:
862
+ name (str):
863
+ Required. The resource name of the bucket:
864
+
865
+ ::
866
+
867
+ "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
868
+ "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
869
+ "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
870
+ "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
871
+
872
+ For example:
873
+
874
+ ``"projects/my-project/locations/global/buckets/my-bucket"``
875
+ """
876
+
877
+ name: str = proto.Field(
878
+ proto.STRING,
879
+ number=1,
880
+ )
881
+
882
+
883
+ class DeleteBucketRequest(proto.Message):
884
+ r"""The parameters to ``DeleteBucket``.
885
+
886
+ Attributes:
887
+ name (str):
888
+ Required. The full resource name of the bucket to delete.
889
+
890
+ ::
891
+
892
+ "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
893
+ "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
894
+ "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
895
+ "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
896
+
897
+ For example:
898
+
899
+ ``"projects/my-project/locations/global/buckets/my-bucket"``
900
+ """
901
+
902
+ name: str = proto.Field(
903
+ proto.STRING,
904
+ number=1,
905
+ )
906
+
907
+
908
+ class UndeleteBucketRequest(proto.Message):
909
+ r"""The parameters to ``UndeleteBucket``.
910
+
911
+ Attributes:
912
+ name (str):
913
+ Required. The full resource name of the bucket to undelete.
914
+
915
+ ::
916
+
917
+ "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
918
+ "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
919
+ "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
920
+ "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
921
+
922
+ For example:
923
+
924
+ ``"projects/my-project/locations/global/buckets/my-bucket"``
925
+ """
926
+
927
+ name: str = proto.Field(
928
+ proto.STRING,
929
+ number=1,
930
+ )
931
+
932
+
933
+ class ListViewsRequest(proto.Message):
934
+ r"""The parameters to ``ListViews``.
935
+
936
+ Attributes:
937
+ parent (str):
938
+ Required. The bucket whose views are to be listed:
939
+
940
+ ::
941
+
942
+ "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]".
943
+ page_token (str):
944
+ Optional. If present, then retrieve the next batch of
945
+ results from the preceding call to this method.
946
+ ``pageToken`` must be the value of ``nextPageToken`` from
947
+ the previous response. The values of other method parameters
948
+ should be identical to those in the previous call.
949
+ page_size (int):
950
+ Optional. The maximum number of results to return from this
951
+ request.
952
+
953
+ Non-positive values are ignored. The presence of
954
+ ``nextPageToken`` in the response indicates that more
955
+ results might be available.
956
+ """
957
+
958
+ parent: str = proto.Field(
959
+ proto.STRING,
960
+ number=1,
961
+ )
962
+ page_token: str = proto.Field(
963
+ proto.STRING,
964
+ number=2,
965
+ )
966
+ page_size: int = proto.Field(
967
+ proto.INT32,
968
+ number=3,
969
+ )
970
+
971
+
972
+ class ListViewsResponse(proto.Message):
973
+ r"""The response from ListViews.
974
+
975
+ Attributes:
976
+ views (MutableSequence[google.cloud.logging_v2.types.LogView]):
977
+ A list of views.
978
+ next_page_token (str):
979
+ If there might be more results than appear in this response,
980
+ then ``nextPageToken`` is included. To get the next set of
981
+ results, call the same method again using the value of
982
+ ``nextPageToken`` as ``pageToken``.
983
+ """
984
+
985
+ @property
986
+ def raw_page(self):
987
+ return self
988
+
989
+ views: MutableSequence["LogView"] = proto.RepeatedField(
990
+ proto.MESSAGE,
991
+ number=1,
992
+ message="LogView",
993
+ )
994
+ next_page_token: str = proto.Field(
995
+ proto.STRING,
996
+ number=2,
997
+ )
998
+
999
+
1000
+ class CreateViewRequest(proto.Message):
1001
+ r"""The parameters to ``CreateView``.
1002
+
1003
+ Attributes:
1004
+ parent (str):
1005
+ Required. The bucket in which to create the view
1006
+
1007
+ ::
1008
+
1009
+ `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"`
1010
+
1011
+ For example:
1012
+
1013
+ ``"projects/my-project/locations/global/buckets/my-bucket"``
1014
+ view_id (str):
1015
+ Required. A client-assigned identifier such as
1016
+ ``"my-view"``. Identifiers are limited to 100 characters and
1017
+ can include only letters, digits, underscores, hyphens, and
1018
+ periods.
1019
+ view (google.cloud.logging_v2.types.LogView):
1020
+ Required. The new view.
1021
+ """
1022
+
1023
+ parent: str = proto.Field(
1024
+ proto.STRING,
1025
+ number=1,
1026
+ )
1027
+ view_id: str = proto.Field(
1028
+ proto.STRING,
1029
+ number=2,
1030
+ )
1031
+ view: "LogView" = proto.Field(
1032
+ proto.MESSAGE,
1033
+ number=3,
1034
+ message="LogView",
1035
+ )
1036
+
1037
+
1038
+ class UpdateViewRequest(proto.Message):
1039
+ r"""The parameters to ``UpdateView``.
1040
+
1041
+ Attributes:
1042
+ name (str):
1043
+ Required. The full resource name of the view to update
1044
+
1045
+ ::
1046
+
1047
+ "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
1048
+
1049
+ For example:
1050
+
1051
+ ``"projects/my-project/locations/global/buckets/my-bucket/views/my-view"``
1052
+ view (google.cloud.logging_v2.types.LogView):
1053
+ Required. The updated view.
1054
+ update_mask (google.protobuf.field_mask_pb2.FieldMask):
1055
+ Optional. Field mask that specifies the fields in ``view``
1056
+ that need an update. A field will be overwritten if, and
1057
+ only if, it is in the update mask. ``name`` and output only
1058
+ fields cannot be updated.
1059
+
1060
+ For a detailed ``FieldMask`` definition, see
1061
+ https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
1062
+
1063
+ For example: ``updateMask=filter``
1064
+ """
1065
+
1066
+ name: str = proto.Field(
1067
+ proto.STRING,
1068
+ number=1,
1069
+ )
1070
+ view: "LogView" = proto.Field(
1071
+ proto.MESSAGE,
1072
+ number=2,
1073
+ message="LogView",
1074
+ )
1075
+ update_mask: field_mask_pb2.FieldMask = proto.Field(
1076
+ proto.MESSAGE,
1077
+ number=4,
1078
+ message=field_mask_pb2.FieldMask,
1079
+ )
1080
+
1081
+
1082
+ class GetViewRequest(proto.Message):
1083
+ r"""The parameters to ``GetView``.
1084
+
1085
+ Attributes:
1086
+ name (str):
1087
+ Required. The resource name of the policy:
1088
+
1089
+ ::
1090
+
1091
+ "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
1092
+
1093
+ For example:
1094
+
1095
+ ``"projects/my-project/locations/global/buckets/my-bucket/views/my-view"``
1096
+ """
1097
+
1098
+ name: str = proto.Field(
1099
+ proto.STRING,
1100
+ number=1,
1101
+ )
1102
+
1103
+
1104
+ class DeleteViewRequest(proto.Message):
1105
+ r"""The parameters to ``DeleteView``.
1106
+
1107
+ Attributes:
1108
+ name (str):
1109
+ Required. The full resource name of the view to delete:
1110
+
1111
+ ::
1112
+
1113
+ "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
1114
+
1115
+ For example:
1116
+
1117
+ ::
1118
+
1119
+ `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
1120
+ """
1121
+
1122
+ name: str = proto.Field(
1123
+ proto.STRING,
1124
+ number=1,
1125
+ )
1126
+
1127
+
1128
+ class ListSinksRequest(proto.Message):
1129
+ r"""The parameters to ``ListSinks``.
1130
+
1131
+ Attributes:
1132
+ parent (str):
1133
+ Required. The parent resource whose sinks are to be listed:
1134
+
1135
+ ::
1136
+
1137
+ "projects/[PROJECT_ID]"
1138
+ "organizations/[ORGANIZATION_ID]"
1139
+ "billingAccounts/[BILLING_ACCOUNT_ID]"
1140
+ "folders/[FOLDER_ID]".
1141
+ page_token (str):
1142
+ Optional. If present, then retrieve the next batch of
1143
+ results from the preceding call to this method.
1144
+ ``pageToken`` must be the value of ``nextPageToken`` from
1145
+ the previous response. The values of other method parameters
1146
+ should be identical to those in the previous call.
1147
+ page_size (int):
1148
+ Optional. The maximum number of results to return from this
1149
+ request. Non-positive values are ignored. The presence of
1150
+ ``nextPageToken`` in the response indicates that more
1151
+ results might be available.
1152
+ """
1153
+
1154
+ parent: str = proto.Field(
1155
+ proto.STRING,
1156
+ number=1,
1157
+ )
1158
+ page_token: str = proto.Field(
1159
+ proto.STRING,
1160
+ number=2,
1161
+ )
1162
+ page_size: int = proto.Field(
1163
+ proto.INT32,
1164
+ number=3,
1165
+ )
1166
+
1167
+
1168
+ class ListSinksResponse(proto.Message):
1169
+ r"""Result returned from ``ListSinks``.
1170
+
1171
+ Attributes:
1172
+ sinks (MutableSequence[google.cloud.logging_v2.types.LogSink]):
1173
+ A list of sinks.
1174
+ next_page_token (str):
1175
+ If there might be more results than appear in this response,
1176
+ then ``nextPageToken`` is included. To get the next set of
1177
+ results, call the same method again using the value of
1178
+ ``nextPageToken`` as ``pageToken``.
1179
+ """
1180
+
1181
+ @property
1182
+ def raw_page(self):
1183
+ return self
1184
+
1185
+ sinks: MutableSequence["LogSink"] = proto.RepeatedField(
1186
+ proto.MESSAGE,
1187
+ number=1,
1188
+ message="LogSink",
1189
+ )
1190
+ next_page_token: str = proto.Field(
1191
+ proto.STRING,
1192
+ number=2,
1193
+ )
1194
+
1195
+
1196
+ class GetSinkRequest(proto.Message):
1197
+ r"""The parameters to ``GetSink``.
1198
+
1199
+ Attributes:
1200
+ sink_name (str):
1201
+ Required. The resource name of the sink:
1202
+
1203
+ ::
1204
+
1205
+ "projects/[PROJECT_ID]/sinks/[SINK_ID]"
1206
+ "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
1207
+ "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
1208
+ "folders/[FOLDER_ID]/sinks/[SINK_ID]"
1209
+
1210
+ For example:
1211
+
1212
+ ``"projects/my-project/sinks/my-sink"``
1213
+ """
1214
+
1215
+ sink_name: str = proto.Field(
1216
+ proto.STRING,
1217
+ number=1,
1218
+ )
1219
+
1220
+
1221
+ class CreateSinkRequest(proto.Message):
1222
+ r"""The parameters to ``CreateSink``.
1223
+
1224
+ Attributes:
1225
+ parent (str):
1226
+ Required. The resource in which to create the sink:
1227
+
1228
+ ::
1229
+
1230
+ "projects/[PROJECT_ID]"
1231
+ "organizations/[ORGANIZATION_ID]"
1232
+ "billingAccounts/[BILLING_ACCOUNT_ID]"
1233
+ "folders/[FOLDER_ID]"
1234
+
1235
+ For examples:
1236
+
1237
+ ``"projects/my-project"`` ``"organizations/123456789"``
1238
+ sink (google.cloud.logging_v2.types.LogSink):
1239
+ Required. The new sink, whose ``name`` parameter is a sink
1240
+ identifier that is not already in use.
1241
+ unique_writer_identity (bool):
1242
+ Optional. Determines the kind of IAM identity returned as
1243
+ ``writer_identity`` in the new sink. If this value is
1244
+ omitted or set to false, and if the sink's parent is a
1245
+ project, then the value returned as ``writer_identity`` is
1246
+ the same group or service account used by Cloud Logging
1247
+ before the addition of writer identities to this API. The
1248
+ sink's destination must be in the same project as the sink
1249
+ itself.
1250
+
1251
+ If this field is set to true, or if the sink is owned by a
1252
+ non-project resource such as an organization, then the value
1253
+ of ``writer_identity`` will be a unique service account used
1254
+ only for exports from the new sink. For more information,
1255
+ see ``writer_identity`` in
1256
+ [LogSink][google.logging.v2.LogSink].
1257
+ """
1258
+
1259
+ parent: str = proto.Field(
1260
+ proto.STRING,
1261
+ number=1,
1262
+ )
1263
+ sink: "LogSink" = proto.Field(
1264
+ proto.MESSAGE,
1265
+ number=2,
1266
+ message="LogSink",
1267
+ )
1268
+ unique_writer_identity: bool = proto.Field(
1269
+ proto.BOOL,
1270
+ number=3,
1271
+ )
1272
+
1273
+
1274
+ class UpdateSinkRequest(proto.Message):
1275
+ r"""The parameters to ``UpdateSink``.
1276
+
1277
+ Attributes:
1278
+ sink_name (str):
1279
+ Required. The full resource name of the sink to update,
1280
+ including the parent resource and the sink identifier:
1281
+
1282
+ ::
1283
+
1284
+ "projects/[PROJECT_ID]/sinks/[SINK_ID]"
1285
+ "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
1286
+ "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
1287
+ "folders/[FOLDER_ID]/sinks/[SINK_ID]"
1288
+
1289
+ For example:
1290
+
1291
+ ``"projects/my-project/sinks/my-sink"``
1292
+ sink (google.cloud.logging_v2.types.LogSink):
1293
+ Required. The updated sink, whose name is the same
1294
+ identifier that appears as part of ``sink_name``.
1295
+ unique_writer_identity (bool):
1296
+ Optional. See
1297
+ [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink]
1298
+ for a description of this field. When updating a sink, the
1299
+ effect of this field on the value of ``writer_identity`` in
1300
+ the updated sink depends on both the old and new values of
1301
+ this field:
1302
+
1303
+ - If the old and new values of this field are both false or
1304
+ both true, then there is no change to the sink's
1305
+ ``writer_identity``.
1306
+ - If the old value is false and the new value is true, then
1307
+ ``writer_identity`` is changed to a unique service
1308
+ account.
1309
+ - It is an error if the old value is true and the new value
1310
+ is set to false or defaulted to false.
1311
+ update_mask (google.protobuf.field_mask_pb2.FieldMask):
1312
+ Optional. Field mask that specifies the fields in ``sink``
1313
+ that need an update. A sink field will be overwritten if,
1314
+ and only if, it is in the update mask. ``name`` and output
1315
+ only fields cannot be updated.
1316
+
1317
+ An empty ``updateMask`` is temporarily treated as using the
1318
+ following mask for backwards compatibility purposes:
1319
+
1320
+ ``destination,filter,includeChildren``
1321
+
1322
+ At some point in the future, behavior will be removed and
1323
+ specifying an empty ``updateMask`` will be an error.
1324
+
1325
+ For a detailed ``FieldMask`` definition, see
1326
+ https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
1327
+
1328
+ For example: ``updateMask=filter``
1329
+ """
1330
+
1331
+ sink_name: str = proto.Field(
1332
+ proto.STRING,
1333
+ number=1,
1334
+ )
1335
+ sink: "LogSink" = proto.Field(
1336
+ proto.MESSAGE,
1337
+ number=2,
1338
+ message="LogSink",
1339
+ )
1340
+ unique_writer_identity: bool = proto.Field(
1341
+ proto.BOOL,
1342
+ number=3,
1343
+ )
1344
+ update_mask: field_mask_pb2.FieldMask = proto.Field(
1345
+ proto.MESSAGE,
1346
+ number=4,
1347
+ message=field_mask_pb2.FieldMask,
1348
+ )
1349
+
1350
+
1351
+ class DeleteSinkRequest(proto.Message):
1352
+ r"""The parameters to ``DeleteSink``.
1353
+
1354
+ Attributes:
1355
+ sink_name (str):
1356
+ Required. The full resource name of the sink to delete,
1357
+ including the parent resource and the sink identifier:
1358
+
1359
+ ::
1360
+
1361
+ "projects/[PROJECT_ID]/sinks/[SINK_ID]"
1362
+ "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
1363
+ "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
1364
+ "folders/[FOLDER_ID]/sinks/[SINK_ID]"
1365
+
1366
+ For example:
1367
+
1368
+ ``"projects/my-project/sinks/my-sink"``
1369
+ """
1370
+
1371
+ sink_name: str = proto.Field(
1372
+ proto.STRING,
1373
+ number=1,
1374
+ )
1375
+
1376
+
1377
+ class CreateLinkRequest(proto.Message):
1378
+ r"""The parameters to CreateLink.
1379
+
1380
+ Attributes:
1381
+ parent (str):
1382
+ Required. The full resource name of the bucket to create a
1383
+ link for.
1384
+
1385
+ ::
1386
+
1387
+ "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
1388
+ "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
1389
+ "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
1390
+ "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]".
1391
+ link (google.cloud.logging_v2.types.Link):
1392
+ Required. The new link.
1393
+ link_id (str):
1394
+ Required. The ID to use for the link. The link_id can have
1395
+ up to 100 characters. A valid link_id must only have
1396
+ alphanumeric characters and underscores within it.
1397
+ """
1398
+
1399
+ parent: str = proto.Field(
1400
+ proto.STRING,
1401
+ number=1,
1402
+ )
1403
+ link: "Link" = proto.Field(
1404
+ proto.MESSAGE,
1405
+ number=2,
1406
+ message="Link",
1407
+ )
1408
+ link_id: str = proto.Field(
1409
+ proto.STRING,
1410
+ number=3,
1411
+ )
1412
+
1413
+
1414
+ class DeleteLinkRequest(proto.Message):
1415
+ r"""The parameters to DeleteLink.
1416
+
1417
+ Attributes:
1418
+ name (str):
1419
+ Required. The full resource name of the link to delete.
1420
+
1421
+ "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
1422
+ "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
1423
+ "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
1424
+ "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]".
1425
+ """
1426
+
1427
+ name: str = proto.Field(
1428
+ proto.STRING,
1429
+ number=1,
1430
+ )
1431
+
1432
+
1433
+ class ListLinksRequest(proto.Message):
1434
+ r"""The parameters to ListLinks.
1435
+
1436
+ Attributes:
1437
+ parent (str):
1438
+ Required. The parent resource whose links are to be listed:
1439
+
1440
+ "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/"
1441
+ "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/"
1442
+ "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/"
1443
+ "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/
1444
+ page_token (str):
1445
+ Optional. If present, then retrieve the next batch of
1446
+ results from the preceding call to this method.
1447
+ ``pageToken`` must be the value of ``nextPageToken`` from
1448
+ the previous response.
1449
+ page_size (int):
1450
+ Optional. The maximum number of results to
1451
+ return from this request.
1452
+ """
1453
+
1454
+ parent: str = proto.Field(
1455
+ proto.STRING,
1456
+ number=1,
1457
+ )
1458
+ page_token: str = proto.Field(
1459
+ proto.STRING,
1460
+ number=2,
1461
+ )
1462
+ page_size: int = proto.Field(
1463
+ proto.INT32,
1464
+ number=3,
1465
+ )
1466
+
1467
+
1468
+ class ListLinksResponse(proto.Message):
1469
+ r"""The response from ListLinks.
1470
+
1471
+ Attributes:
1472
+ links (MutableSequence[google.cloud.logging_v2.types.Link]):
1473
+ A list of links.
1474
+ next_page_token (str):
1475
+ If there might be more results than those appearing in this
1476
+ response, then ``nextPageToken`` is included. To get the
1477
+ next set of results, call the same method again using the
1478
+ value of ``nextPageToken`` as ``pageToken``.
1479
+ """
1480
+
1481
+ @property
1482
+ def raw_page(self):
1483
+ return self
1484
+
1485
+ links: MutableSequence["Link"] = proto.RepeatedField(
1486
+ proto.MESSAGE,
1487
+ number=1,
1488
+ message="Link",
1489
+ )
1490
+ next_page_token: str = proto.Field(
1491
+ proto.STRING,
1492
+ number=2,
1493
+ )
1494
+
1495
+
1496
+ class GetLinkRequest(proto.Message):
1497
+ r"""The parameters to GetLink.
1498
+
1499
+ Attributes:
1500
+ name (str):
1501
+ Required. The resource name of the link:
1502
+
1503
+ "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
1504
+ "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
1505
+ "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
1506
+ "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]
1507
+ """
1508
+
1509
+ name: str = proto.Field(
1510
+ proto.STRING,
1511
+ number=1,
1512
+ )
1513
+
1514
+
1515
+ class LogExclusion(proto.Message):
1516
+ r"""Specifies a set of log entries that are filtered out by a sink. If
1517
+ your Google Cloud resource receives a large volume of log entries,
1518
+ you can use exclusions to reduce your chargeable logs. Note that
1519
+ exclusions on organization-level and folder-level sinks don't apply
1520
+ to child resources. Note also that you cannot modify the \_Required
1521
+ sink or exclude logs from it.
1522
+
1523
+ Attributes:
1524
+ name (str):
1525
+ Required. A client-assigned identifier, such as
1526
+ ``"load-balancer-exclusion"``. Identifiers are limited to
1527
+ 100 characters and can include only letters, digits,
1528
+ underscores, hyphens, and periods. First character has to be
1529
+ alphanumeric.
1530
+ description (str):
1531
+ Optional. A description of this exclusion.
1532
+ filter (str):
1533
+ Required. An `advanced logs
1534
+ filter <https://cloud.google.com/logging/docs/view/advanced-queries>`__
1535
+ that matches the log entries to be excluded. By using the
1536
+ `sample
1537
+ function <https://cloud.google.com/logging/docs/view/advanced-queries#sample>`__,
1538
+ you can exclude less than 100% of the matching log entries.
1539
+
1540
+ For example, the following query matches 99% of low-severity
1541
+ log entries from Google Cloud Storage buckets:
1542
+
1543
+ ``resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)``
1544
+ disabled (bool):
1545
+ Optional. If set to True, then this exclusion is disabled
1546
+ and it does not exclude any log entries. You can [update an
1547
+ exclusion][google.logging.v2.ConfigServiceV2.UpdateExclusion]
1548
+ to change the value of this field.
1549
+ create_time (google.protobuf.timestamp_pb2.Timestamp):
1550
+ Output only. The creation timestamp of the
1551
+ exclusion.
1552
+ This field may not be present for older
1553
+ exclusions.
1554
+ update_time (google.protobuf.timestamp_pb2.Timestamp):
1555
+ Output only. The last update timestamp of the
1556
+ exclusion.
1557
+ This field may not be present for older
1558
+ exclusions.
1559
+ """
1560
+
1561
+ name: str = proto.Field(
1562
+ proto.STRING,
1563
+ number=1,
1564
+ )
1565
+ description: str = proto.Field(
1566
+ proto.STRING,
1567
+ number=2,
1568
+ )
1569
+ filter: str = proto.Field(
1570
+ proto.STRING,
1571
+ number=3,
1572
+ )
1573
+ disabled: bool = proto.Field(
1574
+ proto.BOOL,
1575
+ number=4,
1576
+ )
1577
+ create_time: timestamp_pb2.Timestamp = proto.Field(
1578
+ proto.MESSAGE,
1579
+ number=5,
1580
+ message=timestamp_pb2.Timestamp,
1581
+ )
1582
+ update_time: timestamp_pb2.Timestamp = proto.Field(
1583
+ proto.MESSAGE,
1584
+ number=6,
1585
+ message=timestamp_pb2.Timestamp,
1586
+ )
1587
+
1588
+
1589
+ class ListExclusionsRequest(proto.Message):
1590
+ r"""The parameters to ``ListExclusions``.
1591
+
1592
+ Attributes:
1593
+ parent (str):
1594
+ Required. The parent resource whose exclusions are to be
1595
+ listed.
1596
+
1597
+ ::
1598
+
1599
+ "projects/[PROJECT_ID]"
1600
+ "organizations/[ORGANIZATION_ID]"
1601
+ "billingAccounts/[BILLING_ACCOUNT_ID]"
1602
+ "folders/[FOLDER_ID]".
1603
+ page_token (str):
1604
+ Optional. If present, then retrieve the next batch of
1605
+ results from the preceding call to this method.
1606
+ ``pageToken`` must be the value of ``nextPageToken`` from
1607
+ the previous response. The values of other method parameters
1608
+ should be identical to those in the previous call.
1609
+ page_size (int):
1610
+ Optional. The maximum number of results to return from this
1611
+ request. Non-positive values are ignored. The presence of
1612
+ ``nextPageToken`` in the response indicates that more
1613
+ results might be available.
1614
+ """
1615
+
1616
+ parent: str = proto.Field(
1617
+ proto.STRING,
1618
+ number=1,
1619
+ )
1620
+ page_token: str = proto.Field(
1621
+ proto.STRING,
1622
+ number=2,
1623
+ )
1624
+ page_size: int = proto.Field(
1625
+ proto.INT32,
1626
+ number=3,
1627
+ )
1628
+
1629
+
1630
+ class ListExclusionsResponse(proto.Message):
1631
+ r"""Result returned from ``ListExclusions``.
1632
+
1633
+ Attributes:
1634
+ exclusions (MutableSequence[google.cloud.logging_v2.types.LogExclusion]):
1635
+ A list of exclusions.
1636
+ next_page_token (str):
1637
+ If there might be more results than appear in this response,
1638
+ then ``nextPageToken`` is included. To get the next set of
1639
+ results, call the same method again using the value of
1640
+ ``nextPageToken`` as ``pageToken``.
1641
+ """
1642
+
1643
+ @property
1644
+ def raw_page(self):
1645
+ return self
1646
+
1647
+ exclusions: MutableSequence["LogExclusion"] = proto.RepeatedField(
1648
+ proto.MESSAGE,
1649
+ number=1,
1650
+ message="LogExclusion",
1651
+ )
1652
+ next_page_token: str = proto.Field(
1653
+ proto.STRING,
1654
+ number=2,
1655
+ )
1656
+
1657
+
1658
+ class GetExclusionRequest(proto.Message):
1659
+ r"""The parameters to ``GetExclusion``.
1660
+
1661
+ Attributes:
1662
+ name (str):
1663
+ Required. The resource name of an existing exclusion:
1664
+
1665
+ ::
1666
+
1667
+ "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
1668
+ "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
1669
+ "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
1670
+ "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
1671
+
1672
+ For example:
1673
+
1674
+ ``"projects/my-project/exclusions/my-exclusion"``
1675
+ """
1676
+
1677
+ name: str = proto.Field(
1678
+ proto.STRING,
1679
+ number=1,
1680
+ )
1681
+
1682
+
1683
+ class CreateExclusionRequest(proto.Message):
1684
+ r"""The parameters to ``CreateExclusion``.
1685
+
1686
+ Attributes:
1687
+ parent (str):
1688
+ Required. The parent resource in which to create the
1689
+ exclusion:
1690
+
1691
+ ::
1692
+
1693
+ "projects/[PROJECT_ID]"
1694
+ "organizations/[ORGANIZATION_ID]"
1695
+ "billingAccounts/[BILLING_ACCOUNT_ID]"
1696
+ "folders/[FOLDER_ID]"
1697
+
1698
+ For examples:
1699
+
1700
+ ``"projects/my-logging-project"``
1701
+ ``"organizations/123456789"``
1702
+ exclusion (google.cloud.logging_v2.types.LogExclusion):
1703
+ Required. The new exclusion, whose ``name`` parameter is an
1704
+ exclusion name that is not already used in the parent
1705
+ resource.
1706
+ """
1707
+
1708
+ parent: str = proto.Field(
1709
+ proto.STRING,
1710
+ number=1,
1711
+ )
1712
+ exclusion: "LogExclusion" = proto.Field(
1713
+ proto.MESSAGE,
1714
+ number=2,
1715
+ message="LogExclusion",
1716
+ )
1717
+
1718
+
1719
+ class UpdateExclusionRequest(proto.Message):
1720
+ r"""The parameters to ``UpdateExclusion``.
1721
+
1722
+ Attributes:
1723
+ name (str):
1724
+ Required. The resource name of the exclusion to update:
1725
+
1726
+ ::
1727
+
1728
+ "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
1729
+ "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
1730
+ "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
1731
+ "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
1732
+
1733
+ For example:
1734
+
1735
+ ``"projects/my-project/exclusions/my-exclusion"``
1736
+ exclusion (google.cloud.logging_v2.types.LogExclusion):
1737
+ Required. New values for the existing exclusion. Only the
1738
+ fields specified in ``update_mask`` are relevant.
1739
+ update_mask (google.protobuf.field_mask_pb2.FieldMask):
1740
+ Required. A non-empty list of fields to change in the
1741
+ existing exclusion. New values for the fields are taken from
1742
+ the corresponding fields in the
1743
+ [LogExclusion][google.logging.v2.LogExclusion] included in
1744
+ this request. Fields not mentioned in ``update_mask`` are
1745
+ not changed and are ignored in the request.
1746
+
1747
+ For example, to change the filter and description of an
1748
+ exclusion, specify an ``update_mask`` of
1749
+ ``"filter,description"``.
1750
+ """
1751
+
1752
+ name: str = proto.Field(
1753
+ proto.STRING,
1754
+ number=1,
1755
+ )
1756
+ exclusion: "LogExclusion" = proto.Field(
1757
+ proto.MESSAGE,
1758
+ number=2,
1759
+ message="LogExclusion",
1760
+ )
1761
+ update_mask: field_mask_pb2.FieldMask = proto.Field(
1762
+ proto.MESSAGE,
1763
+ number=3,
1764
+ message=field_mask_pb2.FieldMask,
1765
+ )
1766
+
1767
+
1768
+ class DeleteExclusionRequest(proto.Message):
1769
+ r"""The parameters to ``DeleteExclusion``.
1770
+
1771
+ Attributes:
1772
+ name (str):
1773
+ Required. The resource name of an existing exclusion to
1774
+ delete:
1775
+
1776
+ ::
1777
+
1778
+ "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
1779
+ "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
1780
+ "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
1781
+ "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
1782
+
1783
+ For example:
1784
+
1785
+ ``"projects/my-project/exclusions/my-exclusion"``
1786
+ """
1787
+
1788
+ name: str = proto.Field(
1789
+ proto.STRING,
1790
+ number=1,
1791
+ )
1792
+
1793
+
1794
+ class GetCmekSettingsRequest(proto.Message):
1795
+ r"""The parameters to
1796
+ [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings].
1797
+
1798
+ See `Enabling CMEK for Log
1799
+ Router <https://cloud.google.com/logging/docs/routing/managed-encryption>`__
1800
+ for more information.
1801
+
1802
+ Attributes:
1803
+ name (str):
1804
+ Required. The resource for which to retrieve CMEK settings.
1805
+
1806
+ ::
1807
+
1808
+ "projects/[PROJECT_ID]/cmekSettings"
1809
+ "organizations/[ORGANIZATION_ID]/cmekSettings"
1810
+ "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
1811
+ "folders/[FOLDER_ID]/cmekSettings"
1812
+
1813
+ For example:
1814
+
1815
+ ``"organizations/12345/cmekSettings"``
1816
+
1817
+ Note: CMEK for the Log Router can be configured for Google
1818
+ Cloud projects, folders, organizations and billing accounts.
1819
+ Once configured for an organization, it applies to all
1820
+ projects and folders in the Google Cloud organization.
1821
+ """
1822
+
1823
+ name: str = proto.Field(
1824
+ proto.STRING,
1825
+ number=1,
1826
+ )
1827
+
1828
+
1829
+ class UpdateCmekSettingsRequest(proto.Message):
1830
+ r"""The parameters to
1831
+ [UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings].
1832
+
1833
+ See `Enabling CMEK for Log
1834
+ Router <https://cloud.google.com/logging/docs/routing/managed-encryption>`__
1835
+ for more information.
1836
+
1837
+ Attributes:
1838
+ name (str):
1839
+ Required. The resource name for the CMEK settings to update.
1840
+
1841
+ ::
1842
+
1843
+ "projects/[PROJECT_ID]/cmekSettings"
1844
+ "organizations/[ORGANIZATION_ID]/cmekSettings"
1845
+ "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
1846
+ "folders/[FOLDER_ID]/cmekSettings"
1847
+
1848
+ For example:
1849
+
1850
+ ``"organizations/12345/cmekSettings"``
1851
+
1852
+ Note: CMEK for the Log Router can currently only be
1853
+ configured for Google Cloud organizations. Once configured,
1854
+ it applies to all projects and folders in the Google Cloud
1855
+ organization.
1856
+ cmek_settings (google.cloud.logging_v2.types.CmekSettings):
1857
+ Required. The CMEK settings to update.
1858
+
1859
+ See `Enabling CMEK for Log
1860
+ Router <https://cloud.google.com/logging/docs/routing/managed-encryption>`__
1861
+ for more information.
1862
+ update_mask (google.protobuf.field_mask_pb2.FieldMask):
1863
+ Optional. Field mask identifying which fields from
1864
+ ``cmek_settings`` should be updated. A field will be
1865
+ overwritten if and only if it is in the update mask. Output
1866
+ only fields cannot be updated.
1867
+
1868
+ See [FieldMask][google.protobuf.FieldMask] for more
1869
+ information.
1870
+
1871
+ For example: ``"updateMask=kmsKeyName"``
1872
+ """
1873
+
1874
+ name: str = proto.Field(
1875
+ proto.STRING,
1876
+ number=1,
1877
+ )
1878
+ cmek_settings: "CmekSettings" = proto.Field(
1879
+ proto.MESSAGE,
1880
+ number=2,
1881
+ message="CmekSettings",
1882
+ )
1883
+ update_mask: field_mask_pb2.FieldMask = proto.Field(
1884
+ proto.MESSAGE,
1885
+ number=3,
1886
+ message=field_mask_pb2.FieldMask,
1887
+ )
1888
+
1889
+
1890
+ class CmekSettings(proto.Message):
1891
+ r"""Describes the customer-managed encryption key (CMEK) settings
1892
+ associated with a project, folder, organization, billing account, or
1893
+ flexible resource.
1894
+
1895
+ Note: CMEK for the Log Router can currently only be configured for
1896
+ Google Cloud organizations. Once configured, it applies to all
1897
+ projects and folders in the Google Cloud organization.
1898
+
1899
+ See `Enabling CMEK for Log
1900
+ Router <https://cloud.google.com/logging/docs/routing/managed-encryption>`__
1901
+ for more information.
1902
+
1903
+ Attributes:
1904
+ name (str):
1905
+ Output only. The resource name of the CMEK
1906
+ settings.
1907
+ kms_key_name (str):
1908
+ The resource name for the configured Cloud KMS key.
1909
+
1910
+ KMS key name format:
1911
+
1912
+ ::
1913
+
1914
+ "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
1915
+
1916
+ For example:
1917
+
1918
+ ``"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"``
1919
+
1920
+ To enable CMEK for the Log Router, set this field to a valid
1921
+ ``kms_key_name`` for which the associated service account
1922
+ has the required cloudkms.cryptoKeyEncrypterDecrypter roles
1923
+ assigned for the key.
1924
+
1925
+ The Cloud KMS key used by the Log Router can be updated by
1926
+ changing the ``kms_key_name`` to a new valid key name or
1927
+ disabled by setting the key name to an empty string.
1928
+ Encryption operations that are in progress will be completed
1929
+ with the key that was in use when they started. Decryption
1930
+ operations will be completed using the key that was used at
1931
+ the time of encryption unless access to that key has been
1932
+ revoked.
1933
+
1934
+ To disable CMEK for the Log Router, set this field to an
1935
+ empty string.
1936
+
1937
+ See `Enabling CMEK for Log
1938
+ Router <https://cloud.google.com/logging/docs/routing/managed-encryption>`__
1939
+ for more information.
1940
+ kms_key_version_name (str):
1941
+ The CryptoKeyVersion resource name for the configured Cloud
1942
+ KMS key.
1943
+
1944
+ KMS key name format:
1945
+
1946
+ ::
1947
+
1948
+ "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]"
1949
+
1950
+ For example:
1951
+
1952
+ ``"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"``
1953
+
1954
+ This is a read-only field used to convey the specific
1955
+ configured CryptoKeyVersion of ``kms_key`` that has been
1956
+ configured. It will be populated in cases where the CMEK
1957
+ settings are bound to a single key version.
1958
+
1959
+ If this field is populated, the ``kms_key`` is tied to a
1960
+ specific CryptoKeyVersion.
1961
+ service_account_id (str):
1962
+ Output only. The service account that will be used by the
1963
+ Log Router to access your Cloud KMS key.
1964
+
1965
+ Before enabling CMEK for Log Router, you must first assign
1966
+ the cloudkms.cryptoKeyEncrypterDecrypter role to the service
1967
+ account that the Log Router will use to access your Cloud
1968
+ KMS key. Use
1969
+ [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings]
1970
+ to obtain the service account ID.
1971
+
1972
+ See `Enabling CMEK for Log
1973
+ Router <https://cloud.google.com/logging/docs/routing/managed-encryption>`__
1974
+ for more information.
1975
+ """
1976
+
1977
+ name: str = proto.Field(
1978
+ proto.STRING,
1979
+ number=1,
1980
+ )
1981
+ kms_key_name: str = proto.Field(
1982
+ proto.STRING,
1983
+ number=2,
1984
+ )
1985
+ kms_key_version_name: str = proto.Field(
1986
+ proto.STRING,
1987
+ number=4,
1988
+ )
1989
+ service_account_id: str = proto.Field(
1990
+ proto.STRING,
1991
+ number=3,
1992
+ )
1993
+
1994
+
1995
+ class GetSettingsRequest(proto.Message):
1996
+ r"""The parameters to
1997
+ [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings].
1998
+
1999
+ See `Enabling CMEK for Log
2000
+ Router <https://cloud.google.com/logging/docs/routing/managed-encryption>`__
2001
+ for more information.
2002
+
2003
+ Attributes:
2004
+ name (str):
2005
+ Required. The resource for which to retrieve settings.
2006
+
2007
+ ::
2008
+
2009
+ "projects/[PROJECT_ID]/settings"
2010
+ "organizations/[ORGANIZATION_ID]/settings"
2011
+ "billingAccounts/[BILLING_ACCOUNT_ID]/settings"
2012
+ "folders/[FOLDER_ID]/settings"
2013
+
2014
+ For example:
2015
+
2016
+ ``"organizations/12345/settings"``
2017
+
2018
+ Note: Settings for the Log Router can be get for Google
2019
+ Cloud projects, folders, organizations and billing accounts.
2020
+ Currently it can only be configured for organizations. Once
2021
+ configured for an organization, it applies to all projects
2022
+ and folders in the Google Cloud organization.
2023
+ """
2024
+
2025
+ name: str = proto.Field(
2026
+ proto.STRING,
2027
+ number=1,
2028
+ )
2029
+
2030
+
2031
+ class UpdateSettingsRequest(proto.Message):
2032
+ r"""The parameters to
2033
+ [UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings].
2034
+
2035
+ See `Enabling CMEK for Log
2036
+ Router <https://cloud.google.com/logging/docs/routing/managed-encryption>`__
2037
+ for more information.
2038
+
2039
+ Attributes:
2040
+ name (str):
2041
+ Required. The resource name for the settings to update.
2042
+
2043
+ ::
2044
+
2045
+ "organizations/[ORGANIZATION_ID]/settings"
2046
+
2047
+ For example:
2048
+
2049
+ ``"organizations/12345/settings"``
2050
+
2051
+ Note: Settings for the Log Router can currently only be
2052
+ configured for Google Cloud organizations. Once configured,
2053
+ it applies to all projects and folders in the Google Cloud
2054
+ organization.
2055
+ settings (google.cloud.logging_v2.types.Settings):
2056
+ Required. The settings to update.
2057
+
2058
+ See `Enabling CMEK for Log
2059
+ Router <https://cloud.google.com/logging/docs/routing/managed-encryption>`__
2060
+ for more information.
2061
+ update_mask (google.protobuf.field_mask_pb2.FieldMask):
2062
+ Optional. Field mask identifying which fields from
2063
+ ``settings`` should be updated. A field will be overwritten
2064
+ if and only if it is in the update mask. Output only fields
2065
+ cannot be updated.
2066
+
2067
+ See [FieldMask][google.protobuf.FieldMask] for more
2068
+ information.
2069
+
2070
+ For example: ``"updateMask=kmsKeyName"``
2071
+ """
2072
+
2073
+ name: str = proto.Field(
2074
+ proto.STRING,
2075
+ number=1,
2076
+ )
2077
+ settings: "Settings" = proto.Field(
2078
+ proto.MESSAGE,
2079
+ number=2,
2080
+ message="Settings",
2081
+ )
2082
+ update_mask: field_mask_pb2.FieldMask = proto.Field(
2083
+ proto.MESSAGE,
2084
+ number=3,
2085
+ message=field_mask_pb2.FieldMask,
2086
+ )
2087
+
2088
+
2089
+ class Settings(proto.Message):
2090
+ r"""Describes the settings associated with a project, folder,
2091
+ organization, billing account, or flexible resource.
2092
+
2093
+ Attributes:
2094
+ name (str):
2095
+ Output only. The resource name of the
2096
+ settings.
2097
+ kms_key_name (str):
2098
+ Optional. The resource name for the configured Cloud KMS
2099
+ key.
2100
+
2101
+ KMS key name format:
2102
+
2103
+ ::
2104
+
2105
+ "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
2106
+
2107
+ For example:
2108
+
2109
+ ``"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"``
2110
+
2111
+ To enable CMEK for the Log Router, set this field to a valid
2112
+ ``kms_key_name`` for which the associated service account
2113
+ has the required
2114
+ ``roles/cloudkms.cryptoKeyEncrypterDecrypter`` role assigned
2115
+ for the key.
2116
+
2117
+ The Cloud KMS key used by the Log Router can be updated by
2118
+ changing the ``kms_key_name`` to a new valid key name.
2119
+ Encryption operations that are in progress will be completed
2120
+ with the key that was in use when they started. Decryption
2121
+ operations will be completed using the key that was used at
2122
+ the time of encryption unless access to that key has been
2123
+ revoked.
2124
+
2125
+ To disable CMEK for the Log Router, set this field to an
2126
+ empty string.
2127
+
2128
+ See `Enabling CMEK for Log
2129
+ Router <https://cloud.google.com/logging/docs/routing/managed-encryption>`__
2130
+ for more information.
2131
+ kms_service_account_id (str):
2132
+ Output only. The service account that will be used by the
2133
+ Log Router to access your Cloud KMS key.
2134
+
2135
+ Before enabling CMEK for Log Router, you must first assign
2136
+ the role ``roles/cloudkms.cryptoKeyEncrypterDecrypter`` to
2137
+ the service account that the Log Router will use to access
2138
+ your Cloud KMS key. Use
2139
+ [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings]
2140
+ to obtain the service account ID.
2141
+
2142
+ See `Enabling CMEK for Log
2143
+ Router <https://cloud.google.com/logging/docs/routing/managed-encryption>`__
2144
+ for more information.
2145
+ storage_location (str):
2146
+ Optional. The Cloud region that will be used for \_Default
2147
+ and \_Required log buckets for newly created projects and
2148
+ folders. For example ``europe-west1``. This setting does not
2149
+ affect the location of custom log buckets.
2150
+ disable_default_sink (bool):
2151
+ Optional. If set to true, the \_Default sink in newly
2152
+ created projects and folders will created in a disabled
2153
+ state. This can be used to automatically disable log
2154
+ ingestion if there is already an aggregated sink configured
2155
+ in the hierarchy. The \_Default sink can be re-enabled
2156
+ manually if needed.
2157
+ """
2158
+
2159
+ name: str = proto.Field(
2160
+ proto.STRING,
2161
+ number=1,
2162
+ )
2163
+ kms_key_name: str = proto.Field(
2164
+ proto.STRING,
2165
+ number=2,
2166
+ )
2167
+ kms_service_account_id: str = proto.Field(
2168
+ proto.STRING,
2169
+ number=3,
2170
+ )
2171
+ storage_location: str = proto.Field(
2172
+ proto.STRING,
2173
+ number=4,
2174
+ )
2175
+ disable_default_sink: bool = proto.Field(
2176
+ proto.BOOL,
2177
+ number=5,
2178
+ )
2179
+
2180
+
2181
+ class CopyLogEntriesRequest(proto.Message):
2182
+ r"""The parameters to CopyLogEntries.
2183
+
2184
+ Attributes:
2185
+ name (str):
2186
+ Required. Log bucket from which to copy log entries.
2187
+
2188
+ For example:
2189
+
2190
+ ``"projects/my-project/locations/global/buckets/my-source-bucket"``
2191
+ filter (str):
2192
+ Optional. A filter specifying which log
2193
+ entries to copy. The filter must be no more than
2194
+ 20k characters. An empty filter matches all log
2195
+ entries.
2196
+ destination (str):
2197
+ Required. Destination to which to copy log
2198
+ entries.
2199
+ """
2200
+
2201
+ name: str = proto.Field(
2202
+ proto.STRING,
2203
+ number=1,
2204
+ )
2205
+ filter: str = proto.Field(
2206
+ proto.STRING,
2207
+ number=3,
2208
+ )
2209
+ destination: str = proto.Field(
2210
+ proto.STRING,
2211
+ number=4,
2212
+ )
2213
+
2214
+
2215
+ class CopyLogEntriesMetadata(proto.Message):
2216
+ r"""Metadata for CopyLogEntries long running operations.
2217
+
2218
+ Attributes:
2219
+ start_time (google.protobuf.timestamp_pb2.Timestamp):
2220
+ The create time of an operation.
2221
+ end_time (google.protobuf.timestamp_pb2.Timestamp):
2222
+ The end time of an operation.
2223
+ state (google.cloud.logging_v2.types.OperationState):
2224
+ State of an operation.
2225
+ cancellation_requested (bool):
2226
+ Identifies whether the user has requested
2227
+ cancellation of the operation.
2228
+ request (google.cloud.logging_v2.types.CopyLogEntriesRequest):
2229
+ CopyLogEntries RPC request.
2230
+ progress (int):
2231
+ Estimated progress of the operation (0 -
2232
+ 100%).
2233
+ writer_identity (str):
2234
+ The IAM identity of a service account that must be granted
2235
+ access to the destination.
2236
+
2237
+ If the service account is not granted permission to the
2238
+ destination within an hour, the operation will be cancelled.
2239
+
2240
+ For example: ``"serviceAccount:foo@bar.com"``
2241
+ """
2242
+
2243
+ start_time: timestamp_pb2.Timestamp = proto.Field(
2244
+ proto.MESSAGE,
2245
+ number=1,
2246
+ message=timestamp_pb2.Timestamp,
2247
+ )
2248
+ end_time: timestamp_pb2.Timestamp = proto.Field(
2249
+ proto.MESSAGE,
2250
+ number=2,
2251
+ message=timestamp_pb2.Timestamp,
2252
+ )
2253
+ state: "OperationState" = proto.Field(
2254
+ proto.ENUM,
2255
+ number=3,
2256
+ enum="OperationState",
2257
+ )
2258
+ cancellation_requested: bool = proto.Field(
2259
+ proto.BOOL,
2260
+ number=4,
2261
+ )
2262
+ request: "CopyLogEntriesRequest" = proto.Field(
2263
+ proto.MESSAGE,
2264
+ number=5,
2265
+ message="CopyLogEntriesRequest",
2266
+ )
2267
+ progress: int = proto.Field(
2268
+ proto.INT32,
2269
+ number=6,
2270
+ )
2271
+ writer_identity: str = proto.Field(
2272
+ proto.STRING,
2273
+ number=7,
2274
+ )
2275
+
2276
+
2277
+ class CopyLogEntriesResponse(proto.Message):
2278
+ r"""Response type for CopyLogEntries long running operations.
2279
+
2280
+ Attributes:
2281
+ log_entries_copied_count (int):
2282
+ Number of log entries copied.
2283
+ """
2284
+
2285
+ log_entries_copied_count: int = proto.Field(
2286
+ proto.INT64,
2287
+ number=1,
2288
+ )
2289
+
2290
+
2291
+ class BucketMetadata(proto.Message):
2292
+ r"""Metadata for LongRunningUpdateBucket Operations.
2293
+
2294
+ This message has `oneof`_ fields (mutually exclusive fields).
2295
+ For each oneof, at most one member field can be set at the same time.
2296
+ Setting any member of the oneof automatically clears all other
2297
+ members.
2298
+
2299
+ .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
2300
+
2301
+ Attributes:
2302
+ start_time (google.protobuf.timestamp_pb2.Timestamp):
2303
+ The create time of an operation.
2304
+ end_time (google.protobuf.timestamp_pb2.Timestamp):
2305
+ The end time of an operation.
2306
+ state (google.cloud.logging_v2.types.OperationState):
2307
+ State of an operation.
2308
+ create_bucket_request (google.cloud.logging_v2.types.CreateBucketRequest):
2309
+ LongRunningCreateBucket RPC request.
2310
+
2311
+ This field is a member of `oneof`_ ``request``.
2312
+ update_bucket_request (google.cloud.logging_v2.types.UpdateBucketRequest):
2313
+ LongRunningUpdateBucket RPC request.
2314
+
2315
+ This field is a member of `oneof`_ ``request``.
2316
+ """
2317
+
2318
+ start_time: timestamp_pb2.Timestamp = proto.Field(
2319
+ proto.MESSAGE,
2320
+ number=1,
2321
+ message=timestamp_pb2.Timestamp,
2322
+ )
2323
+ end_time: timestamp_pb2.Timestamp = proto.Field(
2324
+ proto.MESSAGE,
2325
+ number=2,
2326
+ message=timestamp_pb2.Timestamp,
2327
+ )
2328
+ state: "OperationState" = proto.Field(
2329
+ proto.ENUM,
2330
+ number=3,
2331
+ enum="OperationState",
2332
+ )
2333
+ create_bucket_request: "CreateBucketRequest" = proto.Field(
2334
+ proto.MESSAGE,
2335
+ number=4,
2336
+ oneof="request",
2337
+ message="CreateBucketRequest",
2338
+ )
2339
+ update_bucket_request: "UpdateBucketRequest" = proto.Field(
2340
+ proto.MESSAGE,
2341
+ number=5,
2342
+ oneof="request",
2343
+ message="UpdateBucketRequest",
2344
+ )
2345
+
2346
+
2347
+ class LinkMetadata(proto.Message):
2348
+ r"""Metadata for long running Link operations.
2349
+
2350
+ This message has `oneof`_ fields (mutually exclusive fields).
2351
+ For each oneof, at most one member field can be set at the same time.
2352
+ Setting any member of the oneof automatically clears all other
2353
+ members.
2354
+
2355
+ .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
2356
+
2357
+ Attributes:
2358
+ start_time (google.protobuf.timestamp_pb2.Timestamp):
2359
+ The start time of an operation.
2360
+ end_time (google.protobuf.timestamp_pb2.Timestamp):
2361
+ The end time of an operation.
2362
+ state (google.cloud.logging_v2.types.OperationState):
2363
+ State of an operation.
2364
+ create_link_request (google.cloud.logging_v2.types.CreateLinkRequest):
2365
+ CreateLink RPC request.
2366
+
2367
+ This field is a member of `oneof`_ ``request``.
2368
+ delete_link_request (google.cloud.logging_v2.types.DeleteLinkRequest):
2369
+ DeleteLink RPC request.
2370
+
2371
+ This field is a member of `oneof`_ ``request``.
2372
+ """
2373
+
2374
+ start_time: timestamp_pb2.Timestamp = proto.Field(
2375
+ proto.MESSAGE,
2376
+ number=1,
2377
+ message=timestamp_pb2.Timestamp,
2378
+ )
2379
+ end_time: timestamp_pb2.Timestamp = proto.Field(
2380
+ proto.MESSAGE,
2381
+ number=2,
2382
+ message=timestamp_pb2.Timestamp,
2383
+ )
2384
+ state: "OperationState" = proto.Field(
2385
+ proto.ENUM,
2386
+ number=3,
2387
+ enum="OperationState",
2388
+ )
2389
+ create_link_request: "CreateLinkRequest" = proto.Field(
2390
+ proto.MESSAGE,
2391
+ number=4,
2392
+ oneof="request",
2393
+ message="CreateLinkRequest",
2394
+ )
2395
+ delete_link_request: "DeleteLinkRequest" = proto.Field(
2396
+ proto.MESSAGE,
2397
+ number=5,
2398
+ oneof="request",
2399
+ message="DeleteLinkRequest",
2400
+ )
2401
+
2402
+
2403
+ class LocationMetadata(proto.Message):
2404
+ r"""Cloud Logging specific location metadata.
2405
+
2406
+ Attributes:
2407
+ log_analytics_enabled (bool):
2408
+ Indicates whether or not Log Analytics
2409
+ features are supported in the given location.
2410
+ """
2411
+
2412
+ log_analytics_enabled: bool = proto.Field(
2413
+ proto.BOOL,
2414
+ number=1,
2415
+ )
2416
+
2417
+
2418
+ __all__ = tuple(sorted(__protobuf__.manifest))