Skip to content

Commit e993961

Browse files
yoshi-automationbusunkim96
authored andcommitted
Logging: Add LoggingV2Servicer, LogSinks, logging_metrics, and log_entry. Add LogSeverity and HttpRequest types (via synth). (googleapis#9262)
1 parent ee0f70a commit e993961

28 files changed

+6380
-210
lines changed

logging/google/cloud/logging_v2/gapic/config_service_v2_client.py

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,11 @@
3131
import google.api_core.path_template
3232
import grpc
3333

34-
from google.api import monitored_resource_pb2
3534
from google.cloud.logging_v2.gapic import config_service_v2_client_config
3635
from google.cloud.logging_v2.gapic import enums
3736
from google.cloud.logging_v2.gapic.transports import config_service_v2_grpc_transport
38-
from google.cloud.logging_v2.proto import log_entry_pb2
3937
from google.cloud.logging_v2.proto import logging_config_pb2
4038
from google.cloud.logging_v2.proto import logging_config_pb2_grpc
41-
from google.cloud.logging_v2.proto import logging_pb2
42-
from google.cloud.logging_v2.proto import logging_pb2_grpc
4339
from google.protobuf import empty_pb2
4440
from google.protobuf import field_mask_pb2
4541

@@ -48,10 +44,7 @@
4844

4945

5046
class ConfigServiceV2Client(object):
51-
"""
52-
Service for configuring sinks used to export log entries out of
53-
Logging.
54-
"""
47+
"""Service for configuring sinks used to route log entries."""
5548

5649
SERVICE_ADDRESS = "logging.googleapis.com:443"
5750
"""The default address of the service."""
@@ -593,8 +586,10 @@ def update_sink(
593586
"""
594587
Updates a sink. This method replaces the following fields in the
595588
existing sink with values from the new sink: ``destination``, and
596-
``filter``. The updated sink might also have a new ``writer_identity``;
597-
see the ``unique_writer_identity`` field.
589+
``filter``.
590+
591+
The updated sink might also have a new ``writer_identity``; see the
592+
``unique_writer_identity`` field.
598593
599594
Example:
600595
>>> from google.cloud import logging_v2
@@ -625,11 +620,10 @@ def update_sink(
625620
626621
If a dict is provided, it must be of the same form as the protobuf
627622
message :class:`~google.cloud.logging_v2.types.LogSink`
628-
unique_writer_identity (bool): Optional. See
629-
`sinks.create <https://cloud.google.com/logging/docs/api/reference/rest/v2/projects.sinks/create>`__
630-
for a description of this field. When updating a sink, the effect of
631-
this field on the value of ``writer_identity`` in the updated sink
632-
depends on both the old and new values of this field:
623+
unique_writer_identity (bool): Optional. See ``sinks.create`` for a description of this field. When
624+
updating a sink, the effect of this field on the value of
625+
``writer_identity`` in the updated sink depends on both the old and new
626+
values of this field:
633627
634628
- If the old and new values of this field are both false or both true,
635629
then there is no change to the sink's ``writer_identity``.
@@ -1106,10 +1100,11 @@ def update_exclusion(
11061100
11071101
If a dict is provided, it must be of the same form as the protobuf
11081102
message :class:`~google.cloud.logging_v2.types.LogExclusion`
1109-
update_mask (Union[dict, ~google.cloud.logging_v2.types.FieldMask]): Required. A nonempty list of fields to change in the existing exclusion.
1110-
New values for the fields are taken from the corresponding fields in the
1111-
``LogExclusion`` included in this request. Fields not mentioned in
1112-
``update_mask`` are not changed and are ignored in the request.
1103+
update_mask (Union[dict, ~google.cloud.logging_v2.types.FieldMask]): Required. A non-empty list of fields to change in the existing
1104+
exclusion. New values for the fields are taken from the corresponding
1105+
fields in the ``LogExclusion`` included in this request. Fields not
1106+
mentioned in ``update_mask`` are not changed and are ignored in the
1107+
request.
11131108
11141109
For example, to change the filter and description of an exclusion,
11151110
specify an ``update_mask`` of ``"filter,description"``.

logging/google/cloud/logging_v2/gapic/logging_service_v2_client.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,12 @@
3636
from google.cloud.logging_v2.gapic import logging_service_v2_client_config
3737
from google.cloud.logging_v2.gapic.transports import logging_service_v2_grpc_transport
3838
from google.cloud.logging_v2.proto import log_entry_pb2
39+
from google.cloud.logging_v2.proto import logging_config_pb2
40+
from google.cloud.logging_v2.proto import logging_config_pb2_grpc
3941
from google.cloud.logging_v2.proto import logging_pb2
4042
from google.cloud.logging_v2.proto import logging_pb2_grpc
4143
from google.protobuf import empty_pb2
44+
from google.protobuf import field_mask_pb2
4245

4346

4447
_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-logging").version
@@ -374,8 +377,8 @@ def write_log_entries(
374377
Log entries with timestamps that are more than the `logs retention
375378
period <https://cloud.google.com/logging/quota-policy>`__ in the past or
376379
more than 24 hours in the future will not be available when calling
377-
``entries.list``. However, those log entries can still be exported with
378-
`LogSinks <https://cloud.google.com/logging/docs/api/tasks/exporting-logs>`__.
380+
``entries.list``. However, those log entries can still be `exported with
381+
LogSinks <https://cloud.google.com/logging/docs/api/tasks/exporting-logs>`__.
379382
380383
To improve throughput and to avoid exceeding the `quota
381384
limit <https://cloud.google.com/logging/quota-policy>`__ for calls to
@@ -486,8 +489,9 @@ def list_log_entries(
486489
metadata=None,
487490
):
488491
"""
489-
Lists log entries. Use this method to retrieve log entries from Logging.
490-
For ways to export log entries, see `Exporting
492+
Lists log entries. Use this method to retrieve log entries that
493+
originated from a project/folder/organization/billing account. For ways
494+
to export log entries, see `Exporting
491495
Logs <https://cloud.google.com/logging/docs/export>`__.
492496
493497
Example:
@@ -526,9 +530,7 @@ def list_log_entries(
526530
Projects listed in the ``project_ids`` field are added to this list.
527531
project_ids (list[str]): Deprecated. Use ``resource_names`` instead. One or more project
528532
identifiers or project numbers from which to retrieve log entries.
529-
Example: ``"my-project-1A"``. If present, these project identifiers are
530-
converted to resource name format and added to the list of resources in
531-
``resource_names``.
533+
Example: ``"my-project-1A"``.
532534
filter_ (str): Optional. A filter that chooses which log entries to return. See
533535
`Advanced Logs
534536
Filters <https://cloud.google.com/logging/docs/view/advanced_filters>`__.

logging/google/cloud/logging_v2/gapic/transports/config_service_v2_grpc_transport.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,10 @@ def update_sink(self):
163163
164164
Updates a sink. This method replaces the following fields in the
165165
existing sink with values from the new sink: ``destination``, and
166-
``filter``. The updated sink might also have a new ``writer_identity``;
167-
see the ``unique_writer_identity`` field.
166+
``filter``.
167+
168+
The updated sink might also have a new ``writer_identity``; see the
169+
``unique_writer_identity`` field.
168170
169171
Returns:
170172
Callable: A callable which accepts the appropriate

logging/google/cloud/logging_v2/gapic/transports/logging_service_v2_grpc_transport.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,9 @@ def write_log_entries(self):
152152
def list_log_entries(self):
153153
"""Return the gRPC stub for :meth:`LoggingServiceV2Client.list_log_entries`.
154154
155-
Lists log entries. Use this method to retrieve log entries from Logging.
156-
For ways to export log entries, see `Exporting
155+
Lists log entries. Use this method to retrieve log entries that
156+
originated from a project/folder/organization/billing account. For ways
157+
to export log entries, see `Exporting
157158
Logs <https://cloud.google.com/logging/docs/export>`__.
158159
159160
Returns:

logging/google/cloud/logging_v2/proto/cloud/logging_v2/proto/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)