Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/google/cloud/logging_v2/types/logging_config.py: 98%
187 statements
« prev ^ index » next coverage.py v7.2.2, created at 2023-03-26 07:30 +0000
« prev ^ index » next coverage.py v7.2.2, created at 2023-03-26 07:30 +0000
1# -*- coding: utf-8 -*-
2# Copyright 2022 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#
16from typing import MutableMapping, MutableSequence
18import proto # type: ignore
20from google.protobuf import field_mask_pb2 # type: ignore
21from google.protobuf import timestamp_pb2 # type: ignore
24__protobuf__ = proto.module(
25 package="google.logging.v2",
26 manifest={
27 "LifecycleState",
28 "OperationState",
29 "LogBucket",
30 "LogView",
31 "LogSink",
32 "BigQueryOptions",
33 "ListBucketsRequest",
34 "ListBucketsResponse",
35 "CreateBucketRequest",
36 "UpdateBucketRequest",
37 "GetBucketRequest",
38 "DeleteBucketRequest",
39 "UndeleteBucketRequest",
40 "ListViewsRequest",
41 "ListViewsResponse",
42 "CreateViewRequest",
43 "UpdateViewRequest",
44 "GetViewRequest",
45 "DeleteViewRequest",
46 "ListSinksRequest",
47 "ListSinksResponse",
48 "GetSinkRequest",
49 "CreateSinkRequest",
50 "UpdateSinkRequest",
51 "DeleteSinkRequest",
52 "LogExclusion",
53 "ListExclusionsRequest",
54 "ListExclusionsResponse",
55 "GetExclusionRequest",
56 "CreateExclusionRequest",
57 "UpdateExclusionRequest",
58 "DeleteExclusionRequest",
59 "GetCmekSettingsRequest",
60 "UpdateCmekSettingsRequest",
61 "CmekSettings",
62 "GetSettingsRequest",
63 "UpdateSettingsRequest",
64 "Settings",
65 "CopyLogEntriesRequest",
66 "CopyLogEntriesMetadata",
67 "CopyLogEntriesResponse",
68 },
69)
72class LifecycleState(proto.Enum):
73 r"""LogBucket lifecycle states.
75 Values:
76 LIFECYCLE_STATE_UNSPECIFIED (0):
77 Unspecified state. This is only used/useful
78 for distinguishing unset values.
79 ACTIVE (1):
80 The normal and active state.
81 DELETE_REQUESTED (2):
82 The resource has been marked for deletion by
83 the user. For some resources (e.g. buckets),
84 this can be reversed by an un-delete operation.
85 """
86 LIFECYCLE_STATE_UNSPECIFIED = 0
87 ACTIVE = 1
88 DELETE_REQUESTED = 2
91class OperationState(proto.Enum):
92 r"""List of different operation states.
93 High level state of the operation. This is used to report the
94 job's current state to the user. Once a long running operation
95 is created, the current state of the operation can be queried
96 even before the operation is finished and the final result is
97 available.
99 Values:
100 OPERATION_STATE_UNSPECIFIED (0):
101 Should not be used.
102 OPERATION_STATE_SCHEDULED (1):
103 The operation is scheduled.
104 OPERATION_STATE_WAITING_FOR_PERMISSIONS (2):
105 Waiting for necessary permissions.
106 OPERATION_STATE_RUNNING (3):
107 The operation is running.
108 OPERATION_STATE_SUCCEEDED (4):
109 The operation was completed successfully.
110 OPERATION_STATE_FAILED (5):
111 The operation failed.
112 OPERATION_STATE_CANCELLED (6):
113 The operation was cancelled by the user.
114 """
115 OPERATION_STATE_UNSPECIFIED = 0
116 OPERATION_STATE_SCHEDULED = 1
117 OPERATION_STATE_WAITING_FOR_PERMISSIONS = 2
118 OPERATION_STATE_RUNNING = 3
119 OPERATION_STATE_SUCCEEDED = 4
120 OPERATION_STATE_FAILED = 5
121 OPERATION_STATE_CANCELLED = 6
124class LogBucket(proto.Message):
125 r"""Describes a repository in which log entries are stored.
127 Attributes:
128 name (str):
129 Output only. The resource name of the bucket.
131 For example:
133 ``projects/my-project/locations/global/buckets/my-bucket``
135 For a list of supported locations, see `Supported
136 Regions <https://cloud.google.com/logging/docs/region-support>`__
138 For the location of ``global`` it is unspecified where log
139 entries are actually stored.
141 After a bucket has been created, the location cannot be
142 changed.
143 description (str):
144 Describes this bucket.
145 create_time (google.protobuf.timestamp_pb2.Timestamp):
146 Output only. The creation timestamp of the
147 bucket. This is not set for any of the default
148 buckets.
149 update_time (google.protobuf.timestamp_pb2.Timestamp):
150 Output only. The last update timestamp of the
151 bucket.
152 retention_days (int):
153 Logs will be retained by default for this
154 amount of time, after which they will
155 automatically be deleted. The minimum retention
156 period is 1 day. If this value is set to zero at
157 bucket creation time, the default time of 30
158 days will be used.
159 locked (bool):
160 Whether the bucket is locked.
161 The retention period on a locked bucket cannot
162 be changed. Locked buckets may only be deleted
163 if they are empty.
164 lifecycle_state (google.cloud.logging_v2.types.LifecycleState):
165 Output only. The bucket lifecycle state.
166 restricted_fields (MutableSequence[str]):
167 Log entry field paths that are denied access in this bucket.
169 The following fields and their children are eligible:
170 ``textPayload``, ``jsonPayload``, ``protoPayload``,
171 ``httpRequest``, ``labels``, ``sourceLocation``.
173 Restricting a repeated field will restrict all values.
174 Adding a parent will block all child fields. (e.g.
175 ``foo.bar`` will block ``foo.bar.baz``)
176 cmek_settings (google.cloud.logging_v2.types.CmekSettings):
177 The CMEK settings of the log bucket. If
178 present, new log entries written to this log
179 bucket are encrypted using the CMEK key provided
180 in this configuration. If a log bucket has CMEK
181 settings, the CMEK settings cannot be disabled
182 later by updating the log bucket. Changing the
183 KMS key is allowed.
184 """
186 name: str = proto.Field(
187 proto.STRING,
188 number=1,
189 )
190 description: str = proto.Field(
191 proto.STRING,
192 number=3,
193 )
194 create_time: timestamp_pb2.Timestamp = proto.Field(
195 proto.MESSAGE,
196 number=4,
197 message=timestamp_pb2.Timestamp,
198 )
199 update_time: timestamp_pb2.Timestamp = proto.Field(
200 proto.MESSAGE,
201 number=5,
202 message=timestamp_pb2.Timestamp,
203 )
204 retention_days: int = proto.Field(
205 proto.INT32,
206 number=11,
207 )
208 locked: bool = proto.Field(
209 proto.BOOL,
210 number=9,
211 )
212 lifecycle_state: "LifecycleState" = proto.Field(
213 proto.ENUM,
214 number=12,
215 enum="LifecycleState",
216 )
217 restricted_fields: MutableSequence[str] = proto.RepeatedField(
218 proto.STRING,
219 number=15,
220 )
221 cmek_settings: "CmekSettings" = proto.Field(
222 proto.MESSAGE,
223 number=19,
224 message="CmekSettings",
225 )
228class LogView(proto.Message):
229 r"""Describes a view over log entries in a bucket.
231 Attributes:
232 name (str):
233 The resource name of the view.
235 For example:
237 ``projects/my-project/locations/global/buckets/my-bucket/views/my-view``
238 description (str):
239 Describes this view.
240 create_time (google.protobuf.timestamp_pb2.Timestamp):
241 Output only. The creation timestamp of the
242 view.
243 update_time (google.protobuf.timestamp_pb2.Timestamp):
244 Output only. The last update timestamp of the
245 view.
246 filter (str):
247 Filter that restricts which log entries in a bucket are
248 visible in this view.
250 Filters are restricted to be a logical AND of ==/!= of any
251 of the following:
253 - originating project/folder/organization/billing account.
254 - resource type
255 - log id
257 For example:
259 SOURCE("projects/myproject") AND resource.type =
260 "gce_instance" AND LOG_ID("stdout")
261 """
263 name: str = proto.Field(
264 proto.STRING,
265 number=1,
266 )
267 description: str = proto.Field(
268 proto.STRING,
269 number=3,
270 )
271 create_time: timestamp_pb2.Timestamp = proto.Field(
272 proto.MESSAGE,
273 number=4,
274 message=timestamp_pb2.Timestamp,
275 )
276 update_time: timestamp_pb2.Timestamp = proto.Field(
277 proto.MESSAGE,
278 number=5,
279 message=timestamp_pb2.Timestamp,
280 )
281 filter: str = proto.Field(
282 proto.STRING,
283 number=7,
284 )
287class LogSink(proto.Message):
288 r"""Describes a sink used to export log entries to one of the
289 following destinations in any project: a Cloud Storage bucket, a
290 BigQuery dataset, a Pub/Sub topic or a Cloud Logging log bucket.
291 A logs filter controls which log entries are exported. The sink
292 must be created within a project, organization, billing account,
293 or folder.
296 .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
298 Attributes:
299 name (str):
300 Required. The client-assigned sink identifier, unique within
301 the project.
303 For example: ``"my-syslog-errors-to-pubsub"``. Sink
304 identifiers are limited to 100 characters and can include
305 only the following characters: upper and lower-case
306 alphanumeric characters, underscores, hyphens, and periods.
307 First character has to be alphanumeric.
308 destination (str):
309 Required. The export destination:
311 ::
313 "storage.googleapis.com/[GCS_BUCKET]"
314 "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
315 "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
317 The sink's ``writer_identity``, set when the sink is
318 created, must have permission to write to the destination or
319 else the log entries are not exported. For more information,
320 see `Exporting Logs with
321 Sinks <https://cloud.google.com/logging/docs/api/tasks/exporting-logs>`__.
322 filter (str):
323 Optional. An `advanced logs
324 filter <https://cloud.google.com/logging/docs/view/advanced-queries>`__.
325 The only exported log entries are those that are in the
326 resource owning the sink and that match the filter.
328 For example:
330 ``logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR``
331 description (str):
332 Optional. A description of this sink.
333 The maximum length of the description is 8000
334 characters.
335 disabled (bool):
336 Optional. If set to true, then this sink is
337 disabled and it does not export any log entries.
338 exclusions (MutableSequence[google.cloud.logging_v2.types.LogExclusion]):
339 Optional. Log entries that match any of these exclusion
340 filters will not be exported.
342 If a log entry is matched by both ``filter`` and one of
343 ``exclusion_filters`` it will not be exported.
344 output_version_format (google.cloud.logging_v2.types.LogSink.VersionFormat):
345 Deprecated. This field is unused.
346 writer_identity (str):
347 Output only. An IAM identity—a service account or
348 group—under which Cloud Logging writes the exported log
349 entries to the sink's destination. This field is set by
350 [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink]
351 and
352 [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink]
353 based on the value of ``unique_writer_identity`` in those
354 methods.
356 Until you grant this identity write-access to the
357 destination, log entry exports from this sink will fail. For
358 more information, see `Granting Access for a
359 Resource <https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource>`__.
360 Consult the destination service's documentation to determine
361 the appropriate IAM roles to assign to the identity.
363 Sinks that have a destination that is a log bucket in the
364 same project as the sink do not have a writer_identity and
365 no additional permissions are required.
366 include_children (bool):
367 Optional. This field applies only to sinks owned by
368 organizations and folders. If the field is false, the
369 default, only the logs owned by the sink's parent resource
370 are available for export. If the field is true, then log
371 entries from all the projects, folders, and billing accounts
372 contained in the sink's parent resource are also available
373 for export. Whether a particular log entry from the children
374 is exported depends on the sink's filter expression.
376 For example, if this field is true, then the filter
377 ``resource.type=gce_instance`` would export all Compute
378 Engine VM instance log entries from all projects in the
379 sink's parent.
381 To only export entries from certain child projects, filter
382 on the project part of the log name:
384 logName:("projects/test-project1/" OR
385 "projects/test-project2/") AND resource.type=gce_instance
386 bigquery_options (google.cloud.logging_v2.types.BigQueryOptions):
387 Optional. Options that affect sinks exporting
388 data to BigQuery.
390 This field is a member of `oneof`_ ``options``.
391 create_time (google.protobuf.timestamp_pb2.Timestamp):
392 Output only. The creation timestamp of the
393 sink.
394 This field may not be present for older sinks.
395 update_time (google.protobuf.timestamp_pb2.Timestamp):
396 Output only. The last update timestamp of the
397 sink.
398 This field may not be present for older sinks.
399 """
401 class VersionFormat(proto.Enum):
402 r"""Deprecated. This is unused.
404 Values:
405 VERSION_FORMAT_UNSPECIFIED (0):
406 An unspecified format version that will
407 default to V2.
408 V2 (1):
409 ``LogEntry`` version 2 format.
410 V1 (2):
411 ``LogEntry`` version 1 format.
412 """
413 VERSION_FORMAT_UNSPECIFIED = 0
414 V2 = 1
415 V1 = 2
417 name: str = proto.Field(
418 proto.STRING,
419 number=1,
420 )
421 destination: str = proto.Field(
422 proto.STRING,
423 number=3,
424 )
425 filter: str = proto.Field(
426 proto.STRING,
427 number=5,
428 )
429 description: str = proto.Field(
430 proto.STRING,
431 number=18,
432 )
433 disabled: bool = proto.Field(
434 proto.BOOL,
435 number=19,
436 )
437 exclusions: MutableSequence["LogExclusion"] = proto.RepeatedField(
438 proto.MESSAGE,
439 number=16,
440 message="LogExclusion",
441 )
442 output_version_format: VersionFormat = proto.Field(
443 proto.ENUM,
444 number=6,
445 enum=VersionFormat,
446 )
447 writer_identity: str = proto.Field(
448 proto.STRING,
449 number=8,
450 )
451 include_children: bool = proto.Field(
452 proto.BOOL,
453 number=9,
454 )
455 bigquery_options: "BigQueryOptions" = proto.Field(
456 proto.MESSAGE,
457 number=12,
458 oneof="options",
459 message="BigQueryOptions",
460 )
461 create_time: timestamp_pb2.Timestamp = proto.Field(
462 proto.MESSAGE,
463 number=13,
464 message=timestamp_pb2.Timestamp,
465 )
466 update_time: timestamp_pb2.Timestamp = proto.Field(
467 proto.MESSAGE,
468 number=14,
469 message=timestamp_pb2.Timestamp,
470 )
473class BigQueryOptions(proto.Message):
474 r"""Options that change functionality of a sink exporting data to
475 BigQuery.
477 Attributes:
478 use_partitioned_tables (bool):
479 Optional. Whether to use `BigQuery's partition
480 tables <https://cloud.google.com/bigquery/docs/partitioned-tables>`__.
481 By default, Cloud Logging creates dated tables based on the
482 log entries' timestamps, e.g. syslog_20170523. With
483 partitioned tables the date suffix is no longer present and
484 `special query
485 syntax <https://cloud.google.com/bigquery/docs/querying-partitioned-tables>`__
486 has to be used instead. In both cases, tables are sharded
487 based on UTC timezone.
488 uses_timestamp_column_partitioning (bool):
489 Output only. True if new timestamp column based partitioning
490 is in use, false if legacy ingestion-time partitioning is in
491 use.
493 All new sinks will have this field set true and will use
494 timestamp column based partitioning. If
495 use_partitioned_tables is false, this value has no meaning
496 and will be false. Legacy sinks using partitioned tables
497 will have this field set to false.
498 """
500 use_partitioned_tables: bool = proto.Field(
501 proto.BOOL,
502 number=1,
503 )
504 uses_timestamp_column_partitioning: bool = proto.Field(
505 proto.BOOL,
506 number=3,
507 )
510class ListBucketsRequest(proto.Message):
511 r"""The parameters to ``ListBuckets``.
513 Attributes:
514 parent (str):
515 Required. The parent resource whose buckets are to be
516 listed:
518 ::
520 "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
521 "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
522 "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
523 "folders/[FOLDER_ID]/locations/[LOCATION_ID]"
525 Note: The locations portion of the resource must be
526 specified, but supplying the character ``-`` in place of
527 [LOCATION_ID] will return all buckets.
528 page_token (str):
529 Optional. If present, then retrieve the next batch of
530 results from the preceding call to this method.
531 ``pageToken`` must be the value of ``nextPageToken`` from
532 the previous response. The values of other method parameters
533 should be identical to those in the previous call.
534 page_size (int):
535 Optional. The maximum number of results to return from this
536 request. Non-positive values are ignored. The presence of
537 ``nextPageToken`` in the response indicates that more
538 results might be available.
539 """
541 parent: str = proto.Field(
542 proto.STRING,
543 number=1,
544 )
545 page_token: str = proto.Field(
546 proto.STRING,
547 number=2,
548 )
549 page_size: int = proto.Field(
550 proto.INT32,
551 number=3,
552 )
555class ListBucketsResponse(proto.Message):
556 r"""The response from ListBuckets.
558 Attributes:
559 buckets (MutableSequence[google.cloud.logging_v2.types.LogBucket]):
560 A list of buckets.
561 next_page_token (str):
562 If there might be more results than appear in this response,
563 then ``nextPageToken`` is included. To get the next set of
564 results, call the same method again using the value of
565 ``nextPageToken`` as ``pageToken``.
566 """
568 @property
569 def raw_page(self):
570 return self
572 buckets: MutableSequence["LogBucket"] = proto.RepeatedField(
573 proto.MESSAGE,
574 number=1,
575 message="LogBucket",
576 )
577 next_page_token: str = proto.Field(
578 proto.STRING,
579 number=2,
580 )
583class CreateBucketRequest(proto.Message):
584 r"""The parameters to ``CreateBucket``.
586 Attributes:
587 parent (str):
588 Required. The resource in which to create the log bucket:
590 ::
592 "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
594 For example:
596 ``"projects/my-project/locations/global"``
597 bucket_id (str):
598 Required. A client-assigned identifier such as
599 ``"my-bucket"``. Identifiers are limited to 100 characters
600 and can include only letters, digits, underscores, hyphens,
601 and periods.
602 bucket (google.cloud.logging_v2.types.LogBucket):
603 Required. The new bucket. The region
604 specified in the new bucket must be compliant
605 with any Location Restriction Org Policy. The
606 name field in the bucket is ignored.
607 """
609 parent: str = proto.Field(
610 proto.STRING,
611 number=1,
612 )
613 bucket_id: str = proto.Field(
614 proto.STRING,
615 number=2,
616 )
617 bucket: "LogBucket" = proto.Field(
618 proto.MESSAGE,
619 number=3,
620 message="LogBucket",
621 )
624class UpdateBucketRequest(proto.Message):
625 r"""The parameters to ``UpdateBucket``.
627 Attributes:
628 name (str):
629 Required. The full resource name of the bucket to update.
631 ::
633 "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
634 "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
635 "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
636 "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
638 For example:
640 ``"projects/my-project/locations/global/buckets/my-bucket"``
641 bucket (google.cloud.logging_v2.types.LogBucket):
642 Required. The updated bucket.
643 update_mask (google.protobuf.field_mask_pb2.FieldMask):
644 Required. Field mask that specifies the fields in ``bucket``
645 that need an update. A bucket field will be overwritten if,
646 and only if, it is in the update mask. ``name`` and output
647 only fields cannot be updated.
649 For a detailed ``FieldMask`` definition, see:
650 https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
652 For example: ``updateMask=retention_days``
653 """
655 name: str = proto.Field(
656 proto.STRING,
657 number=1,
658 )
659 bucket: "LogBucket" = proto.Field(
660 proto.MESSAGE,
661 number=2,
662 message="LogBucket",
663 )
664 update_mask: field_mask_pb2.FieldMask = proto.Field(
665 proto.MESSAGE,
666 number=4,
667 message=field_mask_pb2.FieldMask,
668 )
671class GetBucketRequest(proto.Message):
672 r"""The parameters to ``GetBucket``.
674 Attributes:
675 name (str):
676 Required. The resource name of the bucket:
678 ::
680 "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
681 "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
682 "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
683 "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
685 For example:
687 ``"projects/my-project/locations/global/buckets/my-bucket"``
688 """
690 name: str = proto.Field(
691 proto.STRING,
692 number=1,
693 )
696class DeleteBucketRequest(proto.Message):
697 r"""The parameters to ``DeleteBucket``.
699 Attributes:
700 name (str):
701 Required. The full resource name of the bucket to delete.
703 ::
705 "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
706 "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
707 "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
708 "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
710 For example:
712 ``"projects/my-project/locations/global/buckets/my-bucket"``
713 """
715 name: str = proto.Field(
716 proto.STRING,
717 number=1,
718 )
721class UndeleteBucketRequest(proto.Message):
722 r"""The parameters to ``UndeleteBucket``.
724 Attributes:
725 name (str):
726 Required. The full resource name of the bucket to undelete.
728 ::
730 "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
731 "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
732 "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
733 "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
735 For example:
737 ``"projects/my-project/locations/global/buckets/my-bucket"``
738 """
740 name: str = proto.Field(
741 proto.STRING,
742 number=1,
743 )
746class ListViewsRequest(proto.Message):
747 r"""The parameters to ``ListViews``.
749 Attributes:
750 parent (str):
751 Required. The bucket whose views are to be listed:
753 ::
755 "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]".
756 page_token (str):
757 Optional. If present, then retrieve the next batch of
758 results from the preceding call to this method.
759 ``pageToken`` must be the value of ``nextPageToken`` from
760 the previous response. The values of other method parameters
761 should be identical to those in the previous call.
762 page_size (int):
763 Optional. The maximum number of results to return from this
764 request.
766 Non-positive values are ignored. The presence of
767 ``nextPageToken`` in the response indicates that more
768 results might be available.
769 """
771 parent: str = proto.Field(
772 proto.STRING,
773 number=1,
774 )
775 page_token: str = proto.Field(
776 proto.STRING,
777 number=2,
778 )
779 page_size: int = proto.Field(
780 proto.INT32,
781 number=3,
782 )
785class ListViewsResponse(proto.Message):
786 r"""The response from ListViews.
788 Attributes:
789 views (MutableSequence[google.cloud.logging_v2.types.LogView]):
790 A list of views.
791 next_page_token (str):
792 If there might be more results than appear in this response,
793 then ``nextPageToken`` is included. To get the next set of
794 results, call the same method again using the value of
795 ``nextPageToken`` as ``pageToken``.
796 """
798 @property
799 def raw_page(self):
800 return self
802 views: MutableSequence["LogView"] = proto.RepeatedField(
803 proto.MESSAGE,
804 number=1,
805 message="LogView",
806 )
807 next_page_token: str = proto.Field(
808 proto.STRING,
809 number=2,
810 )
813class CreateViewRequest(proto.Message):
814 r"""The parameters to ``CreateView``.
816 Attributes:
817 parent (str):
818 Required. The bucket in which to create the view
820 ::
822 `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"`
824 For example:
826 ``"projects/my-project/locations/global/buckets/my-bucket"``
827 view_id (str):
828 Required. The id to use for this view.
829 view (google.cloud.logging_v2.types.LogView):
830 Required. The new view.
831 """
833 parent: str = proto.Field(
834 proto.STRING,
835 number=1,
836 )
837 view_id: str = proto.Field(
838 proto.STRING,
839 number=2,
840 )
841 view: "LogView" = proto.Field(
842 proto.MESSAGE,
843 number=3,
844 message="LogView",
845 )
848class UpdateViewRequest(proto.Message):
849 r"""The parameters to ``UpdateView``.
851 Attributes:
852 name (str):
853 Required. The full resource name of the view to update
855 ::
857 "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
859 For example:
861 ``"projects/my-project/locations/global/buckets/my-bucket/views/my-view"``
862 view (google.cloud.logging_v2.types.LogView):
863 Required. The updated view.
864 update_mask (google.protobuf.field_mask_pb2.FieldMask):
865 Optional. Field mask that specifies the fields in ``view``
866 that need an update. A field will be overwritten if, and
867 only if, it is in the update mask. ``name`` and output only
868 fields cannot be updated.
870 For a detailed ``FieldMask`` definition, see
871 https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
873 For example: ``updateMask=filter``
874 """
876 name: str = proto.Field(
877 proto.STRING,
878 number=1,
879 )
880 view: "LogView" = proto.Field(
881 proto.MESSAGE,
882 number=2,
883 message="LogView",
884 )
885 update_mask: field_mask_pb2.FieldMask = proto.Field(
886 proto.MESSAGE,
887 number=4,
888 message=field_mask_pb2.FieldMask,
889 )
892class GetViewRequest(proto.Message):
893 r"""The parameters to ``GetView``.
895 Attributes:
896 name (str):
897 Required. The resource name of the policy:
899 ::
901 "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
903 For example:
905 ``"projects/my-project/locations/global/buckets/my-bucket/views/my-view"``
906 """
908 name: str = proto.Field(
909 proto.STRING,
910 number=1,
911 )
914class DeleteViewRequest(proto.Message):
915 r"""The parameters to ``DeleteView``.
917 Attributes:
918 name (str):
919 Required. The full resource name of the view to delete:
921 ::
923 "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
925 For example:
927 ::
929 `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
930 """
932 name: str = proto.Field(
933 proto.STRING,
934 number=1,
935 )
938class ListSinksRequest(proto.Message):
939 r"""The parameters to ``ListSinks``.
941 Attributes:
942 parent (str):
943 Required. The parent resource whose sinks are to be listed:
945 ::
947 "projects/[PROJECT_ID]"
948 "organizations/[ORGANIZATION_ID]"
949 "billingAccounts/[BILLING_ACCOUNT_ID]"
950 "folders/[FOLDER_ID]".
951 page_token (str):
952 Optional. If present, then retrieve the next batch of
953 results from the preceding call to this method.
954 ``pageToken`` must be the value of ``nextPageToken`` from
955 the previous response. The values of other method parameters
956 should be identical to those in the previous call.
957 page_size (int):
958 Optional. The maximum number of results to return from this
959 request. Non-positive values are ignored. The presence of
960 ``nextPageToken`` in the response indicates that more
961 results might be available.
962 """
964 parent: str = proto.Field(
965 proto.STRING,
966 number=1,
967 )
968 page_token: str = proto.Field(
969 proto.STRING,
970 number=2,
971 )
972 page_size: int = proto.Field(
973 proto.INT32,
974 number=3,
975 )
978class ListSinksResponse(proto.Message):
979 r"""Result returned from ``ListSinks``.
981 Attributes:
982 sinks (MutableSequence[google.cloud.logging_v2.types.LogSink]):
983 A list of sinks.
984 next_page_token (str):
985 If there might be more results than appear in this response,
986 then ``nextPageToken`` is included. To get the next set of
987 results, call the same method again using the value of
988 ``nextPageToken`` as ``pageToken``.
989 """
991 @property
992 def raw_page(self):
993 return self
995 sinks: MutableSequence["LogSink"] = proto.RepeatedField(
996 proto.MESSAGE,
997 number=1,
998 message="LogSink",
999 )
1000 next_page_token: str = proto.Field(
1001 proto.STRING,
1002 number=2,
1003 )
1006class GetSinkRequest(proto.Message):
1007 r"""The parameters to ``GetSink``.
1009 Attributes:
1010 sink_name (str):
1011 Required. The resource name of the sink:
1013 ::
1015 "projects/[PROJECT_ID]/sinks/[SINK_ID]"
1016 "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
1017 "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
1018 "folders/[FOLDER_ID]/sinks/[SINK_ID]"
1020 For example:
1022 ``"projects/my-project/sinks/my-sink"``
1023 """
1025 sink_name: str = proto.Field(
1026 proto.STRING,
1027 number=1,
1028 )
1031class CreateSinkRequest(proto.Message):
1032 r"""The parameters to ``CreateSink``.
1034 Attributes:
1035 parent (str):
1036 Required. The resource in which to create the sink:
1038 ::
1040 "projects/[PROJECT_ID]"
1041 "organizations/[ORGANIZATION_ID]"
1042 "billingAccounts/[BILLING_ACCOUNT_ID]"
1043 "folders/[FOLDER_ID]"
1045 For examples:
1047 ``"projects/my-project"`` ``"organizations/123456789"``
1048 sink (google.cloud.logging_v2.types.LogSink):
1049 Required. The new sink, whose ``name`` parameter is a sink
1050 identifier that is not already in use.
1051 unique_writer_identity (bool):
1052 Optional. Determines the kind of IAM identity returned as
1053 ``writer_identity`` in the new sink. If this value is
1054 omitted or set to false, and if the sink's parent is a
1055 project, then the value returned as ``writer_identity`` is
1056 the same group or service account used by Cloud Logging
1057 before the addition of writer identities to this API. The
1058 sink's destination must be in the same project as the sink
1059 itself.
1061 If this field is set to true, or if the sink is owned by a
1062 non-project resource such as an organization, then the value
1063 of ``writer_identity`` will be a unique service account used
1064 only for exports from the new sink. For more information,
1065 see ``writer_identity`` in
1066 [LogSink][google.logging.v2.LogSink].
1067 """
1069 parent: str = proto.Field(
1070 proto.STRING,
1071 number=1,
1072 )
1073 sink: "LogSink" = proto.Field(
1074 proto.MESSAGE,
1075 number=2,
1076 message="LogSink",
1077 )
1078 unique_writer_identity: bool = proto.Field(
1079 proto.BOOL,
1080 number=3,
1081 )
1084class UpdateSinkRequest(proto.Message):
1085 r"""The parameters to ``UpdateSink``.
1087 Attributes:
1088 sink_name (str):
1089 Required. The full resource name of the sink to update,
1090 including the parent resource and the sink identifier:
1092 ::
1094 "projects/[PROJECT_ID]/sinks/[SINK_ID]"
1095 "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
1096 "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
1097 "folders/[FOLDER_ID]/sinks/[SINK_ID]"
1099 For example:
1101 ``"projects/my-project/sinks/my-sink"``
1102 sink (google.cloud.logging_v2.types.LogSink):
1103 Required. The updated sink, whose name is the same
1104 identifier that appears as part of ``sink_name``.
1105 unique_writer_identity (bool):
1106 Optional. See
1107 [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink]
1108 for a description of this field. When updating a sink, the
1109 effect of this field on the value of ``writer_identity`` in
1110 the updated sink depends on both the old and new values of
1111 this field:
1113 - If the old and new values of this field are both false or
1114 both true, then there is no change to the sink's
1115 ``writer_identity``.
1116 - If the old value is false and the new value is true, then
1117 ``writer_identity`` is changed to a unique service
1118 account.
1119 - It is an error if the old value is true and the new value
1120 is set to false or defaulted to false.
1121 update_mask (google.protobuf.field_mask_pb2.FieldMask):
1122 Optional. Field mask that specifies the fields in ``sink``
1123 that need an update. A sink field will be overwritten if,
1124 and only if, it is in the update mask. ``name`` and output
1125 only fields cannot be updated.
1127 An empty ``updateMask`` is temporarily treated as using the
1128 following mask for backwards compatibility purposes:
1130 ``destination,filter,includeChildren``
1132 At some point in the future, behavior will be removed and
1133 specifying an empty ``updateMask`` will be an error.
1135 For a detailed ``FieldMask`` definition, see
1136 https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
1138 For example: ``updateMask=filter``
1139 """
1141 sink_name: str = proto.Field(
1142 proto.STRING,
1143 number=1,
1144 )
1145 sink: "LogSink" = proto.Field(
1146 proto.MESSAGE,
1147 number=2,
1148 message="LogSink",
1149 )
1150 unique_writer_identity: bool = proto.Field(
1151 proto.BOOL,
1152 number=3,
1153 )
1154 update_mask: field_mask_pb2.FieldMask = proto.Field(
1155 proto.MESSAGE,
1156 number=4,
1157 message=field_mask_pb2.FieldMask,
1158 )
1161class DeleteSinkRequest(proto.Message):
1162 r"""The parameters to ``DeleteSink``.
1164 Attributes:
1165 sink_name (str):
1166 Required. The full resource name of the sink to delete,
1167 including the parent resource and the sink identifier:
1169 ::
1171 "projects/[PROJECT_ID]/sinks/[SINK_ID]"
1172 "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
1173 "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
1174 "folders/[FOLDER_ID]/sinks/[SINK_ID]"
1176 For example:
1178 ``"projects/my-project/sinks/my-sink"``
1179 """
1181 sink_name: str = proto.Field(
1182 proto.STRING,
1183 number=1,
1184 )
1187class LogExclusion(proto.Message):
1188 r"""Specifies a set of log entries that are filtered out by a sink. If
1189 your Google Cloud resource receives a large volume of log entries,
1190 you can use exclusions to reduce your chargeable logs. Note that
1191 exclusions on organization-level and folder-level sinks don't apply
1192 to child resources. Note also that you cannot modify the \_Required
1193 sink or exclude logs from it.
1195 Attributes:
1196 name (str):
1197 Required. A client-assigned identifier, such as
1198 ``"load-balancer-exclusion"``. Identifiers are limited to
1199 100 characters and can include only letters, digits,
1200 underscores, hyphens, and periods. First character has to be
1201 alphanumeric.
1202 description (str):
1203 Optional. A description of this exclusion.
1204 filter (str):
1205 Required. An `advanced logs
1206 filter <https://cloud.google.com/logging/docs/view/advanced-queries>`__
1207 that matches the log entries to be excluded. By using the
1208 `sample
1209 function <https://cloud.google.com/logging/docs/view/advanced-queries#sample>`__,
1210 you can exclude less than 100% of the matching log entries.
1212 For example, the following query matches 99% of low-severity
1213 log entries from Google Cloud Storage buckets:
1215 ``resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)``
1216 disabled (bool):
1217 Optional. If set to True, then this exclusion is disabled
1218 and it does not exclude any log entries. You can [update an
1219 exclusion][google.logging.v2.ConfigServiceV2.UpdateExclusion]
1220 to change the value of this field.
1221 create_time (google.protobuf.timestamp_pb2.Timestamp):
1222 Output only. The creation timestamp of the
1223 exclusion.
1224 This field may not be present for older
1225 exclusions.
1226 update_time (google.protobuf.timestamp_pb2.Timestamp):
1227 Output only. The last update timestamp of the
1228 exclusion.
1229 This field may not be present for older
1230 exclusions.
1231 """
1233 name: str = proto.Field(
1234 proto.STRING,
1235 number=1,
1236 )
1237 description: str = proto.Field(
1238 proto.STRING,
1239 number=2,
1240 )
1241 filter: str = proto.Field(
1242 proto.STRING,
1243 number=3,
1244 )
1245 disabled: bool = proto.Field(
1246 proto.BOOL,
1247 number=4,
1248 )
1249 create_time: timestamp_pb2.Timestamp = proto.Field(
1250 proto.MESSAGE,
1251 number=5,
1252 message=timestamp_pb2.Timestamp,
1253 )
1254 update_time: timestamp_pb2.Timestamp = proto.Field(
1255 proto.MESSAGE,
1256 number=6,
1257 message=timestamp_pb2.Timestamp,
1258 )
1261class ListExclusionsRequest(proto.Message):
1262 r"""The parameters to ``ListExclusions``.
1264 Attributes:
1265 parent (str):
1266 Required. The parent resource whose exclusions are to be
1267 listed.
1269 ::
1271 "projects/[PROJECT_ID]"
1272 "organizations/[ORGANIZATION_ID]"
1273 "billingAccounts/[BILLING_ACCOUNT_ID]"
1274 "folders/[FOLDER_ID]".
1275 page_token (str):
1276 Optional. If present, then retrieve the next batch of
1277 results from the preceding call to this method.
1278 ``pageToken`` must be the value of ``nextPageToken`` from
1279 the previous response. The values of other method parameters
1280 should be identical to those in the previous call.
1281 page_size (int):
1282 Optional. The maximum number of results to return from this
1283 request. Non-positive values are ignored. The presence of
1284 ``nextPageToken`` in the response indicates that more
1285 results might be available.
1286 """
1288 parent: str = proto.Field(
1289 proto.STRING,
1290 number=1,
1291 )
1292 page_token: str = proto.Field(
1293 proto.STRING,
1294 number=2,
1295 )
1296 page_size: int = proto.Field(
1297 proto.INT32,
1298 number=3,
1299 )
1302class ListExclusionsResponse(proto.Message):
1303 r"""Result returned from ``ListExclusions``.
1305 Attributes:
1306 exclusions (MutableSequence[google.cloud.logging_v2.types.LogExclusion]):
1307 A list of exclusions.
1308 next_page_token (str):
1309 If there might be more results than appear in this response,
1310 then ``nextPageToken`` is included. To get the next set of
1311 results, call the same method again using the value of
1312 ``nextPageToken`` as ``pageToken``.
1313 """
1315 @property
1316 def raw_page(self):
1317 return self
1319 exclusions: MutableSequence["LogExclusion"] = proto.RepeatedField(
1320 proto.MESSAGE,
1321 number=1,
1322 message="LogExclusion",
1323 )
1324 next_page_token: str = proto.Field(
1325 proto.STRING,
1326 number=2,
1327 )
1330class GetExclusionRequest(proto.Message):
1331 r"""The parameters to ``GetExclusion``.
1333 Attributes:
1334 name (str):
1335 Required. The resource name of an existing exclusion:
1337 ::
1339 "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
1340 "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
1341 "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
1342 "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
1344 For example:
1346 ``"projects/my-project/exclusions/my-exclusion"``
1347 """
1349 name: str = proto.Field(
1350 proto.STRING,
1351 number=1,
1352 )
1355class CreateExclusionRequest(proto.Message):
1356 r"""The parameters to ``CreateExclusion``.
1358 Attributes:
1359 parent (str):
1360 Required. The parent resource in which to create the
1361 exclusion:
1363 ::
1365 "projects/[PROJECT_ID]"
1366 "organizations/[ORGANIZATION_ID]"
1367 "billingAccounts/[BILLING_ACCOUNT_ID]"
1368 "folders/[FOLDER_ID]"
1370 For examples:
1372 ``"projects/my-logging-project"``
1373 ``"organizations/123456789"``
1374 exclusion (google.cloud.logging_v2.types.LogExclusion):
1375 Required. The new exclusion, whose ``name`` parameter is an
1376 exclusion name that is not already used in the parent
1377 resource.
1378 """
1380 parent: str = proto.Field(
1381 proto.STRING,
1382 number=1,
1383 )
1384 exclusion: "LogExclusion" = proto.Field(
1385 proto.MESSAGE,
1386 number=2,
1387 message="LogExclusion",
1388 )
1391class UpdateExclusionRequest(proto.Message):
1392 r"""The parameters to ``UpdateExclusion``.
1394 Attributes:
1395 name (str):
1396 Required. The resource name of the exclusion to update:
1398 ::
1400 "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
1401 "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
1402 "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
1403 "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
1405 For example:
1407 ``"projects/my-project/exclusions/my-exclusion"``
1408 exclusion (google.cloud.logging_v2.types.LogExclusion):
1409 Required. New values for the existing exclusion. Only the
1410 fields specified in ``update_mask`` are relevant.
1411 update_mask (google.protobuf.field_mask_pb2.FieldMask):
1412 Required. A non-empty list of fields to change in the
1413 existing exclusion. New values for the fields are taken from
1414 the corresponding fields in the
1415 [LogExclusion][google.logging.v2.LogExclusion] included in
1416 this request. Fields not mentioned in ``update_mask`` are
1417 not changed and are ignored in the request.
1419 For example, to change the filter and description of an
1420 exclusion, specify an ``update_mask`` of
1421 ``"filter,description"``.
1422 """
1424 name: str = proto.Field(
1425 proto.STRING,
1426 number=1,
1427 )
1428 exclusion: "LogExclusion" = proto.Field(
1429 proto.MESSAGE,
1430 number=2,
1431 message="LogExclusion",
1432 )
1433 update_mask: field_mask_pb2.FieldMask = proto.Field(
1434 proto.MESSAGE,
1435 number=3,
1436 message=field_mask_pb2.FieldMask,
1437 )
1440class DeleteExclusionRequest(proto.Message):
1441 r"""The parameters to ``DeleteExclusion``.
1443 Attributes:
1444 name (str):
1445 Required. The resource name of an existing exclusion to
1446 delete:
1448 ::
1450 "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
1451 "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
1452 "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
1453 "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
1455 For example:
1457 ``"projects/my-project/exclusions/my-exclusion"``
1458 """
1460 name: str = proto.Field(
1461 proto.STRING,
1462 number=1,
1463 )
1466class GetCmekSettingsRequest(proto.Message):
1467 r"""The parameters to
1468 [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings].
1470 See `Enabling CMEK for Log
1471 Router <https://cloud.google.com/logging/docs/routing/managed-encryption>`__
1472 for more information.
1474 Attributes:
1475 name (str):
1476 Required. The resource for which to retrieve CMEK settings.
1478 ::
1480 "projects/[PROJECT_ID]/cmekSettings"
1481 "organizations/[ORGANIZATION_ID]/cmekSettings"
1482 "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
1483 "folders/[FOLDER_ID]/cmekSettings"
1485 For example:
1487 ``"organizations/12345/cmekSettings"``
1489 Note: CMEK for the Log Router can be configured for Google
1490 Cloud projects, folders, organizations and billing accounts.
1491 Once configured for an organization, it applies to all
1492 projects and folders in the Google Cloud organization.
1493 """
1495 name: str = proto.Field(
1496 proto.STRING,
1497 number=1,
1498 )
1501class UpdateCmekSettingsRequest(proto.Message):
1502 r"""The parameters to
1503 [UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings].
1505 See `Enabling CMEK for Log
1506 Router <https://cloud.google.com/logging/docs/routing/managed-encryption>`__
1507 for more information.
1509 Attributes:
1510 name (str):
1511 Required. The resource name for the CMEK settings to update.
1513 ::
1515 "projects/[PROJECT_ID]/cmekSettings"
1516 "organizations/[ORGANIZATION_ID]/cmekSettings"
1517 "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
1518 "folders/[FOLDER_ID]/cmekSettings"
1520 For example:
1522 ``"organizations/12345/cmekSettings"``
1524 Note: CMEK for the Log Router can currently only be
1525 configured for Google Cloud organizations. Once configured,
1526 it applies to all projects and folders in the Google Cloud
1527 organization.
1528 cmek_settings (google.cloud.logging_v2.types.CmekSettings):
1529 Required. The CMEK settings to update.
1531 See `Enabling CMEK for Log
1532 Router <https://cloud.google.com/logging/docs/routing/managed-encryption>`__
1533 for more information.
1534 update_mask (google.protobuf.field_mask_pb2.FieldMask):
1535 Optional. Field mask identifying which fields from
1536 ``cmek_settings`` should be updated. A field will be
1537 overwritten if and only if it is in the update mask. Output
1538 only fields cannot be updated.
1540 See [FieldMask][google.protobuf.FieldMask] for more
1541 information.
1543 For example: ``"updateMask=kmsKeyName"``
1544 """
1546 name: str = proto.Field(
1547 proto.STRING,
1548 number=1,
1549 )
1550 cmek_settings: "CmekSettings" = proto.Field(
1551 proto.MESSAGE,
1552 number=2,
1553 message="CmekSettings",
1554 )
1555 update_mask: field_mask_pb2.FieldMask = proto.Field(
1556 proto.MESSAGE,
1557 number=3,
1558 message=field_mask_pb2.FieldMask,
1559 )
1562class CmekSettings(proto.Message):
1563 r"""Describes the customer-managed encryption key (CMEK) settings
1564 associated with a project, folder, organization, billing account, or
1565 flexible resource.
1567 Note: CMEK for the Log Router can currently only be configured for
1568 Google Cloud organizations. Once configured, it applies to all
1569 projects and folders in the Google Cloud organization.
1571 See `Enabling CMEK for Log
1572 Router <https://cloud.google.com/logging/docs/routing/managed-encryption>`__
1573 for more information.
1575 Attributes:
1576 name (str):
1577 Output only. The resource name of the CMEK
1578 settings.
1579 kms_key_name (str):
1580 The resource name for the configured Cloud KMS key.
1582 KMS key name format:
1584 ::
1586 "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
1588 For example:
1590 ``"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"``
1592 To enable CMEK for the Log Router, set this field to a valid
1593 ``kms_key_name`` for which the associated service account
1594 has the required cloudkms.cryptoKeyEncrypterDecrypter roles
1595 assigned for the key.
1597 The Cloud KMS key used by the Log Router can be updated by
1598 changing the ``kms_key_name`` to a new valid key name or
1599 disabled by setting the key name to an empty string.
1600 Encryption operations that are in progress will be completed
1601 with the key that was in use when they started. Decryption
1602 operations will be completed using the key that was used at
1603 the time of encryption unless access to that key has been
1604 revoked.
1606 To disable CMEK for the Log Router, set this field to an
1607 empty string.
1609 See `Enabling CMEK for Log
1610 Router <https://cloud.google.com/logging/docs/routing/managed-encryption>`__
1611 for more information.
1612 service_account_id (str):
1613 Output only. The service account that will be used by the
1614 Log Router to access your Cloud KMS key.
1616 Before enabling CMEK for Log Router, you must first assign
1617 the cloudkms.cryptoKeyEncrypterDecrypter role to the service
1618 account that the Log Router will use to access your Cloud
1619 KMS key. Use
1620 [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings]
1621 to obtain the service account ID.
1623 See `Enabling CMEK for Log
1624 Router <https://cloud.google.com/logging/docs/routing/managed-encryption>`__
1625 for more information.
1626 """
1628 name: str = proto.Field(
1629 proto.STRING,
1630 number=1,
1631 )
1632 kms_key_name: str = proto.Field(
1633 proto.STRING,
1634 number=2,
1635 )
1636 service_account_id: str = proto.Field(
1637 proto.STRING,
1638 number=3,
1639 )
1642class GetSettingsRequest(proto.Message):
1643 r"""The parameters to
1644 [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings].
1646 See `Enabling CMEK for Log
1647 Router <https://cloud.google.com/logging/docs/routing/managed-encryption>`__
1648 for more information.
1650 Attributes:
1651 name (str):
1652 Required. The resource for which to retrieve settings.
1654 ::
1656 "projects/[PROJECT_ID]/settings"
1657 "organizations/[ORGANIZATION_ID]/settings"
1658 "billingAccounts/[BILLING_ACCOUNT_ID]/settings"
1659 "folders/[FOLDER_ID]/settings"
1661 For example:
1663 ``"organizations/12345/settings"``
1665 Note: Settings for the Log Router can be get for Google
1666 Cloud projects, folders, organizations and billing accounts.
1667 Currently it can only be configured for organizations. Once
1668 configured for an organization, it applies to all projects
1669 and folders in the Google Cloud organization.
1670 """
1672 name: str = proto.Field(
1673 proto.STRING,
1674 number=1,
1675 )
1678class UpdateSettingsRequest(proto.Message):
1679 r"""The parameters to
1680 [UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings].
1682 See `Enabling CMEK for Log
1683 Router <https://cloud.google.com/logging/docs/routing/managed-encryption>`__
1684 for more information.
1686 Attributes:
1687 name (str):
1688 Required. The resource name for the settings to update.
1690 ::
1692 "organizations/[ORGANIZATION_ID]/settings"
1694 For example:
1696 ``"organizations/12345/settings"``
1698 Note: Settings for the Log Router can currently only be
1699 configured for Google Cloud organizations. Once configured,
1700 it applies to all projects and folders in the Google Cloud
1701 organization.
1702 settings (google.cloud.logging_v2.types.Settings):
1703 Required. The settings to update.
1705 See `Enabling CMEK for Log
1706 Router <https://cloud.google.com/logging/docs/routing/managed-encryption>`__
1707 for more information.
1708 update_mask (google.protobuf.field_mask_pb2.FieldMask):
1709 Optional. Field mask identifying which fields from
1710 ``settings`` should be updated. A field will be overwritten
1711 if and only if it is in the update mask. Output only fields
1712 cannot be updated.
1714 See [FieldMask][google.protobuf.FieldMask] for more
1715 information.
1717 For example: ``"updateMask=kmsKeyName"``
1718 """
1720 name: str = proto.Field(
1721 proto.STRING,
1722 number=1,
1723 )
1724 settings: "Settings" = proto.Field(
1725 proto.MESSAGE,
1726 number=2,
1727 message="Settings",
1728 )
1729 update_mask: field_mask_pb2.FieldMask = proto.Field(
1730 proto.MESSAGE,
1731 number=3,
1732 message=field_mask_pb2.FieldMask,
1733 )
1736class Settings(proto.Message):
1737 r"""Describes the settings associated with a project, folder,
1738 organization, billing account, or flexible resource.
1740 Attributes:
1741 name (str):
1742 Output only. The resource name of the
1743 settings.
1744 kms_key_name (str):
1745 Optional. The resource name for the configured Cloud KMS
1746 key.
1748 KMS key name format:
1750 ::
1752 "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
1754 For example:
1756 ``"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"``
1758 To enable CMEK for the Log Router, set this field to a valid
1759 ``kms_key_name`` for which the associated service account
1760 has the required
1761 ``roles/cloudkms.cryptoKeyEncrypterDecrypter`` role assigned
1762 for the key.
1764 The Cloud KMS key used by the Log Router can be updated by
1765 changing the ``kms_key_name`` to a new valid key name.
1766 Encryption operations that are in progress will be completed
1767 with the key that was in use when they started. Decryption
1768 operations will be completed using the key that was used at
1769 the time of encryption unless access to that key has been
1770 revoked.
1772 To disable CMEK for the Log Router, set this field to an
1773 empty string.
1775 See `Enabling CMEK for Log
1776 Router <https://cloud.google.com/logging/docs/routing/managed-encryption>`__
1777 for more information.
1778 kms_service_account_id (str):
1779 Output only. The service account that will be used by the
1780 Log Router to access your Cloud KMS key.
1782 Before enabling CMEK for Log Router, you must first assign
1783 the role ``roles/cloudkms.cryptoKeyEncrypterDecrypter`` to
1784 the service account that the Log Router will use to access
1785 your Cloud KMS key. Use
1786 [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings]
1787 to obtain the service account ID.
1789 See `Enabling CMEK for Log
1790 Router <https://cloud.google.com/logging/docs/routing/managed-encryption>`__
1791 for more information.
1792 storage_location (str):
1793 Optional. The Cloud region that will be used for \_Default
1794 and \_Required log buckets for newly created projects and
1795 folders. For example ``europe-west1``. This setting does not
1796 affect the location of custom log buckets.
1797 disable_default_sink (bool):
1798 Optional. If set to true, the \_Default sink in newly
1799 created projects and folders will created in a disabled
1800 state. This can be used to automatically disable log
1801 ingestion if there is already an aggregated sink configured
1802 in the hierarchy. The \_Default sink can be re-enabled
1803 manually if needed.
1804 """
1806 name: str = proto.Field(
1807 proto.STRING,
1808 number=1,
1809 )
1810 kms_key_name: str = proto.Field(
1811 proto.STRING,
1812 number=2,
1813 )
1814 kms_service_account_id: str = proto.Field(
1815 proto.STRING,
1816 number=3,
1817 )
1818 storage_location: str = proto.Field(
1819 proto.STRING,
1820 number=4,
1821 )
1822 disable_default_sink: bool = proto.Field(
1823 proto.BOOL,
1824 number=5,
1825 )
1828class CopyLogEntriesRequest(proto.Message):
1829 r"""The parameters to CopyLogEntries.
1831 Attributes:
1832 name (str):
1833 Required. Log bucket from which to copy log entries.
1835 For example:
1837 ``"projects/my-project/locations/global/buckets/my-source-bucket"``
1838 filter (str):
1839 Optional. A filter specifying which log
1840 entries to copy. The filter must be no more than
1841 20k characters. An empty filter matches all log
1842 entries.
1843 destination (str):
1844 Required. Destination to which to copy log
1845 entries.
1846 """
1848 name: str = proto.Field(
1849 proto.STRING,
1850 number=1,
1851 )
1852 filter: str = proto.Field(
1853 proto.STRING,
1854 number=3,
1855 )
1856 destination: str = proto.Field(
1857 proto.STRING,
1858 number=4,
1859 )
1862class CopyLogEntriesMetadata(proto.Message):
1863 r"""Metadata for CopyLogEntries long running operations.
1865 Attributes:
1866 start_time (google.protobuf.timestamp_pb2.Timestamp):
1867 The create time of an operation.
1868 end_time (google.protobuf.timestamp_pb2.Timestamp):
1869 The end time of an operation.
1870 state (google.cloud.logging_v2.types.OperationState):
1871 State of an operation.
1872 cancellation_requested (bool):
1873 Identifies whether the user has requested
1874 cancellation of the operation.
1875 request (google.cloud.logging_v2.types.CopyLogEntriesRequest):
1876 CopyLogEntries RPC request.
1877 progress (int):
1878 Estimated progress of the operation (0 -
1879 100%).
1880 writer_identity (str):
1881 The IAM identity of a service account that must be granted
1882 access to the destination.
1884 If the service account is not granted permission to the
1885 destination within an hour, the operation will be cancelled.
1887 For example: ``"serviceAccount:foo@bar.com"``
1888 """
1890 start_time: timestamp_pb2.Timestamp = proto.Field(
1891 proto.MESSAGE,
1892 number=1,
1893 message=timestamp_pb2.Timestamp,
1894 )
1895 end_time: timestamp_pb2.Timestamp = proto.Field(
1896 proto.MESSAGE,
1897 number=2,
1898 message=timestamp_pb2.Timestamp,
1899 )
1900 state: "OperationState" = proto.Field(
1901 proto.ENUM,
1902 number=3,
1903 enum="OperationState",
1904 )
1905 cancellation_requested: bool = proto.Field(
1906 proto.BOOL,
1907 number=4,
1908 )
1909 request: "CopyLogEntriesRequest" = proto.Field(
1910 proto.MESSAGE,
1911 number=5,
1912 message="CopyLogEntriesRequest",
1913 )
1914 progress: int = proto.Field(
1915 proto.INT32,
1916 number=6,
1917 )
1918 writer_identity: str = proto.Field(
1919 proto.STRING,
1920 number=7,
1921 )
1924class CopyLogEntriesResponse(proto.Message):
1925 r"""Response type for CopyLogEntries long running operations.
1927 Attributes:
1928 log_entries_copied_count (int):
1929 Number of log entries copied.
1930 """
1932 log_entries_copied_count: int = proto.Field(
1933 proto.INT64,
1934 number=1,
1935 )
1938__all__ = tuple(sorted(__protobuf__.manifest))