From b56a78c50780e778f8ce1ad956e621433d1c451b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 27 Aug 2021 16:52:27 +0000 Subject: [PATCH] feat: Added support for log-based alerts (#204) See https://cloud.google.com/logging/docs/alerting/log-based-alerts for more information about logs-based alerts - [ ] Regenerate this pull request now. PiperOrigin-RevId: 393200011 Source-Link: https://github.com/googleapis/googleapis/commit/354d0763e7e4ce7ab370790ffba0c3c25b1420c3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/5791e7bec19d247399d33396b4c1212f5208c505 feat: Added support for user-defined labels on cloud monitoring's Service object feat: Added support for user-defined labels on cloud monitoring's ServiceLevelObjective object fix: mark required fields in QueryTimeSeriesRequest as required by the backend --- google/cloud/monitoring/__init__.py | 2 - google/cloud/monitoring_v3/__init__.py | 2 - .../alert_policy_service/async_client.py | 13 ++-- .../services/alert_policy_service/client.py | 10 ++- .../alert_policy_service/transports/base.py | 3 - .../services/group_service/async_client.py | 19 ++--- .../services/group_service/client.py | 10 ++- .../services/group_service/transports/base.py | 9 +-- .../services/metric_service/async_client.py | 41 +++++----- .../services/metric_service/client.py | 31 ++++---- .../metric_service/transports/base.py | 10 +-- .../async_client.py | 26 +++---- .../notification_channel_service/client.py | 19 +++-- .../transports/base.py | 7 -- .../async_client.py | 16 ++-- .../service_monitoring_service/client.py | 10 ++- .../transports/base.py | 6 -- .../uptime_check_service/async_client.py | 15 ++-- .../services/uptime_check_service/client.py | 11 ++- .../uptime_check_service/transports/base.py | 4 - google/cloud/monitoring_v3/types/__init__.py | 2 - google/cloud/monitoring_v3/types/alert.py | 74 +++++++++++++++++++ .../monitoring_v3/types/alert_service.py | 10 ++- google/cloud/monitoring_v3/types/common.py | 21 +----- .../monitoring_v3/types/group_service.py | 10 ++- google/cloud/monitoring_v3/types/metric.py | 8 +- .../monitoring_v3/types/metric_service.py | 36 +++++---- .../cloud/monitoring_v3/types/notification.py | 7 -- .../types/notification_service.py | 17 +++-- google/cloud/monitoring_v3/types/service.py | 40 +++++++--- .../monitoring_v3/types/service_service.py | 10 ++- .../cloud/monitoring_v3/types/span_context.py | 4 +- google/cloud/monitoring_v3/types/uptime.py | 6 +- .../monitoring_v3/types/uptime_service.py | 10 ++- owlbot.py | 8 ++ .../test_notification_channel_service.py | 5 -- 36 files changed, 293 insertions(+), 239 deletions(-) diff --git a/google/cloud/monitoring/__init__.py b/google/cloud/monitoring/__init__.py index 60f07f2d..a95bc456 100644 --- a/google/cloud/monitoring/__init__.py +++ b/google/cloud/monitoring/__init__.py @@ -64,7 +64,6 @@ from google.cloud.monitoring_v3.types.common import TimeInterval from google.cloud.monitoring_v3.types.common import TypedValue from google.cloud.monitoring_v3.types.common import ComparisonType -from google.cloud.monitoring_v3.types.common import ServiceTier from google.cloud.monitoring_v3.types.dropped_labels import DroppedLabels from google.cloud.monitoring_v3.types.group import Group from google.cloud.monitoring_v3.types.group_service import CreateGroupRequest @@ -236,7 +235,6 @@ "TimeInterval", "TypedValue", "ComparisonType", - "ServiceTier", "DroppedLabels", "Group", "CreateGroupRequest", diff --git a/google/cloud/monitoring_v3/__init__.py b/google/cloud/monitoring_v3/__init__.py index 77f1d7b9..3b18dfdb 100644 --- a/google/cloud/monitoring_v3/__init__.py +++ b/google/cloud/monitoring_v3/__init__.py @@ -40,7 +40,6 @@ from .types.common import TimeInterval from .types.common import TypedValue from .types.common import ComparisonType -from .types.common import ServiceTier from .types.dropped_labels import DroppedLabels from .types.group import Group from .types.group_service import CreateGroupRequest @@ -216,7 +215,6 @@ "ServiceLevelIndicator", "ServiceLevelObjective", "ServiceMonitoringServiceClient", - "ServiceTier", "SpanContext", "TextLocator", "TimeInterval", diff --git a/google/cloud/monitoring_v3/services/alert_policy_service/async_client.py b/google/cloud/monitoring_v3/services/alert_policy_service/async_client.py index 04b2608e..3a838051 100644 --- a/google/cloud/monitoring_v3/services/alert_policy_service/async_client.py +++ b/google/cloud/monitoring_v3/services/alert_policy_service/async_client.py @@ -201,8 +201,9 @@ async def list_alert_policies( The request object. The protocol for the `ListAlertPolicies` request. name (:class:`str`): - Required. The project whose alert policies are to be - listed. The format is: + Required. The + `project `__ + whose alert policies are to be listed. The format is: :: @@ -257,7 +258,6 @@ async def list_alert_policies( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -351,7 +351,6 @@ async def get_alert_policy( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -389,8 +388,9 @@ async def create_alert_policy( The request object. The protocol for the `CreateAlertPolicy` request. name (:class:`str`): - Required. The project in which to create the alerting - policy. The format is: + Required. The + `project `__ + in which to create the alerting policy. The format is: :: @@ -532,7 +532,6 @@ async def delete_alert_policy( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, diff --git a/google/cloud/monitoring_v3/services/alert_policy_service/client.py b/google/cloud/monitoring_v3/services/alert_policy_service/client.py index ef6cb59c..f708227b 100644 --- a/google/cloud/monitoring_v3/services/alert_policy_service/client.py +++ b/google/cloud/monitoring_v3/services/alert_policy_service/client.py @@ -400,8 +400,9 @@ def list_alert_policies( The request object. The protocol for the `ListAlertPolicies` request. name (str): - Required. The project whose alert policies are to be - listed. The format is: + Required. The + `project `__ + whose alert policies are to be listed. The format is: :: @@ -568,8 +569,9 @@ def create_alert_policy( The request object. The protocol for the `CreateAlertPolicy` request. name (str): - Required. The project in which to create the alerting - policy. The format is: + Required. The + `project `__ + in which to create the alerting policy. The format is: :: diff --git a/google/cloud/monitoring_v3/services/alert_policy_service/transports/base.py b/google/cloud/monitoring_v3/services/alert_policy_service/transports/base.py index 5d483f4b..be14243f 100644 --- a/google/cloud/monitoring_v3/services/alert_policy_service/transports/base.py +++ b/google/cloud/monitoring_v3/services/alert_policy_service/transports/base.py @@ -167,7 +167,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -182,7 +181,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -200,7 +198,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, diff --git a/google/cloud/monitoring_v3/services/group_service/async_client.py b/google/cloud/monitoring_v3/services/group_service/async_client.py index ae215e68..6ed9c9fc 100644 --- a/google/cloud/monitoring_v3/services/group_service/async_client.py +++ b/google/cloud/monitoring_v3/services/group_service/async_client.py @@ -187,8 +187,9 @@ async def list_groups( request (:class:`google.cloud.monitoring_v3.types.ListGroupsRequest`): The request object. The `ListGroup` request. name (:class:`str`): - Required. The project whose groups are to be listed. The - format is: + Required. The + `project `__ + whose groups are to be listed. The format is: :: @@ -237,7 +238,6 @@ async def list_groups( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -357,7 +357,6 @@ async def get_group( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -394,8 +393,9 @@ async def create_group( request (:class:`google.cloud.monitoring_v3.types.CreateGroupRequest`): The request object. The `CreateGroup` request. name (:class:`str`): - Required. The project in which to create the group. The - format is: + Required. The + `project `__ + in which to create the group. The format is: :: @@ -585,12 +585,11 @@ async def update_group( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), - deadline=30.0, + deadline=180.0, ), - default_timeout=30.0, + default_timeout=180.0, client_info=DEFAULT_CLIENT_INFO, ) @@ -666,7 +665,6 @@ async def delete_group( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -752,7 +750,6 @@ async def list_group_members( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, diff --git a/google/cloud/monitoring_v3/services/group_service/client.py b/google/cloud/monitoring_v3/services/group_service/client.py index 29bf1c21..f5cd5c31 100644 --- a/google/cloud/monitoring_v3/services/group_service/client.py +++ b/google/cloud/monitoring_v3/services/group_service/client.py @@ -373,8 +373,9 @@ def list_groups( request (google.cloud.monitoring_v3.types.ListGroupsRequest): The request object. The `ListGroup` request. name (str): - Required. The project whose groups are to be listed. The - format is: + Required. The + `project `__ + whose groups are to be listed. The format is: :: @@ -560,8 +561,9 @@ def create_group( request (google.cloud.monitoring_v3.types.CreateGroupRequest): The request object. The `CreateGroup` request. name (str): - Required. The project in which to create the group. The - format is: + Required. The + `project `__ + in which to create the group. The format is: :: diff --git a/google/cloud/monitoring_v3/services/group_service/transports/base.py b/google/cloud/monitoring_v3/services/group_service/transports/base.py index 2e431a06..25626df4 100644 --- a/google/cloud/monitoring_v3/services/group_service/transports/base.py +++ b/google/cloud/monitoring_v3/services/group_service/transports/base.py @@ -168,7 +168,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -183,7 +182,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -201,12 +199,11 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), - deadline=30.0, + deadline=180.0, ), - default_timeout=30.0, + default_timeout=180.0, client_info=client_info, ), self.delete_group: gapic_v1.method.wrap_method( @@ -216,7 +213,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -231,7 +227,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, diff --git a/google/cloud/monitoring_v3/services/metric_service/async_client.py b/google/cloud/monitoring_v3/services/metric_service/async_client.py index cc75b672..93647bda 100644 --- a/google/cloud/monitoring_v3/services/metric_service/async_client.py +++ b/google/cloud/monitoring_v3/services/metric_service/async_client.py @@ -194,8 +194,9 @@ async def list_monitored_resource_descriptors( The request object. The `ListMonitoredResourceDescriptors` request. name (:class:`str`): - Required. The project on which to execute the request. - The format is: + Required. The + `project `__ + on which to execute the request. The format is: :: @@ -244,7 +245,6 @@ async def list_monitored_resource_descriptors( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -348,7 +348,6 @@ async def get_monitored_resource_descriptor( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -385,8 +384,9 @@ async def list_metric_descriptors( request (:class:`google.cloud.monitoring_v3.types.ListMetricDescriptorsRequest`): The request object. The `ListMetricDescriptors` request. name (:class:`str`): - Required. The project on which to execute the request. - The format is: + Required. The + `project `__ + on which to execute the request. The format is: :: @@ -435,7 +435,6 @@ async def list_metric_descriptors( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -532,7 +531,6 @@ async def get_metric_descriptor( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -572,12 +570,10 @@ async def create_metric_descriptor( The request object. The `CreateMetricDescriptor` request. name (:class:`str`): - Required. The project on which to execute the request. - The format is: - - :: - - projects/[PROJECT_ID_OR_NUMBER] + Required. The + `project `__ + on which to execute the request. The format is: 4 + projects/[PROJECT_ID_OR_NUMBER] This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -707,7 +703,6 @@ async def delete_metric_descriptor( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -746,8 +741,10 @@ async def list_time_series( request (:class:`google.cloud.monitoring_v3.types.ListTimeSeriesRequest`): The request object. The `ListTimeSeries` request. name (:class:`str`): - Required. The project, organization or folder on which - to execute the request. The format is: + Required. The + `project `__, + organization or folder on which to execute the request. + The format is: :: @@ -837,12 +834,11 @@ async def list_time_series( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), - deadline=30.0, + deadline=90.0, ), - default_timeout=30.0, + default_timeout=90.0, client_info=DEFAULT_CLIENT_INFO, ) @@ -884,8 +880,9 @@ async def create_time_series( request (:class:`google.cloud.monitoring_v3.types.CreateTimeSeriesRequest`): The request object. The `CreateTimeSeries` request. name (:class:`str`): - Required. The project on which to execute the request. - The format is: + Required. The + `project `__ + on which to execute the request. The format is: :: diff --git a/google/cloud/monitoring_v3/services/metric_service/client.py b/google/cloud/monitoring_v3/services/metric_service/client.py index 5e37306e..383d045f 100644 --- a/google/cloud/monitoring_v3/services/metric_service/client.py +++ b/google/cloud/monitoring_v3/services/metric_service/client.py @@ -402,8 +402,9 @@ def list_monitored_resource_descriptors( The request object. The `ListMonitoredResourceDescriptors` request. name (str): - Required. The project on which to execute the request. - The format is: + Required. The + `project `__ + on which to execute the request. The format is: :: @@ -581,8 +582,9 @@ def list_metric_descriptors( request (google.cloud.monitoring_v3.types.ListMetricDescriptorsRequest): The request object. The `ListMetricDescriptors` request. name (str): - Required. The project on which to execute the request. - The format is: + Required. The + `project `__ + on which to execute the request. The format is: :: @@ -748,12 +750,10 @@ def create_metric_descriptor( The request object. The `CreateMetricDescriptor` request. name (str): - Required. The project on which to execute the request. - The format is: - - :: - - projects/[PROJECT_ID_OR_NUMBER] + Required. The + `project `__ + on which to execute the request. The format is: 4 + projects/[PROJECT_ID_OR_NUMBER] This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -912,8 +912,10 @@ def list_time_series( request (google.cloud.monitoring_v3.types.ListTimeSeriesRequest): The request object. The `ListTimeSeries` request. name (str): - Required. The project, organization or folder on which - to execute the request. The format is: + Required. The + `project `__, + organization or folder on which to execute the request. + The format is: :: @@ -1040,8 +1042,9 @@ def create_time_series( request (google.cloud.monitoring_v3.types.CreateTimeSeriesRequest): The request object. The `CreateTimeSeries` request. name (str): - Required. The project on which to execute the request. - The format is: + Required. The + `project `__ + on which to execute the request. The format is: :: diff --git a/google/cloud/monitoring_v3/services/metric_service/transports/base.py b/google/cloud/monitoring_v3/services/metric_service/transports/base.py index 4db87cfc..a5d847c8 100644 --- a/google/cloud/monitoring_v3/services/metric_service/transports/base.py +++ b/google/cloud/monitoring_v3/services/metric_service/transports/base.py @@ -169,7 +169,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -184,7 +183,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -199,7 +197,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -214,7 +211,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -234,7 +230,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -249,12 +244,11 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), - deadline=30.0, + deadline=90.0, ), - default_timeout=30.0, + default_timeout=90.0, client_info=client_info, ), self.create_time_series: gapic_v1.method.wrap_method( diff --git a/google/cloud/monitoring_v3/services/notification_channel_service/async_client.py b/google/cloud/monitoring_v3/services/notification_channel_service/async_client.py index 9f364a55..a475eeed 100644 --- a/google/cloud/monitoring_v3/services/notification_channel_service/async_client.py +++ b/google/cloud/monitoring_v3/services/notification_channel_service/async_client.py @@ -29,7 +29,6 @@ from google.api import label_pb2 # type: ignore from google.api import launch_stage_pb2 # type: ignore from google.cloud.monitoring_v3.services.notification_channel_service import pagers -from google.cloud.monitoring_v3.types import common from google.cloud.monitoring_v3.types import mutation_record from google.cloud.monitoring_v3.types import notification from google.cloud.monitoring_v3.types import notification_service @@ -214,9 +213,11 @@ async def list_notification_channel_descriptors( projects/[PROJECT_ID_OR_NUMBER] - Note that this names the parent container in which to - look for the descriptors; to retrieve a single - descriptor by name, use the + Note that this + `names `__ + the parent container in which to look for the + descriptors; to retrieve a single descriptor by name, + use the [GetNotificationChannelDescriptor][google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor] operation, instead. @@ -265,7 +266,6 @@ async def list_notification_channel_descriptors( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -361,7 +361,6 @@ async def get_notification_channel_descriptor( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -399,8 +398,9 @@ async def list_notification_channels( The request object. The `ListNotificationChannels` request. name (:class:`str`): - Required. The project on which to execute the request. - The format is: + Required. The + `project `__ + on which to execute the request. The format is: :: @@ -456,7 +456,6 @@ async def list_notification_channels( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -558,7 +557,6 @@ async def get_notification_channel( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -598,8 +596,9 @@ async def create_notification_channel( The request object. The `CreateNotificationChannel` request. name (:class:`str`): - Required. The project on which to execute the request. - The format is: + Required. The + `project `__ + on which to execute the request. The format is: :: @@ -842,7 +841,6 @@ async def delete_notification_channel( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -1021,7 +1019,6 @@ async def get_notification_channel_verification_code( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -1126,7 +1123,6 @@ async def verify_notification_channel( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, diff --git a/google/cloud/monitoring_v3/services/notification_channel_service/client.py b/google/cloud/monitoring_v3/services/notification_channel_service/client.py index dda00689..9b095a75 100644 --- a/google/cloud/monitoring_v3/services/notification_channel_service/client.py +++ b/google/cloud/monitoring_v3/services/notification_channel_service/client.py @@ -33,7 +33,6 @@ from google.api import label_pb2 # type: ignore from google.api import launch_stage_pb2 # type: ignore from google.cloud.monitoring_v3.services.notification_channel_service import pagers -from google.cloud.monitoring_v3.types import common from google.cloud.monitoring_v3.types import mutation_record from google.cloud.monitoring_v3.types import notification from google.cloud.monitoring_v3.types import notification_service @@ -406,9 +405,11 @@ def list_notification_channel_descriptors( projects/[PROJECT_ID_OR_NUMBER] - Note that this names the parent container in which to - look for the descriptors; to retrieve a single - descriptor by name, use the + Note that this + `names `__ + the parent container in which to look for the + descriptors; to retrieve a single descriptor by name, + use the [GetNotificationChannelDescriptor][google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor] operation, instead. @@ -581,8 +582,9 @@ def list_notification_channels( The request object. The `ListNotificationChannels` request. name (str): - Required. The project on which to execute the request. - The format is: + Required. The + `project `__ + on which to execute the request. The format is: :: @@ -764,8 +766,9 @@ def create_notification_channel( The request object. The `CreateNotificationChannel` request. name (str): - Required. The project on which to execute the request. - The format is: + Required. The + `project `__ + on which to execute the request. The format is: :: diff --git a/google/cloud/monitoring_v3/services/notification_channel_service/transports/base.py b/google/cloud/monitoring_v3/services/notification_channel_service/transports/base.py index 66dc68c4..ae246a53 100644 --- a/google/cloud/monitoring_v3/services/notification_channel_service/transports/base.py +++ b/google/cloud/monitoring_v3/services/notification_channel_service/transports/base.py @@ -167,7 +167,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -182,7 +181,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -197,7 +195,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -212,7 +209,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -237,7 +233,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -257,7 +252,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -272,7 +266,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, diff --git a/google/cloud/monitoring_v3/services/service_monitoring_service/async_client.py b/google/cloud/monitoring_v3/services/service_monitoring_service/async_client.py index fc940793..012dd79f 100644 --- a/google/cloud/monitoring_v3/services/service_monitoring_service/async_client.py +++ b/google/cloud/monitoring_v3/services/service_monitoring_service/async_client.py @@ -196,8 +196,9 @@ async def create_service( request (:class:`google.cloud.monitoring_v3.types.CreateServiceRequest`): The request object. The `CreateService` request. parent (:class:`str`): - Required. Resource name of the parent workspace. The - format is: + Required. Resource + `name `__ + of the parent workspace. The format is: :: @@ -333,7 +334,6 @@ async def get_service( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -370,8 +370,9 @@ async def list_services( The request object. The `ListServices` request. parent (:class:`str`): Required. Resource name of the parent containing the - listed services, either a project or a Monitoring - Workspace. The formats are: + listed services, either a + `project `__ + or a Monitoring Workspace. The formats are: :: @@ -421,7 +422,6 @@ async def list_services( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -581,7 +581,6 @@ async def delete_service( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -773,7 +772,6 @@ async def get_service_level_objective( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -862,7 +860,6 @@ async def list_service_level_objectives( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -1037,7 +1034,6 @@ async def delete_service_level_objective( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, diff --git a/google/cloud/monitoring_v3/services/service_monitoring_service/client.py b/google/cloud/monitoring_v3/services/service_monitoring_service/client.py index dbb7658b..268165a2 100644 --- a/google/cloud/monitoring_v3/services/service_monitoring_service/client.py +++ b/google/cloud/monitoring_v3/services/service_monitoring_service/client.py @@ -393,8 +393,9 @@ def create_service( request (google.cloud.monitoring_v3.types.CreateServiceRequest): The request object. The `CreateService` request. parent (str): - Required. Resource name of the parent workspace. The - format is: + Required. Resource + `name `__ + of the parent workspace. The format is: :: @@ -557,8 +558,9 @@ def list_services( The request object. The `ListServices` request. parent (str): Required. Resource name of the parent containing the - listed services, either a project or a Monitoring - Workspace. The formats are: + listed services, either a + `project `__ + or a Monitoring Workspace. The formats are: :: diff --git a/google/cloud/monitoring_v3/services/service_monitoring_service/transports/base.py b/google/cloud/monitoring_v3/services/service_monitoring_service/transports/base.py index d10ef7a1..83cfc069 100644 --- a/google/cloud/monitoring_v3/services/service_monitoring_service/transports/base.py +++ b/google/cloud/monitoring_v3/services/service_monitoring_service/transports/base.py @@ -171,7 +171,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -186,7 +185,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -204,7 +202,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -224,7 +221,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -239,7 +235,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -259,7 +254,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, diff --git a/google/cloud/monitoring_v3/services/uptime_check_service/async_client.py b/google/cloud/monitoring_v3/services/uptime_check_service/async_client.py index 5cf92c80..cb7c6966 100644 --- a/google/cloud/monitoring_v3/services/uptime_check_service/async_client.py +++ b/google/cloud/monitoring_v3/services/uptime_check_service/async_client.py @@ -195,8 +195,10 @@ async def list_uptime_check_configs( The request object. The protocol for the `ListUptimeCheckConfigs` request. parent (:class:`str`): - Required. The project whose Uptime check configurations - are listed. The format is: + Required. The + `project `__ + whose Uptime check configurations are listed. The format + is: :: @@ -245,7 +247,6 @@ async def list_uptime_check_configs( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -337,7 +338,6 @@ async def get_uptime_check_config( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -375,8 +375,9 @@ async def create_uptime_check_config( The request object. The protocol for the `CreateUptimeCheckConfig` request. parent (:class:`str`): - Required. The project in which to create the Uptime - check. The format is: + Required. The + `project `__ + in which to create the Uptime check. The format is: :: @@ -594,7 +595,6 @@ async def delete_uptime_check_config( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -655,7 +655,6 @@ async def list_uptime_check_ips( maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, diff --git a/google/cloud/monitoring_v3/services/uptime_check_service/client.py b/google/cloud/monitoring_v3/services/uptime_check_service/client.py index 055b017c..0758d097 100644 --- a/google/cloud/monitoring_v3/services/uptime_check_service/client.py +++ b/google/cloud/monitoring_v3/services/uptime_check_service/client.py @@ -381,8 +381,10 @@ def list_uptime_check_configs( The request object. The protocol for the `ListUptimeCheckConfigs` request. parent (str): - Required. The project whose Uptime check configurations - are listed. The format is: + Required. The + `project `__ + whose Uptime check configurations are listed. The format + is: :: @@ -543,8 +545,9 @@ def create_uptime_check_config( The request object. The protocol for the `CreateUptimeCheckConfig` request. parent (str): - Required. The project in which to create the Uptime - check. The format is: + Required. The + `project `__ + in which to create the Uptime check. The format is: :: diff --git a/google/cloud/monitoring_v3/services/uptime_check_service/transports/base.py b/google/cloud/monitoring_v3/services/uptime_check_service/transports/base.py index 8a1e95f7..916fa344 100644 --- a/google/cloud/monitoring_v3/services/uptime_check_service/transports/base.py +++ b/google/cloud/monitoring_v3/services/uptime_check_service/transports/base.py @@ -167,7 +167,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -182,7 +181,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -207,7 +205,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, @@ -222,7 +219,6 @@ def _prep_wrapped_messages(self, client_info): maximum=30.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.DeadlineExceeded, core_exceptions.ServiceUnavailable, ), deadline=30.0, diff --git a/google/cloud/monitoring_v3/types/__init__.py b/google/cloud/monitoring_v3/types/__init__.py index 427f3a20..580e317a 100644 --- a/google/cloud/monitoring_v3/types/__init__.py +++ b/google/cloud/monitoring_v3/types/__init__.py @@ -27,7 +27,6 @@ TimeInterval, TypedValue, ComparisonType, - ServiceTier, ) from .dropped_labels import DroppedLabels from .group import Group @@ -144,7 +143,6 @@ "TimeInterval", "TypedValue", "ComparisonType", - "ServiceTier", "DroppedLabels", "Group", "CreateGroupRequest", diff --git a/google/cloud/monitoring_v3/types/alert.py b/google/cloud/monitoring_v3/types/alert.py index 74d67610..4c7b9989 100644 --- a/google/cloud/monitoring_v3/types/alert.py +++ b/google/cloud/monitoring_v3/types/alert.py @@ -120,6 +120,9 @@ class AlertPolicy(proto.Message): A read-only record of the most recent change to the alerting policy. If provided in a call to create or update, this field will be ignored. + alert_strategy (google.cloud.monitoring_v3.types.AlertPolicy.AlertStrategy): + Control over how this alert policy's + notification channels are notified. """ class ConditionCombinerType(proto.Enum): @@ -197,6 +200,10 @@ class Condition(proto.Message): condition_absent (google.cloud.monitoring_v3.types.AlertPolicy.Condition.MetricAbsence): A condition that checks that a time series continues to receive new data points. + condition_matched_log (google.cloud.monitoring_v3.types.AlertPolicy.Condition.LogMatch): + A condition that checks for log messages + matching given constraints. If set, no other + conditions can be present. condition_monitoring_query_language (google.cloud.monitoring_v3.types.AlertPolicy.Condition.MonitoringQueryLanguageCondition): A condition that uses the Monitoring Query Language to define alerts. @@ -388,6 +395,35 @@ class MetricAbsence(proto.Message): proto.MESSAGE, number=3, message="AlertPolicy.Condition.Trigger", ) + class LogMatch(proto.Message): + r"""A condition type that checks whether a log message in the `scoping + project `__ + satisfies the given filter. Logs from other projects in the metrics + scope are not evaluated. + + Attributes: + filter (str): + Required. A logs-based filter. See `Advanced Logs + Queries `__ for how + this filter should be constructed. + label_extractors (Sequence[google.cloud.monitoring_v3.types.AlertPolicy.Condition.LogMatch.LabelExtractorsEntry]): + Optional. A map from a label key to an extractor expression, + which is used to extract the value for this label key. Each + entry in this map is a specification for how data should be + extracted from log entries that match ``filter``. Each + combination of extracted values is treated as a separate + rule for the purposes of triggering notifications. Label + keys and corresponding values can be used in notifications + generated by this condition. + + Please see `the documentation on logs-based metric + ``valueExtractor``\ s `__ + for syntax and examples. + """ + + filter = proto.Field(proto.STRING, number=1,) + label_extractors = proto.MapField(proto.STRING, proto.STRING, number=2,) + class MonitoringQueryLanguageCondition(proto.Message): r"""A condition type that allows alert policies to be defined using `Monitoring Query @@ -442,6 +478,12 @@ class MonitoringQueryLanguageCondition(proto.Message): oneof="condition", message="AlertPolicy.Condition.MetricAbsence", ) + condition_matched_log = proto.Field( + proto.MESSAGE, + number=20, + oneof="condition", + message="AlertPolicy.Condition.LogMatch", + ) condition_monitoring_query_language = proto.Field( proto.MESSAGE, number=19, @@ -449,6 +491,37 @@ class MonitoringQueryLanguageCondition(proto.Message): message="AlertPolicy.Condition.MonitoringQueryLanguageCondition", ) + class AlertStrategy(proto.Message): + r"""Control over how the notification channels in + ``notification_channels`` are notified when this alert fires. + + Attributes: + notification_rate_limit (google.cloud.monitoring_v3.types.AlertPolicy.AlertStrategy.NotificationRateLimit): + Required for alert policies with a ``LogMatch`` condition. + + This limit is not implemented for alert policies that are + not log-based. + """ + + class NotificationRateLimit(proto.Message): + r"""Control over the rate of notifications sent to this alert + policy's notification channels. + + Attributes: + period (google.protobuf.duration_pb2.Duration): + Not more than one notification per ``period``. + """ + + period = proto.Field( + proto.MESSAGE, number=1, message=duration_pb2.Duration, + ) + + notification_rate_limit = proto.Field( + proto.MESSAGE, + number=1, + message="AlertPolicy.AlertStrategy.NotificationRateLimit", + ) + name = proto.Field(proto.STRING, number=1,) display_name = proto.Field(proto.STRING, number=2,) documentation = proto.Field(proto.MESSAGE, number=13, message=Documentation,) @@ -464,6 +537,7 @@ class MonitoringQueryLanguageCondition(proto.Message): mutation_record = proto.Field( proto.MESSAGE, number=11, message=gm_mutation_record.MutationRecord, ) + alert_strategy = proto.Field(proto.MESSAGE, number=21, message=AlertStrategy,) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/monitoring_v3/types/alert_service.py b/google/cloud/monitoring_v3/types/alert_service.py index 531ed7c9..7ee6b820 100644 --- a/google/cloud/monitoring_v3/types/alert_service.py +++ b/google/cloud/monitoring_v3/types/alert_service.py @@ -36,8 +36,9 @@ class CreateAlertPolicyRequest(proto.Message): r"""The protocol for the ``CreateAlertPolicy`` request. Attributes: name (str): - Required. The project in which to create the alerting - policy. The format is: + Required. The + `project `__ + in which to create the alerting policy. The format is: :: @@ -79,8 +80,9 @@ class ListAlertPoliciesRequest(proto.Message): r"""The protocol for the ``ListAlertPolicies`` request. Attributes: name (str): - Required. The project whose alert policies are to be listed. - The format is: + Required. The + `project `__ + whose alert policies are to be listed. The format is: :: diff --git a/google/cloud/monitoring_v3/types/common.py b/google/cloud/monitoring_v3/types/common.py index 363c393f..c5669f86 100644 --- a/google/cloud/monitoring_v3/types/common.py +++ b/google/cloud/monitoring_v3/types/common.py @@ -22,13 +22,7 @@ __protobuf__ = proto.module( package="google.monitoring.v3", - manifest={ - "ComparisonType", - "ServiceTier", - "TypedValue", - "TimeInterval", - "Aggregation", - }, + manifest={"ComparisonType", "TypedValue", "TimeInterval", "Aggregation",}, ) @@ -45,17 +39,6 @@ class ComparisonType(proto.Enum): COMPARISON_NE = 6 -class ServiceTier(proto.Enum): - r"""The tier of service for a Workspace. Please see the `service tiers - documentation `__ - for more details. - """ - _pb_options = {"deprecated": True} - SERVICE_TIER_UNSPECIFIED = 0 - SERVICE_TIER_BASIC = 1 - SERVICE_TIER_PREMIUM = 2 - - class TypedValue(proto.Message): r"""A single strongly-typed value. Attributes: @@ -88,7 +71,7 @@ class TimeInterval(proto.Message): r"""A closed time interval. It extends from the start time to the end time, and includes both: ``[startTime, endTime]``. Valid time intervals depend on the - ```MetricKind`` `__ + ```MetricKind`` `__ of the metric value. The end time must not be earlier than the start time. When writing data points, the start time must not be more than 25 hours in the past and the end time must not be more than five diff --git a/google/cloud/monitoring_v3/types/group_service.py b/google/cloud/monitoring_v3/types/group_service.py index ecd9241e..b450f470 100644 --- a/google/cloud/monitoring_v3/types/group_service.py +++ b/google/cloud/monitoring_v3/types/group_service.py @@ -39,8 +39,9 @@ class ListGroupsRequest(proto.Message): r"""The ``ListGroup`` request. Attributes: name (str): - Required. The project whose groups are to be listed. The - format is: + Required. The + `project `__ + whose groups are to be listed. The format is: :: @@ -134,8 +135,9 @@ class CreateGroupRequest(proto.Message): r"""The ``CreateGroup`` request. Attributes: name (str): - Required. The project in which to create the group. The - format is: + Required. The + `project `__ + in which to create the group. The format is: :: diff --git a/google/cloud/monitoring_v3/types/metric.py b/google/cloud/monitoring_v3/types/metric.py index 8c7d56ca..d364d76a 100644 --- a/google/cloud/monitoring_v3/types/metric.py +++ b/google/cloud/monitoring_v3/types/metric.py @@ -70,9 +70,11 @@ class TimeSeries(proto.Message): The associated metric. A fully-specified metric used to identify the time series. resource (google.api.monitored_resource_pb2.MonitoredResource): - The associated monitored resource. Custom - metrics can use only certain monitored resource - types in their time series data. + The associated monitored resource. Custom metrics can use + only certain monitored resource types in their time series + data. For more information, see `Monitored resources for + custom + metrics `__. metadata (google.api.monitored_resource_pb2.MonitoredResourceMetadata): Output only. The associated monitored resource metadata. When reading a time series, diff --git a/google/cloud/monitoring_v3/types/metric_service.py b/google/cloud/monitoring_v3/types/metric_service.py index 14d1005b..15cfc281 100644 --- a/google/cloud/monitoring_v3/types/metric_service.py +++ b/google/cloud/monitoring_v3/types/metric_service.py @@ -49,8 +49,9 @@ class ListMonitoredResourceDescriptorsRequest(proto.Message): r"""The ``ListMonitoredResourceDescriptors`` request. Attributes: name (str): - Required. The project on which to execute the request. The - format is: + Required. The + `project `__ + on which to execute the request. The format is: :: @@ -129,8 +130,9 @@ class ListMetricDescriptorsRequest(proto.Message): r"""The ``ListMetricDescriptors`` request. Attributes: name (str): - Required. The project on which to execute the request. The - format is: + Required. The + `project `__ + on which to execute the request. The format is: :: @@ -207,12 +209,10 @@ class CreateMetricDescriptorRequest(proto.Message): r"""The ``CreateMetricDescriptor`` request. Attributes: name (str): - Required. The project on which to execute the request. The - format is: - - :: - - projects/[PROJECT_ID_OR_NUMBER] + Required. The + `project `__ + on which to execute the request. The format is: 4 + projects/[PROJECT_ID_OR_NUMBER] metric_descriptor (google.api.metric_pb2.MetricDescriptor): Required. The new `custom metric `__ @@ -247,8 +247,10 @@ class ListTimeSeriesRequest(proto.Message): r"""The ``ListTimeSeries`` request. Attributes: name (str): - Required. The project, organization or folder on which to - execute the request. The format is: + Required. The + `project `__, + organization or folder on which to execute the request. The + format is: :: @@ -362,8 +364,9 @@ class CreateTimeSeriesRequest(proto.Message): r"""The ``CreateTimeSeries`` request. Attributes: name (str): - Required. The project on which to execute the request. The - format is: + Required. The + `project `__ + on which to execute the request. The format is: :: @@ -438,8 +441,9 @@ class QueryTimeSeriesRequest(proto.Message): r"""The ``QueryTimeSeries`` request. Attributes: name (str): - Required. The project on which to execute the request. The - format is: + Required. The + `project `__ + on which to execute the request. The format is: :: diff --git a/google/cloud/monitoring_v3/types/notification.py b/google/cloud/monitoring_v3/types/notification.py index b1da8ada..1df93b17 100644 --- a/google/cloud/monitoring_v3/types/notification.py +++ b/google/cloud/monitoring_v3/types/notification.py @@ -17,7 +17,6 @@ from google.api import label_pb2 # type: ignore from google.api import launch_stage_pb2 # type: ignore -from google.cloud.monitoring_v3.types import common from google.cloud.monitoring_v3.types import mutation_record from google.protobuf import wrappers_pb2 # type: ignore @@ -64,9 +63,6 @@ class NotificationChannelDescriptor(proto.Message): corresponding type. Each label includes a description for how that field should be populated. - supported_tiers (Sequence[google.cloud.monitoring_v3.types.ServiceTier]): - The tiers that support this notification channel; the - project service tier must be one of the supported_tiers. launch_stage (google.api.launch_stage_pb2.LaunchStage): The product launch stage for channels of this type. @@ -79,9 +75,6 @@ class NotificationChannelDescriptor(proto.Message): labels = proto.RepeatedField( proto.MESSAGE, number=4, message=label_pb2.LabelDescriptor, ) - supported_tiers = proto.RepeatedField( - proto.ENUM, number=5, enum=common.ServiceTier, - ) launch_stage = proto.Field(proto.ENUM, number=7, enum=launch_stage_pb2.LaunchStage,) diff --git a/google/cloud/monitoring_v3/types/notification_service.py b/google/cloud/monitoring_v3/types/notification_service.py index 58886166..db736eb8 100644 --- a/google/cloud/monitoring_v3/types/notification_service.py +++ b/google/cloud/monitoring_v3/types/notification_service.py @@ -52,9 +52,10 @@ class ListNotificationChannelDescriptorsRequest(proto.Message): projects/[PROJECT_ID_OR_NUMBER] - Note that this names the parent container in which to look - for the descriptors; to retrieve a single descriptor by - name, use the + Note that this + `names `__ + the parent container in which to look for the descriptors; + to retrieve a single descriptor by name, use the [GetNotificationChannelDescriptor][google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor] operation, instead. page_size (int): @@ -115,8 +116,9 @@ class CreateNotificationChannelRequest(proto.Message): r"""The ``CreateNotificationChannel`` request. Attributes: name (str): - Required. The project on which to execute the request. The - format is: + Required. The + `project `__ + on which to execute the request. The format is: :: @@ -143,8 +145,9 @@ class ListNotificationChannelsRequest(proto.Message): r"""The ``ListNotificationChannels`` request. Attributes: name (str): - Required. The project on which to execute the request. The - format is: + Required. The + `project `__ + on which to execute the request. The format is: :: diff --git a/google/cloud/monitoring_v3/types/service.py b/google/cloud/monitoring_v3/types/service.py index e6c71d51..1cf9bccf 100644 --- a/google/cloud/monitoring_v3/types/service.py +++ b/google/cloud/monitoring_v3/types/service.py @@ -71,6 +71,17 @@ class Service(proto.Message): telemetry (google.cloud.monitoring_v3.types.Service.Telemetry): Configuration for how to query telemetry on a Service. + user_labels (Sequence[google.cloud.monitoring_v3.types.Service.UserLabelsEntry]): + Labels which have been used to annotate the + service. Label keys must start with a letter. + Label keys and values may contain lowercase + letters, numbers, underscores, and dashes. Label + keys and values have a maximum length of 63 + characters, and must be less than 128 bytes in + size. Up to 64 label entries may be stored. For + labels which do not have a semantic value, the + empty string may be supplied for the label + value. """ class Custom(proto.Message): @@ -217,6 +228,7 @@ class Telemetry(proto.Message): proto.MESSAGE, number=11, oneof="identifier", message=IstioCanonicalService, ) telemetry = proto.Field(proto.MESSAGE, number=13, message=Telemetry,) + user_labels = proto.MapField(proto.STRING, proto.STRING, number=14,) class ServiceLevelObjective(proto.Message): @@ -254,6 +266,17 @@ class ServiceLevelObjective(proto.Message): A calendar period, semantically "since the start of the current ````". At this time, only ``DAY``, ``WEEK``, ``FORTNIGHT``, and ``MONTH`` are supported. + user_labels (Sequence[google.cloud.monitoring_v3.types.ServiceLevelObjective.UserLabelsEntry]): + Labels which have been used to annotate the + service-level objective. Label keys must start + with a letter. Label keys and values may contain + lowercase letters, numbers, underscores, and + dashes. Label keys and values have a maximum + length of 63 characters, and must be less than + 128 bytes in size. Up to 64 label entries may be + stored. For labels which do not have a semantic + value, the empty string may be supplied for the + label value. """ class View(proto.Enum): @@ -278,6 +301,7 @@ class View(proto.Enum): calendar_period = proto.Field( proto.ENUM, number=6, oneof="period", enum=calendar_period_pb2.CalendarPeriod, ) + user_labels = proto.MapField(proto.STRING, proto.STRING, number=12,) class ServiceLevelIndicator(proto.Message): @@ -384,10 +408,7 @@ class LatencyCriteria(proto.Message): class Range(proto.Message): - r"""Range of numerical values, inclusive of ``min`` and exclusive of - ``max``. If the open range "< range.max" is desired, set - ``range.min = -infinity``. If the open range ">= range.min" is - desired, set ``range.max = infinity``. + r"""Range of numerical values within ``min`` and ``max``. Attributes: min_ (float): @@ -468,8 +489,8 @@ class DistributionCut(proto.Message): for measuring good service and total service. The ``TimeSeries`` must have ``ValueType = DISTRIBUTION`` and ``MetricKind = DELTA`` or ``MetricKind = CUMULATIVE``. The computed ``good_service`` will be - the count of values x in the ``Distribution`` such that - ``range.min <= x < range.max``. + the estimated count of values in the ``Distribution`` that fall + within the specified ``min`` and ``max``. Attributes: distribution_filter (str): @@ -536,9 +557,10 @@ class PerformanceThreshold(proto.Message): class MetricRange(proto.Message): r"""A ``MetricRange`` is used when each window is good when the value x - of a single ``TimeSeries`` satisfies ``range.min <= x < range.max``. - The provided ``TimeSeries`` must have ``ValueType = INT64`` or - ``ValueType = DOUBLE`` and ``MetricKind = GAUGE``. + of a single ``TimeSeries`` satisfies + ``range.min <= x <= range.max``. The provided ``TimeSeries`` must + have ``ValueType = INT64`` or ``ValueType = DOUBLE`` and + ``MetricKind = GAUGE``. Attributes: time_series (str): diff --git a/google/cloud/monitoring_v3/types/service_service.py b/google/cloud/monitoring_v3/types/service_service.py index 2b7db781..cd68e245 100644 --- a/google/cloud/monitoring_v3/types/service_service.py +++ b/google/cloud/monitoring_v3/types/service_service.py @@ -42,8 +42,9 @@ class CreateServiceRequest(proto.Message): r"""The ``CreateService`` request. Attributes: parent (str): - Required. Resource name of the parent workspace. The format - is: + Required. Resource + `name `__ + of the parent workspace. The format is: :: @@ -80,8 +81,9 @@ class ListServicesRequest(proto.Message): Attributes: parent (str): Required. Resource name of the parent containing the listed - services, either a project or a Monitoring Workspace. The - formats are: + services, either a + `project `__ + or a Monitoring Workspace. The formats are: :: diff --git a/google/cloud/monitoring_v3/types/span_context.py b/google/cloud/monitoring_v3/types/span_context.py index 5689065b..d33b3c24 100644 --- a/google/cloud/monitoring_v3/types/span_context.py +++ b/google/cloud/monitoring_v3/types/span_context.py @@ -20,8 +20,8 @@ class SpanContext(proto.Message): - r"""The context of a span, attached to - [Exemplars][google.api.Distribution.Exemplars] in + r"""The context of a span. This is attached to an + [Exemplar][google.api.Distribution.Exemplar] in [Distribution][google.api.Distribution] values during aggregation. It contains the name of a span with format: diff --git a/google/cloud/monitoring_v3/types/uptime.py b/google/cloud/monitoring_v3/types/uptime.py index 9a6fa92b..e3218bc2 100644 --- a/google/cloud/monitoring_v3/types/uptime.py +++ b/google/cloud/monitoring_v3/types/uptime.py @@ -134,9 +134,9 @@ class UptimeCheckConfig(proto.Message): The `monitored resource `__ associated with the configuration. The following monitored - resource types are supported for Uptime checks: - ``uptime_url``, ``gce_instance``, ``gae_app``, - ``aws_ec2_instance``, ``aws_elb_load_balancer`` + resource types are valid for this field: ``uptime_url``, + ``gce_instance``, ``gae_app``, ``aws_ec2_instance``, + ``aws_elb_load_balancer`` ``k8s_service`` resource_group (google.cloud.monitoring_v3.types.UptimeCheckConfig.ResourceGroup): The group resource associated with the configuration. diff --git a/google/cloud/monitoring_v3/types/uptime_service.py b/google/cloud/monitoring_v3/types/uptime_service.py index b7780564..5f2bc919 100644 --- a/google/cloud/monitoring_v3/types/uptime_service.py +++ b/google/cloud/monitoring_v3/types/uptime_service.py @@ -38,8 +38,9 @@ class ListUptimeCheckConfigsRequest(proto.Message): r"""The protocol for the ``ListUptimeCheckConfigs`` request. Attributes: parent (str): - Required. The project whose Uptime check configurations are - listed. The format is: + Required. The + `project `__ + whose Uptime check configurations are listed. The format is: :: @@ -110,8 +111,9 @@ class CreateUptimeCheckConfigRequest(proto.Message): r"""The protocol for the ``CreateUptimeCheckConfig`` request. Attributes: parent (str): - Required. The project in which to create the Uptime check. - The format is: + Required. The + `project `__ + in which to create the Uptime check. The format is: :: diff --git a/owlbot.py b/owlbot.py index bb935a64..a75121f5 100644 --- a/owlbot.py +++ b/owlbot.py @@ -71,6 +71,14 @@ re.MULTILINE| re.DOTALL ) + # Work around gapic generator bug https://github.com/googleapis/gapic-generator-python/issues/902 + s.replace(library / f"google/cloud/monitoring_{library.name}/types/service.py", + r""". + Attributes:""", + r""".\n + Attributes:""", + ) + # don't copy nox.py, setup.py, README.rst, docs/index.rst excludes = ["nox.py", "setup.py", "README.rst", "docs/index.rst"] s.move(library, excludes=excludes) diff --git a/tests/unit/gapic/monitoring_v3/test_notification_channel_service.py b/tests/unit/gapic/monitoring_v3/test_notification_channel_service.py index 1228ffca..07ae251a 100644 --- a/tests/unit/gapic/monitoring_v3/test_notification_channel_service.py +++ b/tests/unit/gapic/monitoring_v3/test_notification_channel_service.py @@ -44,7 +44,6 @@ from google.cloud.monitoring_v3.services.notification_channel_service.transports.base import ( _GOOGLE_AUTH_VERSION, ) -from google.cloud.monitoring_v3.types import common from google.cloud.monitoring_v3.types import mutation_record from google.cloud.monitoring_v3.types import notification from google.cloud.monitoring_v3.types import notification_service @@ -987,7 +986,6 @@ def test_get_notification_channel_descriptor( type_="type__value", display_name="display_name_value", description="description_value", - supported_tiers=[common.ServiceTier.SERVICE_TIER_BASIC], ) response = client.get_notification_channel_descriptor(request) @@ -1002,7 +1000,6 @@ def test_get_notification_channel_descriptor( assert response.type_ == "type__value" assert response.display_name == "display_name_value" assert response.description == "description_value" - assert response.supported_tiers == [common.ServiceTier.SERVICE_TIER_BASIC] def test_get_notification_channel_descriptor_from_dict(): @@ -1050,7 +1047,6 @@ async def test_get_notification_channel_descriptor_async( type_="type__value", display_name="display_name_value", description="description_value", - supported_tiers=[common.ServiceTier.SERVICE_TIER_BASIC], ) ) response = await client.get_notification_channel_descriptor(request) @@ -1066,7 +1062,6 @@ async def test_get_notification_channel_descriptor_async( assert response.type_ == "type__value" assert response.display_name == "display_name_value" assert response.description == "description_value" - assert response.supported_tiers == [common.ServiceTier.SERVICE_TIER_BASIC] @pytest.mark.asyncio