diff --git a/monitoring/docs/_static/custom.css b/monitoring/docs/_static/custom.css index 9a6f9f8ddc3a..0abaf229fce3 100644 --- a/monitoring/docs/_static/custom.css +++ b/monitoring/docs/_static/custom.css @@ -1,4 +1,4 @@ div#python2-eol { border-color: red; border-width: medium; -} \ No newline at end of file +} \ No newline at end of file diff --git a/monitoring/docs/_templates/layout.html b/monitoring/docs/_templates/layout.html index de457b2c2767..228529efe2d2 100644 --- a/monitoring/docs/_templates/layout.html +++ b/monitoring/docs/_templates/layout.html @@ -1,3 +1,4 @@ + {% extends "!layout.html" %} {%- block content %} {%- if theme_fixed_sidebar|lower == 'true' %} diff --git a/monitoring/docs/conf.py b/monitoring/docs/conf.py index 0eebd9f5abb0..c60fdc6ef963 100644 --- a/monitoring/docs/conf.py +++ b/monitoring/docs/conf.py @@ -164,7 +164,7 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] +# html_static_path = [] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied @@ -264,7 +264,7 @@ u"google-cloud-monitoring Documentation", author, "manual", - ) + ), ] # The name of an image file (relative to this directory) to place at the top of @@ -320,7 +320,7 @@ "google-cloud-monitoring", "GAPIC library for the {metadata.shortName} v3 service", "APIs", - ) + ), ] # Documents to append as an appendix to all manuals. diff --git a/monitoring/google/cloud/monitoring.py b/monitoring/google/cloud/monitoring.py index a6b0063387b9..a84ebd6ebd66 100644 --- a/monitoring/google/cloud/monitoring.py +++ b/monitoring/google/cloud/monitoring.py @@ -21,6 +21,7 @@ from google.cloud.monitoring_v3 import GroupServiceClient from google.cloud.monitoring_v3 import MetricServiceClient from google.cloud.monitoring_v3 import NotificationChannelServiceClient +from google.cloud.monitoring_v3 import ServiceMonitoringServiceClient from google.cloud.monitoring_v3 import UptimeCheckServiceClient from google.cloud.monitoring_v3 import enums from google.cloud.monitoring_v3 import types @@ -33,5 +34,6 @@ "GroupServiceClient", "MetricServiceClient", "NotificationChannelServiceClient", + "ServiceMonitoringServiceClient", "UptimeCheckServiceClient", ) diff --git a/monitoring/google/cloud/monitoring_v3/__init__.py b/monitoring/google/cloud/monitoring_v3/__init__.py index 9aeee930f849..3fb6b4d96819 100644 --- a/monitoring/google/cloud/monitoring_v3/__init__.py +++ b/monitoring/google/cloud/monitoring_v3/__init__.py @@ -25,6 +25,7 @@ from google.cloud.monitoring_v3.gapic import ( notification_channel_service_client as notification_client, ) +from google.cloud.monitoring_v3.gapic import service_monitoring_service_client from google.cloud.monitoring_v3.gapic import uptime_check_service_client @@ -50,6 +51,13 @@ class NotificationChannelServiceClient( enums = enums +class ServiceMonitoringServiceClient( + service_monitoring_service_client.ServiceMonitoringServiceClient +): + __doc__ = service_monitoring_service_client.ServiceMonitoringServiceClient.__doc__ + enums = enums + + class UptimeCheckServiceClient(uptime_check_service_client.UptimeCheckServiceClient): __doc__ = uptime_check_service_client.UptimeCheckServiceClient.__doc__ enums = enums @@ -62,5 +70,6 @@ class UptimeCheckServiceClient(uptime_check_service_client.UptimeCheckServiceCli "GroupServiceClient", "MetricServiceClient", "NotificationChannelServiceClient", + "ServiceMonitoringServiceClient", "UptimeCheckServiceClient", ) diff --git a/monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client.py b/monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client.py index d13448b52d93..0b8d0a9e263e 100644 --- a/monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client.py +++ b/monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client.py @@ -44,7 +44,7 @@ _GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-monitoring" + "google-cloud-monitoring", ).version @@ -111,7 +111,7 @@ def alert_policy_condition_path(cls, project, alert_policy, condition): def project_path(cls, project): """Return a fully-qualified project string.""" return google.api_core.path_template.expand( - "projects/{project}", project=project + "projects/{project}", project=project, ) def __init__( @@ -201,12 +201,12 @@ def __init__( self.transport = transport else: self.transport = alert_policy_service_grpc_transport.AlertPolicyServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials + address=api_endpoint, channel=channel, credentials=credentials, ) if client_info is None: client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION + gapic_version=_GAPIC_LIBRARY_VERSION, ) else: client_info.gapic_version = _GAPIC_LIBRARY_VERSION @@ -217,7 +217,7 @@ def __init__( # (Ordinarily, these are the defaults specified in the `*_config.py` # file next to this one.) self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] + client_config["interfaces"][self._INTERFACE_NAME], ) # Save a dictionary of cached API call functions. @@ -322,7 +322,7 @@ def list_alert_policies( ) request = alert_service_pb2.ListAlertPoliciesRequest( - name=name, filter=filter_, order_by=order_by, page_size=page_size + name=name, filter=filter_, order_by=order_by, page_size=page_size, ) if metadata is None: metadata = [] @@ -408,7 +408,7 @@ def get_alert_policy( client_info=self._client_info, ) - request = alert_service_pb2.GetAlertPolicyRequest(name=name) + request = alert_service_pb2.GetAlertPolicyRequest(name=name,) if metadata is None: metadata = [] metadata = list(metadata) @@ -498,7 +498,7 @@ def create_alert_policy( ) request = alert_service_pb2.CreateAlertPolicyRequest( - name=name, alert_policy=alert_policy + name=name, alert_policy=alert_policy, ) if metadata is None: metadata = [] @@ -572,7 +572,7 @@ def delete_alert_policy( client_info=self._client_info, ) - request = alert_service_pb2.DeleteAlertPolicyRequest(name=name) + request = alert_service_pb2.DeleteAlertPolicyRequest(name=name,) if metadata is None: metadata = [] metadata = list(metadata) @@ -681,7 +681,7 @@ def update_alert_policy( ) request = alert_service_pb2.UpdateAlertPolicyRequest( - alert_policy=alert_policy, update_mask=update_mask + alert_policy=alert_policy, update_mask=update_mask, ) if metadata is None: metadata = [] diff --git a/monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client_config.py b/monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client_config.py index 279c75403897..5aed862abe3a 100644 --- a/monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client_config.py +++ b/monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client_config.py @@ -18,27 +18,27 @@ }, "methods": { "ListAlertPolicies": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "GetAlertPolicy": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "CreateAlertPolicy": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, "DeleteAlertPolicy": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "UpdateAlertPolicy": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, diff --git a/monitoring/google/cloud/monitoring_v3/gapic/enums.py b/monitoring/google/cloud/monitoring_v3/gapic/enums.py index d23a2576729b..7b5d0ef54b6f 100644 --- a/monitoring/google/cloud/monitoring_v3/gapic/enums.py +++ b/monitoring/google/cloud/monitoring_v3/gapic/enums.py @@ -19,6 +19,37 @@ import enum +class CalendarPeriod(enum.IntEnum): + """ + A ``CalendarPeriod`` represents the abstract concept of a time period + that has a canonical start. Grammatically, "the start of the current + ``CalendarPeriod``." All calendar times begin at midnight UTC. + + Attributes: + CALENDAR_PERIOD_UNSPECIFIED (int): Undefined period, raises an error. + DAY (int): A day. + WEEK (int): A week. Weeks begin on Monday, following `ISO + 8601 `__. + FORTNIGHT (int): A fortnight. The first calendar fortnight of the year begins at the + start of week 1 according to `ISO + 8601 `__. + MONTH (int): A month. + QUARTER (int): A quarter. Quarters start on dates 1-Jan, 1-Apr, 1-Jul, and 1-Oct of each + year. + HALF (int): A half-year. Half-years start on dates 1-Jan and 1-Jul. + YEAR (int): A year. + """ + + CALENDAR_PERIOD_UNSPECIFIED = 0 + DAY = 1 + WEEK = 2 + FORTNIGHT = 3 + MONTH = 4 + QUARTER = 5 + HALF = 6 + YEAR = 7 + + class ComparisonType(enum.IntEnum): """ Specifies an ordering relationship on two arguments, here called left and @@ -525,6 +556,32 @@ class VerificationStatus(enum.IntEnum): VERIFIED = 2 +class ServiceLevelObjective(object): + class View(enum.IntEnum): + """ + ``ServiceLevelObjective.View`` determines what form of + ``ServiceLevelObjective`` is returned from ``GetServiceLevelObjective``, + ``ListServiceLevelObjectives``, and + ``ListServiceLevelObjectiveVersions`` RPCs. + + Attributes: + VIEW_UNSPECIFIED (int): Same as FULL. + FULL (int): Return the embedded ``ServiceLevelIndicator`` in the form in which it + was defined. If it was defined using a ``BasicSli``, return that + ``BasicSli``. + EXPLICIT (int): For ``ServiceLevelIndicator``\ s using ``BasicSli`` articulation, + instead return the ``ServiceLevelIndicator`` with its mode of + computation fully spelled out as a ``RequestBasedSli``. For + ``ServiceLevelIndicator``\ s using ``RequestBasedSli`` or + ``WindowsBasedSli``, return the ``ServiceLevelIndicator`` as it was + provided. + """ + + VIEW_UNSPECIFIED = 0 + FULL = 2 + EXPLICIT = 1 + + class UptimeCheckConfig(object): class ContentMatcher(object): class ContentMatcherOption(enum.IntEnum): @@ -535,17 +592,17 @@ class ContentMatcherOption(enum.IntEnum): CONTENT_MATCHER_OPTION_UNSPECIFIED (int): No content matcher type specified (maintained for backward compatibility, but deprecated for future use). Treated as ``CONTAINS_STRING``. - CONTAINS_STRING (int): Selects substring matching (there is a match if the output contains the - ``content`` string). This is the default value for checks without a + CONTAINS_STRING (int): Selects substring matching. The match succeeds if the output contains + the ``content`` string. This is the default value for checks without a ``matcher`` option, or where the value of ``matcher`` is ``CONTENT_MATCHER_OPTION_UNSPECIFIED``. - NOT_CONTAINS_STRING (int): Selects negation of substring matching (there is a match if the output - does NOT contain the ``content`` string). - MATCHES_REGEX (int): Selects regular expression matching (there is a match of the output - matches the regular expression specified in the ``content`` string). - NOT_MATCHES_REGEX (int): Selects negation of regular expression matching (there is a match if the - output does NOT match the regular expression specified in the - ``content`` string). + NOT_CONTAINS_STRING (int): Selects negation of substring matching. The match succeeds if the output + does *NOT* contain the ``content`` string. + MATCHES_REGEX (int): Selects regular-expression matching. The match succeeds of the output + matches the regular expression specified in the ``content`` string. + NOT_MATCHES_REGEX (int): Selects negation of regular-expression matching. The match succeeds if + the output does *NOT* match the regular expression specified in the + ``content`` string. """ CONTENT_MATCHER_OPTION_UNSPECIFIED = 0 diff --git a/monitoring/google/cloud/monitoring_v3/gapic/group_service_client.py b/monitoring/google/cloud/monitoring_v3/gapic/group_service_client.py index 96f19fb89fc5..5ccecdb688a8 100644 --- a/monitoring/google/cloud/monitoring_v3/gapic/group_service_client.py +++ b/monitoring/google/cloud/monitoring_v3/gapic/group_service_client.py @@ -47,7 +47,7 @@ _GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-monitoring" + "google-cloud-monitoring", ).version @@ -97,14 +97,14 @@ def from_service_account_file(cls, filename, *args, **kwargs): def group_path(cls, project, group): """Return a fully-qualified group string.""" return google.api_core.path_template.expand( - "projects/{project}/groups/{group}", project=project, group=group + "projects/{project}/groups/{group}", project=project, group=group, ) @classmethod def project_path(cls, project): """Return a fully-qualified project string.""" return google.api_core.path_template.expand( - "projects/{project}", project=project + "projects/{project}", project=project, ) def __init__( @@ -194,12 +194,12 @@ def __init__( self.transport = transport else: self.transport = group_service_grpc_transport.GroupServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials + address=api_endpoint, channel=channel, credentials=credentials, ) if client_info is None: client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION + gapic_version=_GAPIC_LIBRARY_VERSION, ) else: client_info.gapic_version = _GAPIC_LIBRARY_VERSION @@ -210,7 +210,7 @@ def __init__( # (Ordinarily, these are the defaults specified in the `*_config.py` # file next to this one.) self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] + client_config["interfaces"][self._INTERFACE_NAME], ) # Save a dictionary of cached API call functions. @@ -409,7 +409,7 @@ def get_group( client_info=self._client_info, ) - request = group_service_pb2.GetGroupRequest(name=name) + request = group_service_pb2.GetGroupRequest(name=name,) if metadata is None: metadata = [] metadata = list(metadata) @@ -494,7 +494,7 @@ def create_group( ) request = group_service_pb2.CreateGroupRequest( - name=name, group=group, validate_only=validate_only + name=name, group=group, validate_only=validate_only, ) if metadata is None: metadata = [] @@ -577,7 +577,7 @@ def update_group( ) request = group_service_pb2.UpdateGroupRequest( - group=group, validate_only=validate_only + group=group, validate_only=validate_only, ) if metadata is None: metadata = [] @@ -652,7 +652,7 @@ def delete_group( client_info=self._client_info, ) - request = group_service_pb2.DeleteGroupRequest(name=name, recursive=recursive) + request = group_service_pb2.DeleteGroupRequest(name=name, recursive=recursive,) if metadata is None: metadata = [] metadata = list(metadata) @@ -766,7 +766,7 @@ def list_group_members( ) request = group_service_pb2.ListGroupMembersRequest( - name=name, page_size=page_size, filter=filter_, interval=interval + name=name, page_size=page_size, filter=filter_, interval=interval, ) if metadata is None: metadata = [] diff --git a/monitoring/google/cloud/monitoring_v3/gapic/group_service_client_config.py b/monitoring/google/cloud/monitoring_v3/gapic/group_service_client_config.py index 24157aaacd5d..786ec6bab83c 100644 --- a/monitoring/google/cloud/monitoring_v3/gapic/group_service_client_config.py +++ b/monitoring/google/cloud/monitoring_v3/gapic/group_service_client_config.py @@ -18,32 +18,32 @@ }, "methods": { "ListGroups": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "GetGroup": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "CreateGroup": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, "UpdateGroup": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "DeleteGroup": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "ListGroupMembers": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, diff --git a/monitoring/google/cloud/monitoring_v3/gapic/metric_service_client.py b/monitoring/google/cloud/monitoring_v3/gapic/metric_service_client.py index 1ac23f97796f..f79e86a16215 100644 --- a/monitoring/google/cloud/monitoring_v3/gapic/metric_service_client.py +++ b/monitoring/google/cloud/monitoring_v3/gapic/metric_service_client.py @@ -51,7 +51,7 @@ _GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-monitoring" + "google-cloud-monitoring", ).version @@ -110,7 +110,7 @@ def monitored_resource_descriptor_path(cls, project, monitored_resource_descript def project_path(cls, project): """Return a fully-qualified project string.""" return google.api_core.path_template.expand( - "projects/{project}", project=project + "projects/{project}", project=project, ) def __init__( @@ -200,12 +200,12 @@ def __init__( self.transport = transport else: self.transport = metric_service_grpc_transport.MetricServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials + address=api_endpoint, channel=channel, credentials=credentials, ) if client_info is None: client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION + gapic_version=_GAPIC_LIBRARY_VERSION, ) else: client_info.gapic_version = _GAPIC_LIBRARY_VERSION @@ -216,7 +216,7 @@ def __init__( # (Ordinarily, these are the defaults specified in the `*_config.py` # file next to this one.) self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] + client_config["interfaces"][self._INTERFACE_NAME], ) # Save a dictionary of cached API call functions. @@ -317,7 +317,7 @@ def list_monitored_resource_descriptors( ) request = metric_service_pb2.ListMonitoredResourceDescriptorsRequest( - name=name, filter=filter_, page_size=page_size + name=name, filter=filter_, page_size=page_size, ) if metadata is None: metadata = [] @@ -408,7 +408,7 @@ def get_monitored_resource_descriptor( client_info=self._client_info, ) - request = metric_service_pb2.GetMonitoredResourceDescriptorRequest(name=name) + request = metric_service_pb2.GetMonitoredResourceDescriptorRequest(name=name,) if metadata is None: metadata = [] metadata = list(metadata) @@ -514,7 +514,7 @@ def list_metric_descriptors( ) request = metric_service_pb2.ListMetricDescriptorsRequest( - name=name, filter=filter_, page_size=page_size + name=name, filter=filter_, page_size=page_size, ) if metadata is None: metadata = [] @@ -601,7 +601,7 @@ def get_metric_descriptor( client_info=self._client_info, ) - request = metric_service_pb2.GetMetricDescriptorRequest(name=name) + request = metric_service_pb2.GetMetricDescriptorRequest(name=name,) if metadata is None: metadata = [] metadata = list(metadata) @@ -686,7 +686,7 @@ def create_metric_descriptor( ) request = metric_service_pb2.CreateMetricDescriptorRequest( - name=name, metric_descriptor=metric_descriptor + name=name, metric_descriptor=metric_descriptor, ) if metadata is None: metadata = [] @@ -761,7 +761,7 @@ def delete_metric_descriptor( client_info=self._client_info, ) - request = metric_service_pb2.DeleteMetricDescriptorRequest(name=name) + request = metric_service_pb2.DeleteMetricDescriptorRequest(name=name,) if metadata is None: metadata = [] metadata = list(metadata) @@ -846,14 +846,16 @@ def list_time_series( If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.monitoring_v3.types.TimeInterval` view (~google.cloud.monitoring_v3.types.TimeSeriesView): Specifies which information is returned about the time series. - aggregation (Union[dict, ~google.cloud.monitoring_v3.types.Aggregation]): By default, the raw time series data is returned. - Use this field to combine multiple time series for different - views of the data. + aggregation (Union[dict, ~google.cloud.monitoring_v3.types.Aggregation]): Specifies the alignment of data points in individual time series as well + as how to combine the retrieved time series across specified labels. + + By default (if no ``aggregation`` is explicitly specified), the raw time + series data is returned. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.monitoring_v3.types.Aggregation` order_by (str): Unsupported: must be left blank. The points in each time series are - returned in reverse time order. + currently returned in reverse time order (most recent to oldest). page_size (int): The maximum number of resources contained in the underlying API response. If page streaming is performed per- resource, this parameter does not affect the return value. If page @@ -1003,7 +1005,7 @@ def create_time_series( ) request = metric_service_pb2.CreateTimeSeriesRequest( - name=name, time_series=time_series + name=name, time_series=time_series, ) if metadata is None: metadata = [] diff --git a/monitoring/google/cloud/monitoring_v3/gapic/metric_service_client_config.py b/monitoring/google/cloud/monitoring_v3/gapic/metric_service_client_config.py index 56ae49b29428..165949239f6c 100644 --- a/monitoring/google/cloud/monitoring_v3/gapic/metric_service_client_config.py +++ b/monitoring/google/cloud/monitoring_v3/gapic/metric_service_client_config.py @@ -18,37 +18,37 @@ }, "methods": { "ListMonitoredResourceDescriptors": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "GetMonitoredResourceDescriptor": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "ListMetricDescriptors": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "GetMetricDescriptor": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "CreateMetricDescriptor": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, "DeleteMetricDescriptor": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "ListTimeSeries": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, diff --git a/monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client.py b/monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client.py index 8f77e1b3aff1..64c4ec9e32d5 100644 --- a/monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client.py +++ b/monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client.py @@ -57,7 +57,7 @@ _GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-monitoring" + "google-cloud-monitoring", ).version @@ -116,7 +116,7 @@ def notification_channel_descriptor_path(cls, project, channel_descriptor): def project_path(cls, project): """Return a fully-qualified project string.""" return google.api_core.path_template.expand( - "projects/{project}", project=project + "projects/{project}", project=project, ) def __init__( @@ -206,12 +206,12 @@ def __init__( self.transport = transport else: self.transport = notification_channel_service_grpc_transport.NotificationChannelServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials + address=api_endpoint, channel=channel, credentials=credentials, ) if client_info is None: client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION + gapic_version=_GAPIC_LIBRARY_VERSION, ) else: client_info.gapic_version = _GAPIC_LIBRARY_VERSION @@ -222,7 +222,7 @@ def __init__( # (Ordinarily, these are the defaults specified in the `*_config.py` # file next to this one.) self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] + client_config["interfaces"][self._INTERFACE_NAME], ) # Save a dictionary of cached API call functions. @@ -322,7 +322,7 @@ def list_notification_channel_descriptors( ) request = notification_service_pb2.ListNotificationChannelDescriptorsRequest( - name=name, page_size=page_size + name=name, page_size=page_size, ) if metadata is None: metadata = [] @@ -413,7 +413,7 @@ def get_notification_channel_descriptor( ) request = notification_service_pb2.GetNotificationChannelDescriptorRequest( - name=name + name=name, ) if metadata is None: metadata = [] @@ -527,7 +527,7 @@ def list_notification_channels( ) request = notification_service_pb2.ListNotificationChannelsRequest( - name=name, filter=filter_, order_by=order_by, page_size=page_size + name=name, filter=filter_, order_by=order_by, page_size=page_size, ) if metadata is None: metadata = [] @@ -616,7 +616,7 @@ def get_notification_channel( client_info=self._client_info, ) - request = notification_service_pb2.GetNotificationChannelRequest(name=name) + request = notification_service_pb2.GetNotificationChannelRequest(name=name,) if metadata is None: metadata = [] metadata = list(metadata) @@ -710,7 +710,7 @@ def create_notification_channel( ) request = notification_service_pb2.CreateNotificationChannelRequest( - name=name, notification_channel=notification_channel + name=name, notification_channel=notification_channel, ) if metadata is None: metadata = [] @@ -799,7 +799,7 @@ def update_notification_channel( ) request = notification_service_pb2.UpdateNotificationChannelRequest( - notification_channel=notification_channel, update_mask=update_mask + notification_channel=notification_channel, update_mask=update_mask, ) if metadata is None: metadata = [] @@ -878,7 +878,7 @@ def delete_notification_channel( ) request = notification_service_pb2.DeleteNotificationChannelRequest( - name=name, force=force + name=name, force=force, ) if metadata is None: metadata = [] @@ -954,7 +954,7 @@ def send_notification_channel_verification_code( ) request = notification_service_pb2.SendNotificationChannelVerificationCodeRequest( - name=name + name=name, ) if metadata is None: metadata = [] @@ -1067,7 +1067,7 @@ def get_notification_channel_verification_code( ) request = notification_service_pb2.GetNotificationChannelVerificationCodeRequest( - name=name, expire_time=expire_time + name=name, expire_time=expire_time, ) if metadata is None: metadata = [] @@ -1156,7 +1156,7 @@ def verify_notification_channel( ) request = notification_service_pb2.VerifyNotificationChannelRequest( - name=name, code=code + name=name, code=code, ) if metadata is None: metadata = [] diff --git a/monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client_config.py b/monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client_config.py index 1fa0139bf814..6d0e1e1d1103 100644 --- a/monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client_config.py +++ b/monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client_config.py @@ -18,52 +18,52 @@ }, "methods": { "ListNotificationChannelDescriptors": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "GetNotificationChannelDescriptor": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "ListNotificationChannels": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "GetNotificationChannel": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "CreateNotificationChannel": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, "UpdateNotificationChannel": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, "DeleteNotificationChannel": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "SendNotificationChannelVerificationCode": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, "GetNotificationChannelVerificationCode": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "VerifyNotificationChannel": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, diff --git a/monitoring/google/cloud/monitoring_v3/gapic/service_monitoring_service_client.py b/monitoring/google/cloud/monitoring_v3/gapic/service_monitoring_service_client.py new file mode 100644 index 000000000000..80b03c5ad1b6 --- /dev/null +++ b/monitoring/google/cloud/monitoring_v3/gapic/service_monitoring_service_client.py @@ -0,0 +1,1127 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Accesses the google.monitoring.v3 ServiceMonitoringService API.""" + +import functools +import pkg_resources +import warnings + +from google.oauth2 import service_account +import google.api_core.client_options +import google.api_core.gapic_v1.client_info +import google.api_core.gapic_v1.config +import google.api_core.gapic_v1.method +import google.api_core.gapic_v1.routing_header +import google.api_core.grpc_helpers +import google.api_core.page_iterator +import google.api_core.path_template +import grpc + +from google.api import metric_pb2 as api_metric_pb2 +from google.api import monitored_resource_pb2 +from google.cloud.monitoring_v3.gapic import enums +from google.cloud.monitoring_v3.gapic import service_monitoring_service_client_config +from google.cloud.monitoring_v3.gapic.transports import ( + service_monitoring_service_grpc_transport, +) +from google.cloud.monitoring_v3.proto import alert_pb2 +from google.cloud.monitoring_v3.proto import alert_service_pb2 +from google.cloud.monitoring_v3.proto import alert_service_pb2_grpc +from google.cloud.monitoring_v3.proto import common_pb2 +from google.cloud.monitoring_v3.proto import group_pb2 +from google.cloud.monitoring_v3.proto import group_service_pb2 +from google.cloud.monitoring_v3.proto import group_service_pb2_grpc +from google.cloud.monitoring_v3.proto import metric_pb2 as proto_metric_pb2 +from google.cloud.monitoring_v3.proto import metric_service_pb2 +from google.cloud.monitoring_v3.proto import metric_service_pb2_grpc +from google.cloud.monitoring_v3.proto import notification_pb2 +from google.cloud.monitoring_v3.proto import notification_service_pb2 +from google.cloud.monitoring_v3.proto import notification_service_pb2_grpc +from google.cloud.monitoring_v3.proto import service_pb2 +from google.cloud.monitoring_v3.proto import service_service_pb2 +from google.cloud.monitoring_v3.proto import service_service_pb2_grpc +from google.protobuf import empty_pb2 +from google.protobuf import field_mask_pb2 +from google.protobuf import timestamp_pb2 + + +_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( + "google-cloud-monitoring", +).version + + +class ServiceMonitoringServiceClient(object): + """ + The Stackdriver Monitoring Service-Oriented Monitoring API has endpoints + for managing and querying aspects of a workspace's services. These + include the ``Service``'s monitored resources, its Service-Level + Objectives, and a taxonomy of categorized Health Metrics. + """ + + SERVICE_ADDRESS = "monitoring.googleapis.com:443" + """The default address of the service.""" + + # The name of the interface for this client. This is the key used to + # find the method configuration in the client_config dictionary. + _INTERFACE_NAME = "google.monitoring.v3.ServiceMonitoringService" + + @classmethod + def from_service_account_file(cls, filename, *args, **kwargs): + """Creates an instance of this client using the provided credentials + file. + + Args: + filename (str): The path to the service account private key json + file. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + ServiceMonitoringServiceClient: The constructed client. + """ + credentials = service_account.Credentials.from_service_account_file(filename) + kwargs["credentials"] = credentials + return cls(*args, **kwargs) + + from_service_account_json = from_service_account_file + + @classmethod + def project_path(cls, project): + """Return a fully-qualified project string.""" + return google.api_core.path_template.expand( + "projects/{project}", project=project, + ) + + @classmethod + def service_path(cls, project, service): + """Return a fully-qualified service string.""" + return google.api_core.path_template.expand( + "projects/{project}/services/{service}", project=project, service=service, + ) + + @classmethod + def service_level_objective_path(cls, project, service, service_level_objective): + """Return a fully-qualified service_level_objective string.""" + return google.api_core.path_template.expand( + "projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}", + project=project, + service=service, + service_level_objective=service_level_objective, + ) + + def __init__( + self, + transport=None, + channel=None, + credentials=None, + client_config=None, + client_info=None, + client_options=None, + ): + """Constructor. + + Args: + transport (Union[~.ServiceMonitoringServiceGrpcTransport, + Callable[[~.Credentials, type], ~.ServiceMonitoringServiceGrpcTransport]): A transport + instance, responsible for actually making the API calls. + The default transport uses the gRPC protocol. + This argument may also be a callable which returns a + transport instance. Callables will be sent the credentials + as the first argument and the default transport class as + the second argument. + channel (grpc.Channel): DEPRECATED. A ``Channel`` instance + through which to make calls. This argument is mutually exclusive + with ``credentials``; providing both will raise an exception. + credentials (google.auth.credentials.Credentials): The + authorization credentials to attach to requests. These + credentials identify this application to the service. If none + are specified, the client will attempt to ascertain the + credentials from the environment. + This argument is mutually exclusive with providing a + transport instance to ``transport``; doing so will raise + an exception. + client_config (dict): DEPRECATED. A dictionary of call options for + each method. If not specified, the default configuration is used. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing + your own client library. + client_options (Union[dict, google.api_core.client_options.ClientOptions]): + Client options used to set user options on the client. API Endpoint + should be set through client_options. + """ + # Raise deprecation warnings for things we want to go away. + if client_config is not None: + warnings.warn( + "The `client_config` argument is deprecated.", + PendingDeprecationWarning, + stacklevel=2, + ) + else: + client_config = service_monitoring_service_client_config.config + + if channel: + warnings.warn( + "The `channel` argument is deprecated; use " "`transport` instead.", + PendingDeprecationWarning, + stacklevel=2, + ) + + api_endpoint = self.SERVICE_ADDRESS + if client_options: + if type(client_options) == dict: + client_options = google.api_core.client_options.from_dict( + client_options + ) + if client_options.api_endpoint: + api_endpoint = client_options.api_endpoint + + # Instantiate the transport. + # The transport is responsible for handling serialization and + # deserialization and actually sending data to the service. + if transport: + if callable(transport): + self.transport = transport( + credentials=credentials, + default_class=service_monitoring_service_grpc_transport.ServiceMonitoringServiceGrpcTransport, + address=api_endpoint, + ) + else: + if credentials: + raise ValueError( + "Received both a transport instance and " + "credentials; these are mutually exclusive." + ) + self.transport = transport + else: + self.transport = service_monitoring_service_grpc_transport.ServiceMonitoringServiceGrpcTransport( + address=api_endpoint, channel=channel, credentials=credentials, + ) + + if client_info is None: + client_info = google.api_core.gapic_v1.client_info.ClientInfo( + gapic_version=_GAPIC_LIBRARY_VERSION, + ) + else: + client_info.gapic_version = _GAPIC_LIBRARY_VERSION + self._client_info = client_info + + # Parse out the default settings for retry and timeout for each RPC + # from the client configuration. + # (Ordinarily, these are the defaults specified in the `*_config.py` + # file next to this one.) + self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( + client_config["interfaces"][self._INTERFACE_NAME], + ) + + # Save a dictionary of cached API call functions. + # These are the actual callables which invoke the proper + # transport methods, wrapped with `wrap_method` to add retry, + # timeout, and the like. + self._inner_api_calls = {} + + # Service calls + def create_service( + self, + parent, + service, + service_id=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Create a ``Service``. + + Example: + >>> from google.cloud import monitoring_v3 + >>> + >>> client = monitoring_v3.ServiceMonitoringServiceClient() + >>> + >>> parent = client.project_path('[PROJECT]') + >>> + >>> # TODO: Initialize `service`: + >>> service = {} + >>> + >>> response = client.create_service(parent, service) + + Args: + parent (str): Resource name of the parent workspace. Of the form + ``projects/{project_id}``. + service (Union[dict, ~google.cloud.monitoring_v3.types.Service]): The ``Service`` to create. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.monitoring_v3.types.Service` + service_id (str): Optional. The Service id to use for this Service. If omitted, an id will + be generated instead. Must match the pattern [a-z0-9-]+ + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.monitoring_v3.types.Service` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + # Wrap the transport method to add retry and timeout logic. + if "create_service" not in self._inner_api_calls: + self._inner_api_calls[ + "create_service" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.create_service, + default_retry=self._method_configs["CreateService"].retry, + default_timeout=self._method_configs["CreateService"].timeout, + client_info=self._client_info, + ) + + request = service_service_pb2.CreateServiceRequest( + parent=parent, service=service, service_id=service_id, + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["create_service"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def get_service( + self, + name, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Get the named ``Service``. + + Example: + >>> from google.cloud import monitoring_v3 + >>> + >>> client = monitoring_v3.ServiceMonitoringServiceClient() + >>> + >>> name = client.service_path('[PROJECT]', '[SERVICE]') + >>> + >>> response = client.get_service(name) + + Args: + name (str): Resource name of the ``Service``. Of the form + ``projects/{project_id}/services/{service_id}``. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.monitoring_v3.types.Service` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + # Wrap the transport method to add retry and timeout logic. + if "get_service" not in self._inner_api_calls: + self._inner_api_calls[ + "get_service" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.get_service, + default_retry=self._method_configs["GetService"].retry, + default_timeout=self._method_configs["GetService"].timeout, + client_info=self._client_info, + ) + + request = service_service_pb2.GetServiceRequest(name=name,) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["get_service"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def list_services( + self, + parent, + filter_=None, + page_size=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + List ``Service``\ s for this workspace. + + Example: + >>> from google.cloud import monitoring_v3 + >>> + >>> client = monitoring_v3.ServiceMonitoringServiceClient() + >>> + >>> parent = client.project_path('[PROJECT]') + >>> + >>> # Iterate over all results + >>> for element in client.list_services(parent): + ... # process element + ... pass + >>> + >>> + >>> # Alternatively: + >>> + >>> # Iterate over results one page at a time + >>> for page in client.list_services(parent).pages: + ... for element in page: + ... # process element + ... pass + + Args: + parent (str): Resource name of the parent ``Workspace``. Of the form + ``projects/{project_id}``. + filter_ (str): A filter specifying what ``Service``\ s to return. The filter currently + supports the following fields: + + :: + + - `identifier_case` + - `app_engine.module_id` + - `cloud_endpoints.service` + - `cluster_istio.location` + - `cluster_istio.cluster_name` + - `cluster_istio.service_namespace` + - `cluster_istio.service_name` + + ``identifier_case`` refers to which option in the identifier oneof is + populated. For example, the filter ``identifier_case = "CUSTOM"`` would + match all services with a value for the ``custom`` field. Valid options + are "CUSTOM", "APP\_ENGINE", "CLOUD\_ENDPOINTS", and "CLUSTER\_ISTIO". + page_size (int): The maximum number of resources contained in the + underlying API response. If page streaming is performed per- + resource, this parameter does not affect the return value. If page + streaming is performed per-page, this determines the maximum number + of resources in a page. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.api_core.page_iterator.PageIterator` instance. + An iterable of :class:`~google.cloud.monitoring_v3.types.Service` instances. + You can also iterate over the pages of the response + using its `pages` property. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + # Wrap the transport method to add retry and timeout logic. + if "list_services" not in self._inner_api_calls: + self._inner_api_calls[ + "list_services" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.list_services, + default_retry=self._method_configs["ListServices"].retry, + default_timeout=self._method_configs["ListServices"].timeout, + client_info=self._client_info, + ) + + request = service_service_pb2.ListServicesRequest( + parent=parent, filter=filter_, page_size=page_size, + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + iterator = google.api_core.page_iterator.GRPCIterator( + client=None, + method=functools.partial( + self._inner_api_calls["list_services"], + retry=retry, + timeout=timeout, + metadata=metadata, + ), + request=request, + items_field="services", + request_token_field="page_token", + response_token_field="next_page_token", + ) + return iterator + + def update_service( + self, + service, + update_mask=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Update this ``Service``. + + Example: + >>> from google.cloud import monitoring_v3 + >>> + >>> client = monitoring_v3.ServiceMonitoringServiceClient() + >>> + >>> # TODO: Initialize `service`: + >>> service = {} + >>> + >>> response = client.update_service(service) + + Args: + service (Union[dict, ~google.cloud.monitoring_v3.types.Service]): The ``Service`` to draw updates from. The given ``name`` specifies the + resource to update. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.monitoring_v3.types.Service` + update_mask (Union[dict, ~google.cloud.monitoring_v3.types.FieldMask]): A set of field paths defining which fields to use for the update. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.monitoring_v3.types.FieldMask` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.monitoring_v3.types.Service` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + # Wrap the transport method to add retry and timeout logic. + if "update_service" not in self._inner_api_calls: + self._inner_api_calls[ + "update_service" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.update_service, + default_retry=self._method_configs["UpdateService"].retry, + default_timeout=self._method_configs["UpdateService"].timeout, + client_info=self._client_info, + ) + + request = service_service_pb2.UpdateServiceRequest( + service=service, update_mask=update_mask, + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("service.name", service.name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["update_service"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def delete_service( + self, + name, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Soft delete this ``Service``. + + Example: + >>> from google.cloud import monitoring_v3 + >>> + >>> client = monitoring_v3.ServiceMonitoringServiceClient() + >>> + >>> name = client.service_path('[PROJECT]', '[SERVICE]') + >>> + >>> client.delete_service(name) + + Args: + name (str): Resource name of the ``Service`` to delete. Of the form + ``projects/{project_id}/service/{service_id}``. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + # Wrap the transport method to add retry and timeout logic. + if "delete_service" not in self._inner_api_calls: + self._inner_api_calls[ + "delete_service" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.delete_service, + default_retry=self._method_configs["DeleteService"].retry, + default_timeout=self._method_configs["DeleteService"].timeout, + client_info=self._client_info, + ) + + request = service_service_pb2.DeleteServiceRequest(name=name,) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + self._inner_api_calls["delete_service"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def create_service_level_objective( + self, + parent, + service_level_objective, + service_level_objective_id=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Create a ``ServiceLevelObjective`` for the given ``Service``. + + Example: + >>> from google.cloud import monitoring_v3 + >>> + >>> client = monitoring_v3.ServiceMonitoringServiceClient() + >>> + >>> parent = client.service_path('[PROJECT]', '[SERVICE]') + >>> + >>> # TODO: Initialize `service_level_objective`: + >>> service_level_objective = {} + >>> + >>> response = client.create_service_level_objective(parent, service_level_objective) + + Args: + parent (str): Resource name of the parent ``Service``. Of the form + ``projects/{project_id}/services/{service_id}``. + service_level_objective (Union[dict, ~google.cloud.monitoring_v3.types.ServiceLevelObjective]): The ``ServiceLevelObjective`` to create. The provided ``name`` will be + respected if no ``ServiceLevelObjective`` exists with this name. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.monitoring_v3.types.ServiceLevelObjective` + service_level_objective_id (str): Optional. The ServiceLevelObjective id to use for this + ServiceLevelObjective. If omitted, an id will be generated instead. Must + match the pattern [a-z0-9-]+ + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.monitoring_v3.types.ServiceLevelObjective` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + # Wrap the transport method to add retry and timeout logic. + if "create_service_level_objective" not in self._inner_api_calls: + self._inner_api_calls[ + "create_service_level_objective" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.create_service_level_objective, + default_retry=self._method_configs["CreateServiceLevelObjective"].retry, + default_timeout=self._method_configs[ + "CreateServiceLevelObjective" + ].timeout, + client_info=self._client_info, + ) + + request = service_service_pb2.CreateServiceLevelObjectiveRequest( + parent=parent, + service_level_objective=service_level_objective, + service_level_objective_id=service_level_objective_id, + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["create_service_level_objective"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def get_service_level_objective( + self, + name, + view=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Get a ``ServiceLevelObjective`` by name. + + Example: + >>> from google.cloud import monitoring_v3 + >>> + >>> client = monitoring_v3.ServiceMonitoringServiceClient() + >>> + >>> name = client.service_level_objective_path('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]') + >>> + >>> response = client.get_service_level_objective(name) + + Args: + name (str): Resource name of the ``ServiceLevelObjective`` to get. Of the form + ``projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}``. + view (~google.cloud.monitoring_v3.types.View): View of the ``ServiceLevelObjective`` to return. If ``DEFAULT``, return + the ``ServiceLevelObjective`` as originally defined. If ``EXPLICIT`` and + the ``ServiceLevelObjective`` is defined in terms of a ``BasicSli``, + replace the ``BasicSli`` with a ``RequestBasedSli`` spelling out how the + SLI is computed. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.monitoring_v3.types.ServiceLevelObjective` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + # Wrap the transport method to add retry and timeout logic. + if "get_service_level_objective" not in self._inner_api_calls: + self._inner_api_calls[ + "get_service_level_objective" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.get_service_level_objective, + default_retry=self._method_configs["GetServiceLevelObjective"].retry, + default_timeout=self._method_configs[ + "GetServiceLevelObjective" + ].timeout, + client_info=self._client_info, + ) + + request = service_service_pb2.GetServiceLevelObjectiveRequest( + name=name, view=view, + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["get_service_level_objective"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def list_service_level_objectives( + self, + parent, + filter_=None, + page_size=None, + view=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + List the ``ServiceLevelObjective``\ s for the given ``Service``. + + Example: + >>> from google.cloud import monitoring_v3 + >>> + >>> client = monitoring_v3.ServiceMonitoringServiceClient() + >>> + >>> parent = client.service_path('[PROJECT]', '[SERVICE]') + >>> + >>> # Iterate over all results + >>> for element in client.list_service_level_objectives(parent): + ... # process element + ... pass + >>> + >>> + >>> # Alternatively: + >>> + >>> # Iterate over results one page at a time + >>> for page in client.list_service_level_objectives(parent).pages: + ... for element in page: + ... # process element + ... pass + + Args: + parent (str): Resource name of the parent ``Service``. Of the form + ``projects/{project_id}/services/{service_id}``. + filter_ (str): A filter specifying what ``ServiceLevelObjective``\ s to return. + page_size (int): The maximum number of resources contained in the + underlying API response. If page streaming is performed per- + resource, this parameter does not affect the return value. If page + streaming is performed per-page, this determines the maximum number + of resources in a page. + view (~google.cloud.monitoring_v3.types.View): View of the ``ServiceLevelObjective``\ s to return. If ``DEFAULT``, + return each ``ServiceLevelObjective`` as originally defined. If + ``EXPLICIT`` and the ``ServiceLevelObjective`` is defined in terms of a + ``BasicSli``, replace the ``BasicSli`` with a ``RequestBasedSli`` + spelling out how the SLI is computed. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.api_core.page_iterator.PageIterator` instance. + An iterable of :class:`~google.cloud.monitoring_v3.types.ServiceLevelObjective` instances. + You can also iterate over the pages of the response + using its `pages` property. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + # Wrap the transport method to add retry and timeout logic. + if "list_service_level_objectives" not in self._inner_api_calls: + self._inner_api_calls[ + "list_service_level_objectives" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.list_service_level_objectives, + default_retry=self._method_configs["ListServiceLevelObjectives"].retry, + default_timeout=self._method_configs[ + "ListServiceLevelObjectives" + ].timeout, + client_info=self._client_info, + ) + + request = service_service_pb2.ListServiceLevelObjectivesRequest( + parent=parent, filter=filter_, page_size=page_size, view=view, + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + iterator = google.api_core.page_iterator.GRPCIterator( + client=None, + method=functools.partial( + self._inner_api_calls["list_service_level_objectives"], + retry=retry, + timeout=timeout, + metadata=metadata, + ), + request=request, + items_field="service_level_objectives", + request_token_field="page_token", + response_token_field="next_page_token", + ) + return iterator + + def update_service_level_objective( + self, + service_level_objective, + update_mask=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Update the given ``ServiceLevelObjective``. + + Example: + >>> from google.cloud import monitoring_v3 + >>> + >>> client = monitoring_v3.ServiceMonitoringServiceClient() + >>> + >>> # TODO: Initialize `service_level_objective`: + >>> service_level_objective = {} + >>> + >>> response = client.update_service_level_objective(service_level_objective) + + Args: + service_level_objective (Union[dict, ~google.cloud.monitoring_v3.types.ServiceLevelObjective]): The ``ServiceLevelObjective`` to draw updates from. The given ``name`` + specifies the resource to update. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.monitoring_v3.types.ServiceLevelObjective` + update_mask (Union[dict, ~google.cloud.monitoring_v3.types.FieldMask]): A set of field paths defining which fields to use for the update. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.monitoring_v3.types.FieldMask` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.monitoring_v3.types.ServiceLevelObjective` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + # Wrap the transport method to add retry and timeout logic. + if "update_service_level_objective" not in self._inner_api_calls: + self._inner_api_calls[ + "update_service_level_objective" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.update_service_level_objective, + default_retry=self._method_configs["UpdateServiceLevelObjective"].retry, + default_timeout=self._method_configs[ + "UpdateServiceLevelObjective" + ].timeout, + client_info=self._client_info, + ) + + request = service_service_pb2.UpdateServiceLevelObjectiveRequest( + service_level_objective=service_level_objective, update_mask=update_mask, + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [ + ("service_level_objective.name", service_level_objective.name) + ] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["update_service_level_objective"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def delete_service_level_objective( + self, + name, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Delete the given ``ServiceLevelObjective``. + + Example: + >>> from google.cloud import monitoring_v3 + >>> + >>> client = monitoring_v3.ServiceMonitoringServiceClient() + >>> + >>> name = client.service_level_objective_path('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]') + >>> + >>> client.delete_service_level_objective(name) + + Args: + name (str): Resource name of the ``ServiceLevelObjective`` to delete. Of the form + ``projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}``. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + # Wrap the transport method to add retry and timeout logic. + if "delete_service_level_objective" not in self._inner_api_calls: + self._inner_api_calls[ + "delete_service_level_objective" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.delete_service_level_objective, + default_retry=self._method_configs["DeleteServiceLevelObjective"].retry, + default_timeout=self._method_configs[ + "DeleteServiceLevelObjective" + ].timeout, + client_info=self._client_info, + ) + + request = service_service_pb2.DeleteServiceLevelObjectiveRequest(name=name,) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + self._inner_api_calls["delete_service_level_objective"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) diff --git a/monitoring/google/cloud/monitoring_v3/gapic/service_monitoring_service_client_config.py b/monitoring/google/cloud/monitoring_v3/gapic/service_monitoring_service_client_config.py new file mode 100644 index 000000000000..575c0f88aef6 --- /dev/null +++ b/monitoring/google/cloud/monitoring_v3/gapic/service_monitoring_service_client_config.py @@ -0,0 +1,73 @@ +config = { + "interfaces": { + "google.monitoring.v3.ServiceMonitoringService": { + "retry_codes": { + "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], + "non_idempotent": [], + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000, + } + }, + "methods": { + "CreateService": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "GetService": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "ListServices": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "UpdateService": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "DeleteService": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "CreateServiceLevelObjective": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "GetServiceLevelObjective": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "ListServiceLevelObjectives": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "UpdateServiceLevelObjective": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "DeleteServiceLevelObjective": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + }, + } + } +} diff --git a/monitoring/google/cloud/monitoring_v3/gapic/transports/alert_policy_service_grpc_transport.py b/monitoring/google/cloud/monitoring_v3/gapic/transports/alert_policy_service_grpc_transport.py index 9279df68f995..c0b5a2e51fb6 100644 --- a/monitoring/google/cloud/monitoring_v3/gapic/transports/alert_policy_service_grpc_transport.py +++ b/monitoring/google/cloud/monitoring_v3/gapic/transports/alert_policy_service_grpc_transport.py @@ -58,7 +58,7 @@ def __init__( # exception (channels come with credentials baked in already). if channel is not None and credentials is not None: raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." + "The `channel` and `credentials` arguments are mutually " "exclusive.", ) # Create the channel. @@ -79,7 +79,7 @@ def __init__( self._stubs = { "alert_policy_service_stub": alert_service_pb2_grpc.AlertPolicyServiceStub( channel - ) + ), } @classmethod diff --git a/monitoring/google/cloud/monitoring_v3/gapic/transports/group_service_grpc_transport.py b/monitoring/google/cloud/monitoring_v3/gapic/transports/group_service_grpc_transport.py index 79c565b626b1..dd6971c0ddcb 100644 --- a/monitoring/google/cloud/monitoring_v3/gapic/transports/group_service_grpc_transport.py +++ b/monitoring/google/cloud/monitoring_v3/gapic/transports/group_service_grpc_transport.py @@ -58,7 +58,7 @@ def __init__( # exception (channels come with credentials baked in already). if channel is not None and credentials is not None: raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." + "The `channel` and `credentials` arguments are mutually " "exclusive.", ) # Create the channel. @@ -77,7 +77,7 @@ def __init__( # gRPC uses objects called "stubs" that are bound to the # channel and provide a basic method for each RPC. self._stubs = { - "group_service_stub": group_service_pb2_grpc.GroupServiceStub(channel) + "group_service_stub": group_service_pb2_grpc.GroupServiceStub(channel), } @classmethod diff --git a/monitoring/google/cloud/monitoring_v3/gapic/transports/metric_service_grpc_transport.py b/monitoring/google/cloud/monitoring_v3/gapic/transports/metric_service_grpc_transport.py index ed45cd5e94ed..d1cb8d5d520d 100644 --- a/monitoring/google/cloud/monitoring_v3/gapic/transports/metric_service_grpc_transport.py +++ b/monitoring/google/cloud/monitoring_v3/gapic/transports/metric_service_grpc_transport.py @@ -58,7 +58,7 @@ def __init__( # exception (channels come with credentials baked in already). if channel is not None and credentials is not None: raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." + "The `channel` and `credentials` arguments are mutually " "exclusive.", ) # Create the channel. @@ -77,7 +77,7 @@ def __init__( # gRPC uses objects called "stubs" that are bound to the # channel and provide a basic method for each RPC. self._stubs = { - "metric_service_stub": metric_service_pb2_grpc.MetricServiceStub(channel) + "metric_service_stub": metric_service_pb2_grpc.MetricServiceStub(channel), } @classmethod diff --git a/monitoring/google/cloud/monitoring_v3/gapic/transports/notification_channel_service_grpc_transport.py b/monitoring/google/cloud/monitoring_v3/gapic/transports/notification_channel_service_grpc_transport.py index 30d1699a0fec..e967e20e534b 100644 --- a/monitoring/google/cloud/monitoring_v3/gapic/transports/notification_channel_service_grpc_transport.py +++ b/monitoring/google/cloud/monitoring_v3/gapic/transports/notification_channel_service_grpc_transport.py @@ -58,7 +58,7 @@ def __init__( # exception (channels come with credentials baked in already). if channel is not None and credentials is not None: raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." + "The `channel` and `credentials` arguments are mutually " "exclusive.", ) # Create the channel. @@ -79,7 +79,7 @@ def __init__( self._stubs = { "notification_channel_service_stub": notification_service_pb2_grpc.NotificationChannelServiceStub( channel - ) + ), } @classmethod diff --git a/monitoring/google/cloud/monitoring_v3/gapic/transports/service_monitoring_service_grpc_transport.py b/monitoring/google/cloud/monitoring_v3/gapic/transports/service_monitoring_service_grpc_transport.py new file mode 100644 index 000000000000..2602a33e41ba --- /dev/null +++ b/monitoring/google/cloud/monitoring_v3/gapic/transports/service_monitoring_service_grpc_transport.py @@ -0,0 +1,251 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import google.api_core.grpc_helpers + +from google.cloud.monitoring_v3.proto import service_service_pb2_grpc + + +class ServiceMonitoringServiceGrpcTransport(object): + """gRPC transport class providing stubs for + google.monitoring.v3 ServiceMonitoringService API. + + The transport provides access to the raw gRPC stubs, + which can be used to take advantage of advanced + features of gRPC. + """ + + # The scopes needed to make gRPC calls to all of the methods defined + # in this service. + _OAUTH_SCOPES = ( + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring", + "https://www.googleapis.com/auth/monitoring.read", + "https://www.googleapis.com/auth/monitoring.write", + ) + + def __init__( + self, channel=None, credentials=None, address="monitoring.googleapis.com:443" + ): + """Instantiate the transport class. + + Args: + channel (grpc.Channel): A ``Channel`` instance through + which to make calls. This argument is mutually exclusive + with ``credentials``; providing both will raise an exception. + credentials (google.auth.credentials.Credentials): The + authorization credentials to attach to requests. These + credentials identify this application to the service. If none + are specified, the client will attempt to ascertain the + credentials from the environment. + address (str): The address where the service is hosted. + """ + # If both `channel` and `credentials` are specified, raise an + # exception (channels come with credentials baked in already). + if channel is not None and credentials is not None: + raise ValueError( + "The `channel` and `credentials` arguments are mutually " "exclusive.", + ) + + # Create the channel. + if channel is None: + channel = self.create_channel( + address=address, + credentials=credentials, + options={ + "grpc.max_send_message_length": -1, + "grpc.max_receive_message_length": -1, + }.items(), + ) + + self._channel = channel + + # gRPC uses objects called "stubs" that are bound to the + # channel and provide a basic method for each RPC. + self._stubs = { + "service_monitoring_service_stub": service_service_pb2_grpc.ServiceMonitoringServiceStub( + channel + ), + } + + @classmethod + def create_channel( + cls, address="monitoring.googleapis.com:443", credentials=None, **kwargs + ): + """Create and return a gRPC channel object. + + Args: + address (str): The host for the channel to use. + credentials (~.Credentials): The + authorization credentials to attach to requests. These + credentials identify this application to the service. If + none are specified, the client will attempt to ascertain + the credentials from the environment. + kwargs (dict): Keyword arguments, which are passed to the + channel creation. + + Returns: + grpc.Channel: A gRPC channel object. + """ + return google.api_core.grpc_helpers.create_channel( + address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs + ) + + @property + def channel(self): + """The gRPC channel used by the transport. + + Returns: + grpc.Channel: A gRPC channel object. + """ + return self._channel + + @property + def create_service(self): + """Return the gRPC stub for :meth:`ServiceMonitoringServiceClient.create_service`. + + Create a ``Service``. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["service_monitoring_service_stub"].CreateService + + @property + def get_service(self): + """Return the gRPC stub for :meth:`ServiceMonitoringServiceClient.get_service`. + + Get the named ``Service``. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["service_monitoring_service_stub"].GetService + + @property + def list_services(self): + """Return the gRPC stub for :meth:`ServiceMonitoringServiceClient.list_services`. + + List ``Service``\ s for this workspace. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["service_monitoring_service_stub"].ListServices + + @property + def update_service(self): + """Return the gRPC stub for :meth:`ServiceMonitoringServiceClient.update_service`. + + Update this ``Service``. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["service_monitoring_service_stub"].UpdateService + + @property + def delete_service(self): + """Return the gRPC stub for :meth:`ServiceMonitoringServiceClient.delete_service`. + + Soft delete this ``Service``. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["service_monitoring_service_stub"].DeleteService + + @property + def create_service_level_objective(self): + """Return the gRPC stub for :meth:`ServiceMonitoringServiceClient.create_service_level_objective`. + + Create a ``ServiceLevelObjective`` for the given ``Service``. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs[ + "service_monitoring_service_stub" + ].CreateServiceLevelObjective + + @property + def get_service_level_objective(self): + """Return the gRPC stub for :meth:`ServiceMonitoringServiceClient.get_service_level_objective`. + + Get a ``ServiceLevelObjective`` by name. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["service_monitoring_service_stub"].GetServiceLevelObjective + + @property + def list_service_level_objectives(self): + """Return the gRPC stub for :meth:`ServiceMonitoringServiceClient.list_service_level_objectives`. + + List the ``ServiceLevelObjective``\ s for the given ``Service``. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["service_monitoring_service_stub"].ListServiceLevelObjectives + + @property + def update_service_level_objective(self): + """Return the gRPC stub for :meth:`ServiceMonitoringServiceClient.update_service_level_objective`. + + Update the given ``ServiceLevelObjective``. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs[ + "service_monitoring_service_stub" + ].UpdateServiceLevelObjective + + @property + def delete_service_level_objective(self): + """Return the gRPC stub for :meth:`ServiceMonitoringServiceClient.delete_service_level_objective`. + + Delete the given ``ServiceLevelObjective``. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs[ + "service_monitoring_service_stub" + ].DeleteServiceLevelObjective diff --git a/monitoring/google/cloud/monitoring_v3/gapic/transports/uptime_check_service_grpc_transport.py b/monitoring/google/cloud/monitoring_v3/gapic/transports/uptime_check_service_grpc_transport.py index 8f06d5d75801..cc1c127847b3 100644 --- a/monitoring/google/cloud/monitoring_v3/gapic/transports/uptime_check_service_grpc_transport.py +++ b/monitoring/google/cloud/monitoring_v3/gapic/transports/uptime_check_service_grpc_transport.py @@ -58,7 +58,7 @@ def __init__( # exception (channels come with credentials baked in already). if channel is not None and credentials is not None: raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." + "The `channel` and `credentials` arguments are mutually " "exclusive.", ) # Create the channel. @@ -79,7 +79,7 @@ def __init__( self._stubs = { "uptime_check_service_stub": uptime_service_pb2_grpc.UptimeCheckServiceStub( channel - ) + ), } @classmethod diff --git a/monitoring/google/cloud/monitoring_v3/gapic/uptime_check_service_client.py b/monitoring/google/cloud/monitoring_v3/gapic/uptime_check_service_client.py index c23aa26d151b..337f83c3e6f4 100644 --- a/monitoring/google/cloud/monitoring_v3/gapic/uptime_check_service_client.py +++ b/monitoring/google/cloud/monitoring_v3/gapic/uptime_check_service_client.py @@ -51,6 +51,9 @@ from google.cloud.monitoring_v3.proto import notification_pb2 from google.cloud.monitoring_v3.proto import notification_service_pb2 from google.cloud.monitoring_v3.proto import notification_service_pb2_grpc +from google.cloud.monitoring_v3.proto import service_pb2 +from google.cloud.monitoring_v3.proto import service_service_pb2 +from google.cloud.monitoring_v3.proto import service_service_pb2_grpc from google.cloud.monitoring_v3.proto import uptime_pb2 from google.cloud.monitoring_v3.proto import uptime_service_pb2 from google.cloud.monitoring_v3.proto import uptime_service_pb2_grpc @@ -60,7 +63,7 @@ _GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-monitoring" + "google-cloud-monitoring", ).version @@ -107,7 +110,7 @@ def from_service_account_file(cls, filename, *args, **kwargs): def project_path(cls, project): """Return a fully-qualified project string.""" return google.api_core.path_template.expand( - "projects/{project}", project=project + "projects/{project}", project=project, ) @classmethod @@ -206,12 +209,12 @@ def __init__( self.transport = transport else: self.transport = uptime_check_service_grpc_transport.UptimeCheckServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials + address=api_endpoint, channel=channel, credentials=credentials, ) if client_info is None: client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION + gapic_version=_GAPIC_LIBRARY_VERSION, ) else: client_info.gapic_version = _GAPIC_LIBRARY_VERSION @@ -222,7 +225,7 @@ def __init__( # (Ordinarily, these are the defaults specified in the `*_config.py` # file next to this one.) self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] + client_config["interfaces"][self._INTERFACE_NAME], ) # Save a dictionary of cached API call functions. @@ -310,7 +313,7 @@ def list_uptime_check_configs( ) request = uptime_service_pb2.ListUptimeCheckConfigsRequest( - parent=parent, page_size=page_size + parent=parent, page_size=page_size, ) if metadata is None: metadata = [] @@ -395,7 +398,7 @@ def get_uptime_check_config( client_info=self._client_info, ) - request = uptime_service_pb2.GetUptimeCheckConfigRequest(name=name) + request = uptime_service_pb2.GetUptimeCheckConfigRequest(name=name,) if metadata is None: metadata = [] metadata = list(metadata) @@ -477,7 +480,7 @@ def create_uptime_check_config( ) request = uptime_service_pb2.CreateUptimeCheckConfigRequest( - parent=parent, uptime_check_config=uptime_check_config + parent=parent, uptime_check_config=uptime_check_config, ) if metadata is None: metadata = [] @@ -576,7 +579,7 @@ def update_uptime_check_config( ) request = uptime_service_pb2.UpdateUptimeCheckConfigRequest( - uptime_check_config=uptime_check_config, update_mask=update_mask + uptime_check_config=uptime_check_config, update_mask=update_mask, ) if metadata is None: metadata = [] @@ -649,7 +652,7 @@ def delete_uptime_check_config( client_info=self._client_info, ) - request = uptime_service_pb2.DeleteUptimeCheckConfigRequest(name=name) + request = uptime_service_pb2.DeleteUptimeCheckConfigRequest(name=name,) if metadata is None: metadata = [] metadata = list(metadata) @@ -738,7 +741,7 @@ def list_uptime_check_ips( client_info=self._client_info, ) - request = uptime_service_pb2.ListUptimeCheckIpsRequest(page_size=page_size) + request = uptime_service_pb2.ListUptimeCheckIpsRequest(page_size=page_size,) iterator = google.api_core.page_iterator.GRPCIterator( client=None, method=functools.partial( diff --git a/monitoring/google/cloud/monitoring_v3/proto/alert.proto b/monitoring/google/cloud/monitoring_v3/proto/alert.proto index 0f61bddf1596..a4ea225d5772 100644 --- a/monitoring/google/cloud/monitoring_v3/proto/alert.proto +++ b/monitoring/google/cloud/monitoring_v3/proto/alert.proto @@ -76,7 +76,7 @@ message AlertPolicy { // identifies which time series should be compared with the threshold. // // The filter is similar to the one that is specified in the - // [`MetricService.ListTimeSeries` + // [`ListTimeSeries` // request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) (that // call is useful to verify the time series that will be retrieved / // processed) and must specify the metric type and optionally may contain @@ -91,8 +91,7 @@ message AlertPolicy { // members of a group of resrouces). Multiple aggregations // are applied in the order specified. // - // This field is similar to the one in the - // [`MetricService.ListTimeSeries` + // This field is similar to the one in the [`ListTimeSeries` // request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It // is advisable to use the `ListTimeSeries` method when debugging this // field. @@ -163,7 +162,7 @@ message AlertPolicy { // identifies which time series should be compared with the threshold. // // The filter is similar to the one that is specified in the - // [`MetricService.ListTimeSeries` + // [`ListTimeSeries` // request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) (that // call is useful to verify the time series that will be retrieved / // processed) and must specify the metric type and optionally may contain @@ -178,8 +177,7 @@ message AlertPolicy { // members of a group of resrouces). Multiple aggregations // are applied in the order specified. // - // This field is similar to the - // one in the [`MetricService.ListTimeSeries` + // This field is similar to the one in the [`ListTimeSeries` // request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It // is advisable to use the `ListTimeSeries` method when debugging this // field. diff --git a/monitoring/google/cloud/monitoring_v3/proto/alert_pb2.py b/monitoring/google/cloud/monitoring_v3/proto/alert_pb2.py index e8043a5461bf..a3344e9c8845 100644 --- a/monitoring/google/cloud/monitoring_v3/proto/alert_pb2.py +++ b/monitoring/google/cloud/monitoring_v3/proto/alert_pb2.py @@ -195,7 +195,7 @@ index=0, containing_type=None, fields=[], - ) + ), ], serialized_start=1120, serialized_end=1173, @@ -555,7 +555,7 @@ index=0, containing_type=None, fields=[], - ) + ), ], serialized_start=892, serialized_end=1780, @@ -829,7 +829,7 @@ _ALERTPOLICY_CONDITION, _ALERTPOLICY_USERLABELSENTRY, ], - enum_types=[_ALERTPOLICY_CONDITIONCOMBINERTYPE], + enum_types=[_ALERTPOLICY_CONDITIONCOMBINERTYPE,], serialized_options=None, is_extendable=False, syntax="proto3", @@ -1002,7 +1002,7 @@ A `filter `__ that identifies which time series should be compared with the threshold. The filter is similar to the one that is specified in the - ```MetricService.ListTimeSeries`` request + ```ListTimeSeries`` request `__ (that call is useful to verify the time series that will be retrieved / processed) and must specify the metric type and @@ -1017,7 +1017,7 @@ aggregating streams across all members of a group of resrouces). Multiple aggregations are applied in the order specified. This field is similar to the one in the - ```MetricService.ListTimeSeries`` request + ```ListTimeSeries`` request `__. It is advisable to use the ``ListTimeSeries`` method when debugging this field. @@ -1092,7 +1092,7 @@ A `filter `__ that identifies which time series should be compared with the threshold. The filter is similar to the one that is specified in the - ```MetricService.ListTimeSeries`` request + ```ListTimeSeries`` request `__ (that call is useful to verify the time series that will be retrieved / processed) and must specify the metric type and @@ -1107,7 +1107,7 @@ aggregating streams across all members of a group of resrouces). Multiple aggregations are applied in the order specified. This field is similar to the one in the - ```MetricService.ListTimeSeries`` request + ```ListTimeSeries`` request `__. It is advisable to use the ``ListTimeSeries`` method when debugging this field. diff --git a/monitoring/google/cloud/monitoring_v3/proto/alert_service_pb2.py b/monitoring/google/cloud/monitoring_v3/proto/alert_service_pb2.py index 5f9be50453dd..f58e305427ba 100644 --- a/monitoring/google/cloud/monitoring_v3/proto/alert_service_pb2.py +++ b/monitoring/google/cloud/monitoring_v3/proto/alert_service_pb2.py @@ -125,7 +125,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + ), ], extensions=[], nested_types=[], @@ -389,7 +389,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + ), ], extensions=[], nested_types=[], diff --git a/monitoring/google/cloud/monitoring_v3/proto/common_pb2.py b/monitoring/google/cloud/monitoring_v3/proto/common_pb2.py index 4493d65ac63a..1797ca0d081a 100644 --- a/monitoring/google/cloud/monitoring_v3/proto/common_pb2.py +++ b/monitoring/google/cloud/monitoring_v3/proto/common_pb2.py @@ -435,7 +435,7 @@ index=0, containing_type=None, fields=[], - ) + ), ], serialized_start=168, serialized_end=338, @@ -581,7 +581,7 @@ ], extensions=[], nested_types=[], - enum_types=[_AGGREGATION_ALIGNER, _AGGREGATION_REDUCER], + enum_types=[_AGGREGATION_ALIGNER, _AGGREGATION_REDUCER,], serialized_options=None, is_extendable=False, syntax="proto3", diff --git a/monitoring/google/cloud/monitoring_v3/proto/dropped_labels.proto b/monitoring/google/cloud/monitoring_v3/proto/dropped_labels.proto index 016ecf7b0843..9b943ccd0475 100644 --- a/monitoring/google/cloud/monitoring_v3/proto/dropped_labels.proto +++ b/monitoring/google/cloud/monitoring_v3/proto/dropped_labels.proto @@ -19,10 +19,10 @@ package google.monitoring.v3; option csharp_namespace = "Google.Cloud.Monitoring.V3"; option go_package = "google.golang.org/genproto/googleapis/monitoring/v3;monitoring"; -option php_namespace = "Google\\Cloud\\Monitoring\\V3"; option java_multiple_files = true; option java_outer_classname = "DroppedLabelsProto"; option java_package = "com.google.monitoring.v3"; +option php_namespace = "Google\\Cloud\\Monitoring\\V3"; // A set of (label, value) pairs which were dropped during aggregation, attached // to google.api.Distribution.Exemplars in google.api.Distribution values during diff --git a/monitoring/google/cloud/monitoring_v3/proto/dropped_labels_pb2.py b/monitoring/google/cloud/monitoring_v3/proto/dropped_labels_pb2.py index 16f894908c67..9a04888c3391 100644 --- a/monitoring/google/cloud/monitoring_v3/proto/dropped_labels_pb2.py +++ b/monitoring/google/cloud/monitoring_v3/proto/dropped_labels_pb2.py @@ -108,10 +108,10 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + ), ], extensions=[], - nested_types=[_DROPPEDLABELS_LABELENTRY], + nested_types=[_DROPPEDLABELS_LABELENTRY,], enum_types=[], serialized_options=None, is_extendable=False, diff --git a/monitoring/google/cloud/monitoring_v3/proto/group_service_pb2.py b/monitoring/google/cloud/monitoring_v3/proto/group_service_pb2.py index 81c49b82211c..323f6525ee78 100644 --- a/monitoring/google/cloud/monitoring_v3/proto/group_service_pb2.py +++ b/monitoring/google/cloud/monitoring_v3/proto/group_service_pb2.py @@ -180,7 +180,7 @@ index=0, containing_type=None, fields=[], - ) + ), ], serialized_start=293, serialized_end=466, @@ -268,7 +268,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + ), ], extensions=[], nested_types=[], diff --git a/monitoring/google/cloud/monitoring_v3/proto/metric.proto b/monitoring/google/cloud/monitoring_v3/proto/metric.proto index 4c5c0a84810a..3c202ed412c9 100644 --- a/monitoring/google/cloud/monitoring_v3/proto/metric.proto +++ b/monitoring/google/cloud/monitoring_v3/proto/metric.proto @@ -33,14 +33,14 @@ option php_namespace = "Google\\Cloud\\Monitoring\\V3"; // A single data point in a time series. message Point { // The time interval to which the data point applies. For `GAUGE` metrics, - // the start time is optional, but if it is supplied, it must equal the end - // time. For `DELTA` metrics, the start and end time should specify a - // non-zero interval, with subsequent points specifying contiguous and - // non-overlapping intervals. For `CUMULATIVE` metrics, the start and end - // time should specify a non-zero interval, with subsequent points specifying - // the same start time and increasing end times, until an event resets the - // cumulative value to zero and sets a new start time for the following - // points. + // the start time is optional, but if it is supplied, it must equal the + // end time. For `DELTA` metrics, the start + // and end time should specify a non-zero interval, with subsequent points + // specifying contiguous and non-overlapping intervals. For `CUMULATIVE` + // metrics, the start and end time should specify a non-zero interval, with + // subsequent points specifying the same start time and increasing end times, + // until an event resets the cumulative value to zero and sets a new start + // time for the following points. TimeInterval interval = 1; // The value of the data point. diff --git a/monitoring/google/cloud/monitoring_v3/proto/metric_service.proto b/monitoring/google/cloud/monitoring_v3/proto/metric_service.proto index 3dc20be9aa57..101dee40e973 100644 --- a/monitoring/google/cloud/monitoring_v3/proto/metric_service.proto +++ b/monitoring/google/cloud/monitoring_v3/proto/metric_service.proto @@ -252,13 +252,15 @@ message ListTimeSeriesRequest { // in the response. TimeInterval interval = 4; - // By default, the raw time series data is returned. - // Use this field to combine multiple time series for different - // views of the data. + // Specifies the alignment of data points in individual time series as + // well as how to combine the retrieved time series across specified labels. + // + // By default (if no `aggregation` is explicitly specified), the raw time + // series data is returned. Aggregation aggregation = 5; // Unsupported: must be left blank. The points in each time series are - // returned in reverse time order. + // currently returned in reverse time order (most recent to oldest). string order_by = 6; // Specifies which information is returned about the time series. @@ -308,14 +310,32 @@ message CreateTimeSeriesRequest { repeated TimeSeries time_series = 2; } -// Describes the result of a failed request to write data to a time series. +// DEPRECATED. Used to hold per-time-series error status. message CreateTimeSeriesError { - // The time series, including the `Metric`, `MonitoredResource`, - // and `Point`s (including timestamp and value) that resulted - // in the error. This field provides all of the context that - // would be needed to retry the operation. - TimeSeries time_series = 1; - - // The status of the requested write operation. - google.rpc.Status status = 2; + // DEPRECATED. Time series ID that resulted in the `status` error. + TimeSeries time_series = 1 [deprecated = true]; + + // DEPRECATED. The status of the requested write operation for `time_series`. + google.rpc.Status status = 2 [deprecated = true]; +} + +// Summary of the result of a failed request to write data to a time series. +message CreateTimeSeriesSummary { + // Detailed information about an error category. + message Error { + // The status of the requested write operation. + google.rpc.Status status = 1; + + // The number of points that couldn't be written because of `status`. + int32 point_count = 2; + } + + // The number of points in the request. + int32 total_point_count = 1; + + // The number of points that were successfully written. + int32 success_point_count = 2; + + // The number of points that failed to be written. Order is not guaranteed. + repeated Error errors = 3; } diff --git a/monitoring/google/cloud/monitoring_v3/proto/metric_service_pb2.py b/monitoring/google/cloud/monitoring_v3/proto/metric_service_pb2.py index eac866dbe01a..57ca2bcb2920 100644 --- a/monitoring/google/cloud/monitoring_v3/proto/metric_service_pb2.py +++ b/monitoring/google/cloud/monitoring_v3/proto/metric_service_pb2.py @@ -43,7 +43,7 @@ "\n\030com.google.monitoring.v3B\022MetricServiceProtoP\001Z>google.golang.org/genproto/googleapis/monitoring/v3;monitoring\252\002\032Google.Cloud.Monitoring.V3\312\002\032Google\\Cloud\\Monitoring\\V3" ), serialized_pb=_b( - '\n5google/cloud/monitoring_v3/proto/metric_service.proto\x12\x14google.monitoring.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/metric.proto\x1a#google/api/monitored_resource.proto\x1a,google/cloud/monitoring_v3/proto/alert.proto\x1a-google/cloud/monitoring_v3/proto/common.proto\x1a-google/cloud/monitoring_v3/proto/metric.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x17google/rpc/status.proto\x1a\x17google/api/client.proto"n\n\'ListMonitoredResourceDescriptorsRequest\x12\x0c\n\x04name\x18\x05 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t"\x8a\x01\n(ListMonitoredResourceDescriptorsResponse\x12\x45\n\x14resource_descriptors\x18\x01 \x03(\x0b\x32\'.google.api.MonitoredResourceDescriptor\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"5\n%GetMonitoredResourceDescriptorRequest\x12\x0c\n\x04name\x18\x03 \x01(\t"c\n\x1cListMetricDescriptorsRequest\x12\x0c\n\x04name\x18\x05 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t"r\n\x1dListMetricDescriptorsResponse\x12\x38\n\x12metric_descriptors\x18\x01 \x03(\x0b\x32\x1c.google.api.MetricDescriptor\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"*\n\x1aGetMetricDescriptorRequest\x12\x0c\n\x04name\x18\x03 \x01(\t"f\n\x1d\x43reateMetricDescriptorRequest\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x37\n\x11metric_descriptor\x18\x02 \x01(\x0b\x32\x1c.google.api.MetricDescriptor"-\n\x1d\x44\x65leteMetricDescriptorRequest\x12\x0c\n\x04name\x18\x03 \x01(\t"\xcf\x02\n\x15ListTimeSeriesRequest\x12\x0c\n\x04name\x18\n \x01(\t\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x34\n\x08interval\x18\x04 \x01(\x0b\x32".google.monitoring.v3.TimeInterval\x12\x36\n\x0b\x61ggregation\x18\x05 \x01(\x0b\x32!.google.monitoring.v3.Aggregation\x12\x10\n\x08order_by\x18\x06 \x01(\t\x12H\n\x04view\x18\x07 \x01(\x0e\x32:.google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView\x12\x11\n\tpage_size\x18\x08 \x01(\x05\x12\x12\n\npage_token\x18\t \x01(\t"\'\n\x0eTimeSeriesView\x12\x08\n\x04\x46ULL\x10\x00\x12\x0b\n\x07HEADERS\x10\x01"\x96\x01\n\x16ListTimeSeriesResponse\x12\x35\n\x0btime_series\x18\x01 \x03(\x0b\x32 .google.monitoring.v3.TimeSeries\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12,\n\x10\x65xecution_errors\x18\x03 \x03(\x0b\x32\x12.google.rpc.Status"^\n\x17\x43reateTimeSeriesRequest\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x35\n\x0btime_series\x18\x02 \x03(\x0b\x32 .google.monitoring.v3.TimeSeries"r\n\x15\x43reateTimeSeriesError\x12\x35\n\x0btime_series\x18\x01 \x01(\x0b\x32 .google.monitoring.v3.TimeSeries\x12"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status2\xd2\x0c\n\rMetricService\x12\xdd\x01\n ListMonitoredResourceDescriptors\x12=.google.monitoring.v3.ListMonitoredResourceDescriptorsRequest\x1a>.google.monitoring.v3.ListMonitoredResourceDescriptorsResponse":\x82\xd3\xe4\x93\x02\x34\x12\x32/v3/{name=projects/*}/monitoredResourceDescriptors\x12\xc4\x01\n\x1eGetMonitoredResourceDescriptor\x12;.google.monitoring.v3.GetMonitoredResourceDescriptorRequest\x1a\'.google.api.MonitoredResourceDescriptor"<\x82\xd3\xe4\x93\x02\x36\x12\x34/v3/{name=projects/*/monitoredResourceDescriptors/*}\x12\xb1\x01\n\x15ListMetricDescriptors\x12\x32.google.monitoring.v3.ListMetricDescriptorsRequest\x1a\x33.google.monitoring.v3.ListMetricDescriptorsResponse"/\x82\xd3\xe4\x93\x02)\x12\'/v3/{name=projects/*}/metricDescriptors\x12\x99\x01\n\x13GetMetricDescriptor\x12\x30.google.monitoring.v3.GetMetricDescriptorRequest\x1a\x1c.google.api.MetricDescriptor"2\x82\xd3\xe4\x93\x02,\x12*/v3/{name=projects/*/metricDescriptors/**}\x12\xaf\x01\n\x16\x43reateMetricDescriptor\x12\x33.google.monitoring.v3.CreateMetricDescriptorRequest\x1a\x1c.google.api.MetricDescriptor"B\x82\xd3\xe4\x93\x02<"\'/v3/{name=projects/*}/metricDescriptors:\x11metric_descriptor\x12\x99\x01\n\x16\x44\x65leteMetricDescriptor\x12\x33.google.monitoring.v3.DeleteMetricDescriptorRequest\x1a\x16.google.protobuf.Empty"2\x82\xd3\xe4\x93\x02,**/v3/{name=projects/*/metricDescriptors/**}\x12\x95\x01\n\x0eListTimeSeries\x12+.google.monitoring.v3.ListTimeSeriesRequest\x1a,.google.monitoring.v3.ListTimeSeriesResponse"(\x82\xd3\xe4\x93\x02"\x12 /v3/{name=projects/*}/timeSeries\x12\x86\x01\n\x10\x43reateTimeSeries\x12-.google.monitoring.v3.CreateTimeSeriesRequest\x1a\x16.google.protobuf.Empty"+\x82\xd3\xe4\x93\x02%" /v3/{name=projects/*}/timeSeries:\x01*\x1a\xda\x01\xca\x41\x19monitoring.googleapis.com\xd2\x41\xba\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.read,https://www.googleapis.com/auth/monitoring.writeB\xaa\x01\n\x18\x63om.google.monitoring.v3B\x12MetricServiceProtoP\x01Z>google.golang.org/genproto/googleapis/monitoring/v3;monitoring\xaa\x02\x1aGoogle.Cloud.Monitoring.V3\xca\x02\x1aGoogle\\Cloud\\Monitoring\\V3b\x06proto3' + '\n5google/cloud/monitoring_v3/proto/metric_service.proto\x12\x14google.monitoring.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/metric.proto\x1a#google/api/monitored_resource.proto\x1a,google/cloud/monitoring_v3/proto/alert.proto\x1a-google/cloud/monitoring_v3/proto/common.proto\x1a-google/cloud/monitoring_v3/proto/metric.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x17google/rpc/status.proto\x1a\x17google/api/client.proto"n\n\'ListMonitoredResourceDescriptorsRequest\x12\x0c\n\x04name\x18\x05 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t"\x8a\x01\n(ListMonitoredResourceDescriptorsResponse\x12\x45\n\x14resource_descriptors\x18\x01 \x03(\x0b\x32\'.google.api.MonitoredResourceDescriptor\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"5\n%GetMonitoredResourceDescriptorRequest\x12\x0c\n\x04name\x18\x03 \x01(\t"c\n\x1cListMetricDescriptorsRequest\x12\x0c\n\x04name\x18\x05 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t"r\n\x1dListMetricDescriptorsResponse\x12\x38\n\x12metric_descriptors\x18\x01 \x03(\x0b\x32\x1c.google.api.MetricDescriptor\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"*\n\x1aGetMetricDescriptorRequest\x12\x0c\n\x04name\x18\x03 \x01(\t"f\n\x1d\x43reateMetricDescriptorRequest\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x37\n\x11metric_descriptor\x18\x02 \x01(\x0b\x32\x1c.google.api.MetricDescriptor"-\n\x1d\x44\x65leteMetricDescriptorRequest\x12\x0c\n\x04name\x18\x03 \x01(\t"\xcf\x02\n\x15ListTimeSeriesRequest\x12\x0c\n\x04name\x18\n \x01(\t\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x34\n\x08interval\x18\x04 \x01(\x0b\x32".google.monitoring.v3.TimeInterval\x12\x36\n\x0b\x61ggregation\x18\x05 \x01(\x0b\x32!.google.monitoring.v3.Aggregation\x12\x10\n\x08order_by\x18\x06 \x01(\t\x12H\n\x04view\x18\x07 \x01(\x0e\x32:.google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView\x12\x11\n\tpage_size\x18\x08 \x01(\x05\x12\x12\n\npage_token\x18\t \x01(\t"\'\n\x0eTimeSeriesView\x12\x08\n\x04\x46ULL\x10\x00\x12\x0b\n\x07HEADERS\x10\x01"\x96\x01\n\x16ListTimeSeriesResponse\x12\x35\n\x0btime_series\x18\x01 \x03(\x0b\x32 .google.monitoring.v3.TimeSeries\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12,\n\x10\x65xecution_errors\x18\x03 \x03(\x0b\x32\x12.google.rpc.Status"^\n\x17\x43reateTimeSeriesRequest\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x35\n\x0btime_series\x18\x02 \x03(\x0b\x32 .google.monitoring.v3.TimeSeries"z\n\x15\x43reateTimeSeriesError\x12\x39\n\x0btime_series\x18\x01 \x01(\x0b\x32 .google.monitoring.v3.TimeSeriesB\x02\x18\x01\x12&\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.StatusB\x02\x18\x01"\xd8\x01\n\x17\x43reateTimeSeriesSummary\x12\x19\n\x11total_point_count\x18\x01 \x01(\x05\x12\x1b\n\x13success_point_count\x18\x02 \x01(\x05\x12\x43\n\x06\x65rrors\x18\x03 \x03(\x0b\x32\x33.google.monitoring.v3.CreateTimeSeriesSummary.Error\x1a@\n\x05\x45rror\x12"\n\x06status\x18\x01 \x01(\x0b\x32\x12.google.rpc.Status\x12\x13\n\x0bpoint_count\x18\x02 \x01(\x05\x32\xd2\x0c\n\rMetricService\x12\xdd\x01\n ListMonitoredResourceDescriptors\x12=.google.monitoring.v3.ListMonitoredResourceDescriptorsRequest\x1a>.google.monitoring.v3.ListMonitoredResourceDescriptorsResponse":\x82\xd3\xe4\x93\x02\x34\x12\x32/v3/{name=projects/*}/monitoredResourceDescriptors\x12\xc4\x01\n\x1eGetMonitoredResourceDescriptor\x12;.google.monitoring.v3.GetMonitoredResourceDescriptorRequest\x1a\'.google.api.MonitoredResourceDescriptor"<\x82\xd3\xe4\x93\x02\x36\x12\x34/v3/{name=projects/*/monitoredResourceDescriptors/*}\x12\xb1\x01\n\x15ListMetricDescriptors\x12\x32.google.monitoring.v3.ListMetricDescriptorsRequest\x1a\x33.google.monitoring.v3.ListMetricDescriptorsResponse"/\x82\xd3\xe4\x93\x02)\x12\'/v3/{name=projects/*}/metricDescriptors\x12\x99\x01\n\x13GetMetricDescriptor\x12\x30.google.monitoring.v3.GetMetricDescriptorRequest\x1a\x1c.google.api.MetricDescriptor"2\x82\xd3\xe4\x93\x02,\x12*/v3/{name=projects/*/metricDescriptors/**}\x12\xaf\x01\n\x16\x43reateMetricDescriptor\x12\x33.google.monitoring.v3.CreateMetricDescriptorRequest\x1a\x1c.google.api.MetricDescriptor"B\x82\xd3\xe4\x93\x02<"\'/v3/{name=projects/*}/metricDescriptors:\x11metric_descriptor\x12\x99\x01\n\x16\x44\x65leteMetricDescriptor\x12\x33.google.monitoring.v3.DeleteMetricDescriptorRequest\x1a\x16.google.protobuf.Empty"2\x82\xd3\xe4\x93\x02,**/v3/{name=projects/*/metricDescriptors/**}\x12\x95\x01\n\x0eListTimeSeries\x12+.google.monitoring.v3.ListTimeSeriesRequest\x1a,.google.monitoring.v3.ListTimeSeriesResponse"(\x82\xd3\xe4\x93\x02"\x12 /v3/{name=projects/*}/timeSeries\x12\x86\x01\n\x10\x43reateTimeSeries\x12-.google.monitoring.v3.CreateTimeSeriesRequest\x1a\x16.google.protobuf.Empty"+\x82\xd3\xe4\x93\x02%" /v3/{name=projects/*}/timeSeries:\x01*\x1a\xda\x01\xca\x41\x19monitoring.googleapis.com\xd2\x41\xba\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.read,https://www.googleapis.com/auth/monitoring.writeB\xaa\x01\n\x18\x63om.google.monitoring.v3B\x12MetricServiceProtoP\x01Z>google.golang.org/genproto/googleapis/monitoring/v3;monitoring\xaa\x02\x1aGoogle.Cloud.Monitoring.V3\xca\x02\x1aGoogle\\Cloud\\Monitoring\\V3b\x06proto3' ), dependencies=[ google_dot_api_dot_annotations__pb2.DESCRIPTOR, @@ -255,7 +255,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + ), ], extensions=[], nested_types=[], @@ -444,7 +444,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + ), ], extensions=[], nested_types=[], @@ -540,7 +540,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + ), ], extensions=[], nested_types=[], @@ -709,7 +709,7 @@ ], extensions=[], nested_types=[], - enum_types=[_LISTTIMESERIESREQUEST_TIMESERIESVIEW], + enum_types=[_LISTTIMESERIESREQUEST_TIMESERIESVIEW,], serialized_options=None, is_extendable=False, syntax="proto3", @@ -874,7 +874,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\030\001"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -892,7 +892,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\030\001"), file=DESCRIPTOR, ), ], @@ -905,7 +905,138 @@ extension_ranges=[], oneofs=[], serialized_start=1729, - serialized_end=1843, + serialized_end=1851, +) + + +_CREATETIMESERIESSUMMARY_ERROR = _descriptor.Descriptor( + name="Error", + full_name="google.monitoring.v3.CreateTimeSeriesSummary.Error", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="status", + full_name="google.monitoring.v3.CreateTimeSeriesSummary.Error.status", + index=0, + number=1, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="point_count", + full_name="google.monitoring.v3.CreateTimeSeriesSummary.Error.point_count", + index=1, + number=2, + type=5, + cpp_type=1, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=2006, + serialized_end=2070, +) + +_CREATETIMESERIESSUMMARY = _descriptor.Descriptor( + name="CreateTimeSeriesSummary", + full_name="google.monitoring.v3.CreateTimeSeriesSummary", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="total_point_count", + full_name="google.monitoring.v3.CreateTimeSeriesSummary.total_point_count", + index=0, + number=1, + type=5, + cpp_type=1, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="success_point_count", + full_name="google.monitoring.v3.CreateTimeSeriesSummary.success_point_count", + index=1, + number=2, + type=5, + cpp_type=1, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="errors", + full_name="google.monitoring.v3.CreateTimeSeriesSummary.errors", + index=2, + number=3, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[_CREATETIMESERIESSUMMARY_ERROR,], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1854, + serialized_end=2070, ) _LISTMONITOREDRESOURCEDESCRIPTORSRESPONSE.fields_by_name[ @@ -954,6 +1085,13 @@ _CREATETIMESERIESERROR.fields_by_name[ "status" ].message_type = google_dot_rpc_dot_status__pb2._STATUS +_CREATETIMESERIESSUMMARY_ERROR.fields_by_name[ + "status" +].message_type = google_dot_rpc_dot_status__pb2._STATUS +_CREATETIMESERIESSUMMARY_ERROR.containing_type = _CREATETIMESERIESSUMMARY +_CREATETIMESERIESSUMMARY.fields_by_name[ + "errors" +].message_type = _CREATETIMESERIESSUMMARY_ERROR DESCRIPTOR.message_types_by_name[ "ListMonitoredResourceDescriptorsRequest" ] = _LISTMONITOREDRESOURCEDESCRIPTORSREQUEST @@ -982,6 +1120,7 @@ DESCRIPTOR.message_types_by_name["ListTimeSeriesResponse"] = _LISTTIMESERIESRESPONSE DESCRIPTOR.message_types_by_name["CreateTimeSeriesRequest"] = _CREATETIMESERIESREQUEST DESCRIPTOR.message_types_by_name["CreateTimeSeriesError"] = _CREATETIMESERIESERROR +DESCRIPTOR.message_types_by_name["CreateTimeSeriesSummary"] = _CREATETIMESERIESSUMMARY _sym_db.RegisterFileDescriptor(DESCRIPTOR) ListMonitoredResourceDescriptorsRequest = _reflection.GeneratedProtocolMessageType( @@ -1213,12 +1352,14 @@ time series that contain data points in the specified interval are included in the response. aggregation: - By default, the raw time series data is returned. Use this - field to combine multiple time series for different views of - the data. + Specifies the alignment of data points in individual time + series as well as how to combine the retrieved time series + across specified labels. By default (if no ``aggregation`` is + explicitly specified), the raw time series data is returned. order_by: Unsupported: must be left blank. The points in each time - series are returned in reverse time order. + series are currently returned in reverse time order (most + recent to oldest). view: Specifies which information is returned about the time series. page_size: @@ -1299,25 +1440,70 @@ dict( DESCRIPTOR=_CREATETIMESERIESERROR, __module__="google.cloud.monitoring_v3.proto.metric_service_pb2", - __doc__="""Describes the result of a failed request to write data to a time series. + __doc__="""DEPRECATED. Used to hold per-time-series error status. Attributes: time_series: - The time series, including the ``Metric``, - ``MonitoredResource``, and ``Point``\ s (including timestamp - and value) that resulted in the error. This field provides all - of the context that would be needed to retry the operation. + DEPRECATED. Time series ID that resulted in the ``status`` + error. status: - The status of the requested write operation. + DEPRECATED. The status of the requested write operation for + ``time_series``. """, # @@protoc_insertion_point(class_scope:google.monitoring.v3.CreateTimeSeriesError) ), ) _sym_db.RegisterMessage(CreateTimeSeriesError) +CreateTimeSeriesSummary = _reflection.GeneratedProtocolMessageType( + "CreateTimeSeriesSummary", + (_message.Message,), + dict( + Error=_reflection.GeneratedProtocolMessageType( + "Error", + (_message.Message,), + dict( + DESCRIPTOR=_CREATETIMESERIESSUMMARY_ERROR, + __module__="google.cloud.monitoring_v3.proto.metric_service_pb2", + __doc__="""Detailed information about an error category. + + + Attributes: + status: + The status of the requested write operation. + point_count: + The number of points that couldn't be written because of + ``status``. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.CreateTimeSeriesSummary.Error) + ), + ), + DESCRIPTOR=_CREATETIMESERIESSUMMARY, + __module__="google.cloud.monitoring_v3.proto.metric_service_pb2", + __doc__="""Summary of the result of a failed request to write data to a time + series. + + + Attributes: + total_point_count: + The number of points in the request. + success_point_count: + The number of points that were successfully written. + errors: + The number of points that failed to be written. Order is not + guaranteed. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.CreateTimeSeriesSummary) + ), +) +_sym_db.RegisterMessage(CreateTimeSeriesSummary) +_sym_db.RegisterMessage(CreateTimeSeriesSummary.Error) + DESCRIPTOR._options = None +_CREATETIMESERIESERROR.fields_by_name["time_series"]._options = None +_CREATETIMESERIESERROR.fields_by_name["status"]._options = None _METRICSERVICE = _descriptor.ServiceDescriptor( name="MetricService", @@ -1327,8 +1513,8 @@ serialized_options=_b( "\312A\031monitoring.googleapis.com\322A\272\001https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.read,https://www.googleapis.com/auth/monitoring.write" ), - serialized_start=1846, - serialized_end=3464, + serialized_start=2073, + serialized_end=3691, methods=[ _descriptor.MethodDescriptor( name="ListMonitoredResourceDescriptors", diff --git a/monitoring/google/cloud/monitoring_v3/proto/mutation_record_pb2.py b/monitoring/google/cloud/monitoring_v3/proto/mutation_record_pb2.py index d3658ee2489e..aeb3abd85858 100644 --- a/monitoring/google/cloud/monitoring_v3/proto/mutation_record_pb2.py +++ b/monitoring/google/cloud/monitoring_v3/proto/mutation_record_pb2.py @@ -28,7 +28,7 @@ serialized_pb=_b( '\n6google/cloud/monitoring_v3/proto/mutation_record.proto\x12\x14google.monitoring.v3\x1a\x1fgoogle/protobuf/timestamp.proto"U\n\x0eMutationRecord\x12/\n\x0bmutate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x12\n\nmutated_by\x18\x02 \x01(\tB\xab\x01\n\x18\x63om.google.monitoring.v3B\x13MutationRecordProtoP\x01Z>google.golang.org/genproto/googleapis/monitoring/v3;monitoring\xaa\x02\x1aGoogle.Cloud.Monitoring.V3\xca\x02\x1aGoogle\\Cloud\\Monitoring\\V3b\x06proto3' ), - dependencies=[google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR], + dependencies=[google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,], ) diff --git a/monitoring/google/cloud/monitoring_v3/proto/notification.proto b/monitoring/google/cloud/monitoring_v3/proto/notification.proto index 4ee97b8f6e51..939ca2677187 100644 --- a/monitoring/google/cloud/monitoring_v3/proto/notification.proto +++ b/monitoring/google/cloud/monitoring_v3/proto/notification.proto @@ -18,6 +18,7 @@ syntax = "proto3"; package google.monitoring.v3; import "google/api/label.proto"; +import "google/api/launch_stage.proto"; import "google/monitoring/v3/common.proto"; import "google/protobuf/wrappers.proto"; diff --git a/monitoring/google/cloud/monitoring_v3/proto/notification_pb2.py b/monitoring/google/cloud/monitoring_v3/proto/notification_pb2.py index d85894856312..4d34d99f521b 100644 --- a/monitoring/google/cloud/monitoring_v3/proto/notification_pb2.py +++ b/monitoring/google/cloud/monitoring_v3/proto/notification_pb2.py @@ -16,6 +16,7 @@ from google.api import label_pb2 as google_dot_api_dot_label__pb2 +from google.api import launch_stage_pb2 as google_dot_api_dot_launch__stage__pb2 from google.cloud.monitoring_v3.proto import ( common_pb2 as google_dot_cloud_dot_monitoring__v3_dot_proto_dot_common__pb2, ) @@ -30,10 +31,11 @@ "\n\030com.google.monitoring.v3B\021NotificationProtoP\001Z>google.golang.org/genproto/googleapis/monitoring/v3;monitoring\252\002\032Google.Cloud.Monitoring.V3\312\002\032Google\\Cloud\\Monitoring\\V3" ), serialized_pb=_b( - '\n3google/cloud/monitoring_v3/proto/notification.proto\x12\x14google.monitoring.v3\x1a\x16google/api/label.proto\x1a-google/cloud/monitoring_v3/proto/common.proto\x1a\x1egoogle/protobuf/wrappers.proto"\xd3\x01\n\x1dNotificationChannelDescriptor\x12\x0c\n\x04name\x18\x06 \x01(\t\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12+\n\x06labels\x18\x04 \x03(\x0b\x32\x1b.google.api.LabelDescriptor\x12>\n\x0fsupported_tiers\x18\x05 \x03(\x0e\x32!.google.monitoring.v3.ServiceTierB\x02\x18\x01"\xb6\x04\n\x13NotificationChannel\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x06 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x45\n\x06labels\x18\x05 \x03(\x0b\x32\x35.google.monitoring.v3.NotificationChannel.LabelsEntry\x12N\n\x0buser_labels\x18\x08 \x03(\x0b\x32\x39.google.monitoring.v3.NotificationChannel.UserLabelsEntry\x12Y\n\x13verification_status\x18\t \x01(\x0e\x32<.google.monitoring.v3.NotificationChannel.VerificationStatus\x12+\n\x07\x65nabled\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x31\n\x0fUserLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"W\n\x12VerificationStatus\x12#\n\x1fVERIFICATION_STATUS_UNSPECIFIED\x10\x00\x12\x0e\n\nUNVERIFIED\x10\x01\x12\x0c\n\x08VERIFIED\x10\x02\x42\xa9\x01\n\x18\x63om.google.monitoring.v3B\x11NotificationProtoP\x01Z>google.golang.org/genproto/googleapis/monitoring/v3;monitoring\xaa\x02\x1aGoogle.Cloud.Monitoring.V3\xca\x02\x1aGoogle\\Cloud\\Monitoring\\V3b\x06proto3' + '\n3google/cloud/monitoring_v3/proto/notification.proto\x12\x14google.monitoring.v3\x1a\x16google/api/label.proto\x1a\x1dgoogle/api/launch_stage.proto\x1a-google/cloud/monitoring_v3/proto/common.proto\x1a\x1egoogle/protobuf/wrappers.proto"\xd3\x01\n\x1dNotificationChannelDescriptor\x12\x0c\n\x04name\x18\x06 \x01(\t\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12+\n\x06labels\x18\x04 \x03(\x0b\x32\x1b.google.api.LabelDescriptor\x12>\n\x0fsupported_tiers\x18\x05 \x03(\x0e\x32!.google.monitoring.v3.ServiceTierB\x02\x18\x01"\xb6\x04\n\x13NotificationChannel\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x06 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x45\n\x06labels\x18\x05 \x03(\x0b\x32\x35.google.monitoring.v3.NotificationChannel.LabelsEntry\x12N\n\x0buser_labels\x18\x08 \x03(\x0b\x32\x39.google.monitoring.v3.NotificationChannel.UserLabelsEntry\x12Y\n\x13verification_status\x18\t \x01(\x0e\x32<.google.monitoring.v3.NotificationChannel.VerificationStatus\x12+\n\x07\x65nabled\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x31\n\x0fUserLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"W\n\x12VerificationStatus\x12#\n\x1fVERIFICATION_STATUS_UNSPECIFIED\x10\x00\x12\x0e\n\nUNVERIFIED\x10\x01\x12\x0c\n\x08VERIFIED\x10\x02\x42\xa9\x01\n\x18\x63om.google.monitoring.v3B\x11NotificationProtoP\x01Z>google.golang.org/genproto/googleapis/monitoring/v3;monitoring\xaa\x02\x1aGoogle.Cloud.Monitoring.V3\xca\x02\x1aGoogle\\Cloud\\Monitoring\\V3b\x06proto3' ), dependencies=[ google_dot_api_dot_label__pb2.DESCRIPTOR, + google_dot_api_dot_launch__stage__pb2.DESCRIPTOR, google_dot_cloud_dot_monitoring__v3_dot_proto_dot_common__pb2.DESCRIPTOR, google_dot_protobuf_dot_wrappers__pb2.DESCRIPTOR, ], @@ -62,8 +64,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=874, - serialized_end=961, + serialized_start=905, + serialized_end=992, ) _sym_db.RegisterEnumDescriptor(_NOTIFICATIONCHANNEL_VERIFICATIONSTATUS) @@ -192,8 +194,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=181, - serialized_end=392, + serialized_start=212, + serialized_end=423, ) @@ -249,8 +251,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=776, - serialized_end=821, + serialized_start=807, + serialized_end=852, ) _NOTIFICATIONCHANNEL_USERLABELSENTRY = _descriptor.Descriptor( @@ -305,8 +307,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=823, - serialized_end=872, + serialized_start=854, + serialized_end=903, ) _NOTIFICATIONCHANNEL = _descriptor.Descriptor( @@ -466,14 +468,14 @@ _NOTIFICATIONCHANNEL_LABELSENTRY, _NOTIFICATIONCHANNEL_USERLABELSENTRY, ], - enum_types=[_NOTIFICATIONCHANNEL_VERIFICATIONSTATUS], + enum_types=[_NOTIFICATIONCHANNEL_VERIFICATIONSTATUS,], serialized_options=None, is_extendable=False, syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=395, - serialized_end=961, + serialized_start=426, + serialized_end=992, ) _NOTIFICATIONCHANNELDESCRIPTOR.fields_by_name[ diff --git a/monitoring/google/cloud/monitoring_v3/proto/notification_service_pb2.py b/monitoring/google/cloud/monitoring_v3/proto/notification_service_pb2.py index d8b09b505ea1..285d796b3e80 100644 --- a/monitoring/google/cloud/monitoring_v3/proto/notification_service_pb2.py +++ b/monitoring/google/cloud/monitoring_v3/proto/notification_service_pb2.py @@ -204,7 +204,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + ), ], extensions=[], nested_types=[], @@ -468,7 +468,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + ), ], extensions=[], nested_types=[], @@ -621,7 +621,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + ), ], extensions=[], nested_types=[], diff --git a/monitoring/google/cloud/monitoring_v3/proto/service.proto b/monitoring/google/cloud/monitoring_v3/proto/service.proto new file mode 100644 index 000000000000..7de203319af1 --- /dev/null +++ b/monitoring/google/cloud/monitoring_v3/proto/service.proto @@ -0,0 +1,379 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.monitoring.v3; + +import "google/api/monitored_resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/calendar_period.proto"; + +option csharp_namespace = "Google.Cloud.Monitoring.V3"; +option go_package = "google.golang.org/genproto/googleapis/monitoring/v3;monitoring"; +option java_multiple_files = true; +option java_outer_classname = "ServiceMonitoringProto"; +option java_package = "com.google.monitoring.v3"; +option php_namespace = "Google\\Cloud\\Monitoring\\V3"; + +// A `Service` is a discrete, autonomous, and network-accessible unit, designed +// to solve an individual concern +// ([Wikipedia](https://en.wikipedia.org/wiki/Service-orientation)). In +// Stackdriver Monitoring, a `Service` acts as the root resource under which +// operational aspects of the service are accessible. +message Service { + // Custom view of service telemetry. Currently a place-holder pending final + // design. + message Custom { + + } + + // App Engine service. Learn more at https://cloud.google.com/appengine. + message AppEngine { + // The ID of the App Engine module underlying this service. Corresponds to + // the `module_id` resource label in the `gae_app` monitored resource: + // https://cloud.google.com/monitoring/api/resources#tag_gae_app + string module_id = 1; + } + + // Cloud Endpoints service. Learn more at https://cloud.google.com/endpoints. + message CloudEndpoints { + // The name of the Cloud Endpoints service underlying this service. + // Corresponds to the `service` resource label in the `api` monitored + // resource: https://cloud.google.com/monitoring/api/resources#tag_api + string service = 1; + } + + // Istio service. Learn more at http://istio.io. + message ClusterIstio { + // The location of the Kubernetes cluster in which this Istio service is + // defined. Corresponds to the `location` resource label in `k8s_cluster` + // resources. + string location = 1; + + // The name of the Kubernetes cluster in which this Istio service is + // defined. Corresponds to the `cluster_name` resource label in + // `k8s_cluster` resources. + string cluster_name = 2; + + // The namespace of the Istio service underlying this service. Corresponds + // to the `destination_service_namespace` metric label in Istio metrics. + string service_namespace = 3; + + // The name of the Istio service underlying this service. Corresponds to the + // `destination_service_name` metric label in Istio metrics. + string service_name = 4; + } + + // Configuration for how to query telemetry on a Service. + message Telemetry { + // The full name of the resource that defines this service. Formatted as + // described in https://cloud.google.com/apis/design/resource_names. + string resource_name = 1; + } + + // Resource name for this Service. Of the form + // `projects/{project_id}/services/{service_id}`. + string name = 1; + + // Name used for UI elements listing this Service. + string display_name = 2; + + // REQUIRED. Service-identifying atoms specifying the underlying service. + oneof identifier { + // Custom service type. + Custom custom = 6; + + // Type used for App Engine services. + AppEngine app_engine = 7; + + // Type used for Cloud Endpoints services. + CloudEndpoints cloud_endpoints = 8; + + // Type used for Istio services that live in a Kubernetes cluster. + ClusterIstio cluster_istio = 9; + } + + // Configuration for how to query telemetry on a Service. + Telemetry telemetry = 13; +} + +// A Service-Level Objective (SLO) describes a level of desired good service. It +// consists of a service-level indicator (SLI), a performance goal, and a period +// over which the objective is to be evaluated against that goal. The SLO can +// use SLIs defined in a number of different manners. Typical SLOs might include +// "99% of requests in each rolling week have latency below 200 milliseconds" or +// "99.5% of requests in each calendar month return successfully." +message ServiceLevelObjective { + // `ServiceLevelObjective.View` determines what form of + // `ServiceLevelObjective` is returned from `GetServiceLevelObjective`, + // `ListServiceLevelObjectives`, and `ListServiceLevelObjectiveVersions` RPCs. + enum View { + // Same as FULL. + VIEW_UNSPECIFIED = 0; + + // Return the embedded `ServiceLevelIndicator` in the form in which it was + // defined. If it was defined using a `BasicSli`, return that `BasicSli`. + FULL = 2; + + // For `ServiceLevelIndicator`s using `BasicSli` articulation, instead + // return the `ServiceLevelIndicator` with its mode of computation fully + // spelled out as a `RequestBasedSli`. For `ServiceLevelIndicator`s using + // `RequestBasedSli` or `WindowsBasedSli`, return the + // `ServiceLevelIndicator` as it was provided. + EXPLICIT = 1; + } + + // Resource name for this `ServiceLevelObjective`. + // Of the form + // `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. + string name = 1; + + // Name used for UI elements listing this SLO. + string display_name = 11; + + // The definition of good service, used to measure and calculate the quality + // of the `Service`'s performance with respect to a single aspect of service + // quality. + ServiceLevelIndicator service_level_indicator = 3; + + // The fraction of service that must be good in order for this objective to be + // met. `0 < goal <= 1`. + double goal = 4; + + // The time period over which the objective will be evaluated. + oneof period { + // A rolling time period, semantically "in the past ``". + // Must be an integer multiple of 1 day no larger than 30 days. + google.protobuf.Duration rolling_period = 5; + + // A calendar period, semantically "since the start of the current + // ``". At this time, only `DAY`, `WEEK`, `FORTNIGHT`, and + // `MONTH` are supported. + google.type.CalendarPeriod calendar_period = 6; + } +} + +// A Service-Level Indicator (SLI) describes the "performance" of a service. For +// some services, the SLI is well-defined. In such cases, the SLI can be +// described easily by referencing the well-known SLI and providing the needed +// parameters. Alternatively, a "custom" SLI can be defined with a query to the +// underlying metric store. An SLI is defined to be `good_service / +// total_service` over any queried time interval. The value of performance +// always falls into the range `0 <= performance <= 1`. A custom SLI describes +// how to compute this ratio, whether this is by dividing values from a pair of +// time series, cutting a `Distribution` into good and bad counts, or counting +// time windows in which the service complies with a criterion. For separation +// of concerns, a single Service-Level Indicator measures performance for only +// one aspect of service quality, such as fraction of successful queries or +// fast-enough queries. +message ServiceLevelIndicator { + // Service level indicators can be grouped by whether the "unit" of service + // being measured is based on counts of good requests or on counts of good + // time windows + oneof type { + // Basic SLI on a well-known service type. + BasicSli basic_sli = 4; + + // Request-based SLIs + RequestBasedSli request_based = 1; + + // Windows-based SLIs + WindowsBasedSli windows_based = 2; + } +} + +// An SLI measuring performance on a well-known service type. Performance will +// be computed on the basis of pre-defined metrics. The type of the +// `service_resource` determines the metrics to use and the +// `service_resource.labels` and `metric_labels` are used to construct a +// monitoring filter to filter that metric down to just the data relevant to +// this service. +message BasicSli { + // Future parameters for the availability SLI. + message AvailabilityCriteria { + + } + + // Parameters for a latency threshold SLI. + message LatencyCriteria { + // Good service is defined to be the count of requests made to this service + // that return in no more than `threshold`. + google.protobuf.Duration threshold = 3; + } + + // OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from + // other methods will not be used to calculate performance for this SLI. If + // omitted, this SLI applies to all the Service's methods. For service types + // that don't support breaking down by method, setting this field will result + // in an error. + repeated string method = 7; + + // OPTIONAL: The set of locations to which this SLI is relevant. Telemetry + // from other locations will not be used to calculate performance for this + // SLI. If omitted, this SLI applies to all locations in which the Service has + // activity. For service types that don't support breaking down by location, + // setting this field will result in an error. + repeated string location = 8; + + // OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry + // from other API versions will not be used to calculate performance for this + // SLI. If omitted, this SLI applies to all API versions. For service types + // that don't support breaking down by version, setting this field will result + // in an error. + repeated string version = 9; + + // This SLI can be evaluated on the basis of availability or latency. + oneof sli_criteria { + // Good service is defined to be the count of requests made to this service + // that return successfully. + AvailabilityCriteria availability = 2; + + // Good service is defined to be the count of requests made to this service + // that are fast enough with respect to `latency.threshold`. + LatencyCriteria latency = 3; + } +} + +// 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`. +message Range { + // Range minimum. + double min = 1; + + // Range maximum. + double max = 2; +} + +// Service Level Indicators for which atomic units of service are counted +// directly. +message RequestBasedSli { + // The means to compute a ratio of `good_service` to `total_service`. + oneof method { + // `good_total_ratio` is used when the ratio of `good_service` to + // `total_service` is computed from two `TimeSeries`. + TimeSeriesRatio good_total_ratio = 1; + + // `distribution_cut` is used when `good_service` is a count of values + // aggregated in a `Distribution` that fall into a good range. The + // `total_service` is the total count of all values aggregated in the + // `Distribution`. + DistributionCut distribution_cut = 3; + } +} + +// A `TimeSeriesRatio` specifies two `TimeSeries` to use for computing the +// `good_service / total_service` ratio. The specified `TimeSeries` must have +// `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = +// DELTA` or `MetricKind = CUMULATIVE`. The `TimeSeriesRatio` must specify +// exactly two of good, bad, and total, and the relationship `good_service + +// bad_service = total_service` will be assumed. +message TimeSeriesRatio { + // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + // specifying a `TimeSeries` quantifying good service provided. Must have + // `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = + // DELTA` or `MetricKind = CUMULATIVE`. + string good_service_filter = 4; + + // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + // specifying a `TimeSeries` quantifying bad service, either demanded service + // that was not provided or demanded service that was of inadequate quality. + // Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have + // `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. + string bad_service_filter = 5; + + // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + // specifying a `TimeSeries` quantifying total demanded service. Must have + // `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = + // DELTA` or `MetricKind = CUMULATIVE`. + string total_service_filter = 6; +} + +// A `DistributionCut` defines a `TimeSeries` and thresholds used 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`. +message DistributionCut { + // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + // specifying a `TimeSeries` aggregating values. Must have `ValueType = + // DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. + string distribution_filter = 4; + + // Range of values considered "good." For a one-sided range, set one bound to + // an infinite value. + Range range = 5; +} + +// A `WindowsBasedSli` defines `good_service` as the count of time windows for +// which the provided service was of good quality. Criteria for determining +// if service was good are embedded in the `window_criterion`. +message WindowsBasedSli { + // A `PerformanceThreshold` is used when each window is good when that window + // has a sufficiently high `performance`. + message PerformanceThreshold { + // The means, either a request-based SLI or a basic SLI, by which to compute + // performance over a window. + oneof type { + // `RequestBasedSli` to evaluate to judge window quality. + RequestBasedSli performance = 1; + + // `BasicSli` to evaluate to judge window quality. + BasicSli basic_sli_performance = 3; + } + + // If window `performance >= threshold`, the window is counted as good. + double threshold = 2; + } + + // 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`. + message MetricRange { + // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + // specifying the `TimeSeries` to use for evaluating window quality. + string time_series = 1; + + // Range of values considered "good." For a one-sided range, set one bound + // to an infinite value. + Range range = 4; + } + + // The criterion to use for evaluating window goodness. + oneof window_criterion { + // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + // specifying a `TimeSeries` with `ValueType = BOOL`. The window is good if + // any `true` values appear in the window. + string good_bad_metric_filter = 5; + + // A window is good if its `performance` is high enough. + PerformanceThreshold good_total_ratio_threshold = 2; + + // A window is good if the metric's value is in a good range, averaged + // across returned streams. + MetricRange metric_mean_in_range = 6; + + // A window is good if the metric's value is in a good range, summed across + // returned streams. + MetricRange metric_sum_in_range = 7; + } + + // Duration over which window quality is evaluated. Must be an integer + // fraction of a day and at least `60s`. + google.protobuf.Duration window_period = 4; +} diff --git a/monitoring/google/cloud/monitoring_v3/proto/service_pb2.py b/monitoring/google/cloud/monitoring_v3/proto/service_pb2.py new file mode 100644 index 000000000000..257a6dbc9e84 --- /dev/null +++ b/monitoring/google/cloud/monitoring_v3/proto/service_pb2.py @@ -0,0 +1,2068 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/monitoring_v3/proto/service.proto + +import sys + +_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import ( + monitored_resource_pb2 as google_dot_api_dot_monitored__resource__pb2, +) +from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from google.type import calendar_period_pb2 as google_dot_type_dot_calendar__period__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name="google/cloud/monitoring_v3/proto/service.proto", + package="google.monitoring.v3", + syntax="proto3", + serialized_options=_b( + "\n\030com.google.monitoring.v3B\026ServiceMonitoringProtoP\001Z>google.golang.org/genproto/googleapis/monitoring/v3;monitoring\252\002\032Google.Cloud.Monitoring.V3\312\002\032Google\\Cloud\\Monitoring\\V3" + ), + serialized_pb=_b( + '\n.google/cloud/monitoring_v3/proto/service.proto\x12\x14google.monitoring.v3\x1a#google/api/monitored_resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a!google/type/calendar_period.proto"\xd6\x04\n\x07Service\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x36\n\x06\x63ustom\x18\x06 \x01(\x0b\x32$.google.monitoring.v3.Service.CustomH\x00\x12=\n\napp_engine\x18\x07 \x01(\x0b\x32\'.google.monitoring.v3.Service.AppEngineH\x00\x12G\n\x0f\x63loud_endpoints\x18\x08 \x01(\x0b\x32,.google.monitoring.v3.Service.CloudEndpointsH\x00\x12\x43\n\rcluster_istio\x18\t \x01(\x0b\x32*.google.monitoring.v3.Service.ClusterIstioH\x00\x12:\n\ttelemetry\x18\r \x01(\x0b\x32\'.google.monitoring.v3.Service.Telemetry\x1a\x08\n\x06\x43ustom\x1a\x1e\n\tAppEngine\x12\x11\n\tmodule_id\x18\x01 \x01(\t\x1a!\n\x0e\x43loudEndpoints\x12\x0f\n\x07service\x18\x01 \x01(\t\x1ag\n\x0c\x43lusterIstio\x12\x10\n\x08location\x18\x01 \x01(\t\x12\x14\n\x0c\x63luster_name\x18\x02 \x01(\t\x12\x19\n\x11service_namespace\x18\x03 \x01(\t\x12\x14\n\x0cservice_name\x18\x04 \x01(\t\x1a"\n\tTelemetry\x12\x15\n\rresource_name\x18\x01 \x01(\tB\x0c\n\nidentifier"\xc4\x02\n\x15ServiceLevelObjective\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x0b \x01(\t\x12L\n\x17service_level_indicator\x18\x03 \x01(\x0b\x32+.google.monitoring.v3.ServiceLevelIndicator\x12\x0c\n\x04goal\x18\x04 \x01(\x01\x12\x33\n\x0erolling_period\x18\x05 \x01(\x0b\x32\x19.google.protobuf.DurationH\x00\x12\x36\n\x0f\x63\x61lendar_period\x18\x06 \x01(\x0e\x32\x1b.google.type.CalendarPeriodH\x00"4\n\x04View\x12\x14\n\x10VIEW_UNSPECIFIED\x10\x00\x12\x08\n\x04\x46ULL\x10\x02\x12\x0c\n\x08\x45XPLICIT\x10\x01\x42\x08\n\x06period"\xd4\x01\n\x15ServiceLevelIndicator\x12\x33\n\tbasic_sli\x18\x04 \x01(\x0b\x32\x1e.google.monitoring.v3.BasicSliH\x00\x12>\n\rrequest_based\x18\x01 \x01(\x0b\x32%.google.monitoring.v3.RequestBasedSliH\x00\x12>\n\rwindows_based\x18\x02 \x01(\x0b\x32%.google.monitoring.v3.WindowsBasedSliH\x00\x42\x06\n\x04type"\xb6\x02\n\x08\x42\x61sicSli\x12\x0e\n\x06method\x18\x07 \x03(\t\x12\x10\n\x08location\x18\x08 \x03(\t\x12\x0f\n\x07version\x18\t \x03(\t\x12K\n\x0c\x61vailability\x18\x02 \x01(\x0b\x32\x33.google.monitoring.v3.BasicSli.AvailabilityCriteriaH\x00\x12\x41\n\x07latency\x18\x03 \x01(\x0b\x32..google.monitoring.v3.BasicSli.LatencyCriteriaH\x00\x1a\x16\n\x14\x41vailabilityCriteria\x1a?\n\x0fLatencyCriteria\x12,\n\tthreshold\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x0e\n\x0csli_criteria"!\n\x05Range\x12\x0b\n\x03min\x18\x01 \x01(\x01\x12\x0b\n\x03max\x18\x02 \x01(\x01"\xa1\x01\n\x0fRequestBasedSli\x12\x41\n\x10good_total_ratio\x18\x01 \x01(\x0b\x32%.google.monitoring.v3.TimeSeriesRatioH\x00\x12\x41\n\x10\x64istribution_cut\x18\x03 \x01(\x0b\x32%.google.monitoring.v3.DistributionCutH\x00\x42\x08\n\x06method"h\n\x0fTimeSeriesRatio\x12\x1b\n\x13good_service_filter\x18\x04 \x01(\t\x12\x1a\n\x12\x62\x61\x64_service_filter\x18\x05 \x01(\t\x12\x1c\n\x14total_service_filter\x18\x06 \x01(\t"Z\n\x0f\x44istributionCut\x12\x1b\n\x13\x64istribution_filter\x18\x04 \x01(\t\x12*\n\x05range\x18\x05 \x01(\x0b\x32\x1b.google.monitoring.v3.Range"\x83\x05\n\x0fWindowsBasedSli\x12 \n\x16good_bad_metric_filter\x18\x05 \x01(\tH\x00\x12`\n\x1agood_total_ratio_threshold\x18\x02 \x01(\x0b\x32:.google.monitoring.v3.WindowsBasedSli.PerformanceThresholdH\x00\x12Q\n\x14metric_mean_in_range\x18\x06 \x01(\x0b\x32\x31.google.monitoring.v3.WindowsBasedSli.MetricRangeH\x00\x12P\n\x13metric_sum_in_range\x18\x07 \x01(\x0b\x32\x31.google.monitoring.v3.WindowsBasedSli.MetricRangeH\x00\x12\x30\n\rwindow_period\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a\xb0\x01\n\x14PerformanceThreshold\x12<\n\x0bperformance\x18\x01 \x01(\x0b\x32%.google.monitoring.v3.RequestBasedSliH\x00\x12?\n\x15\x62\x61sic_sli_performance\x18\x03 \x01(\x0b\x32\x1e.google.monitoring.v3.BasicSliH\x00\x12\x11\n\tthreshold\x18\x02 \x01(\x01\x42\x06\n\x04type\x1aN\n\x0bMetricRange\x12\x13\n\x0btime_series\x18\x01 \x01(\t\x12*\n\x05range\x18\x04 \x01(\x0b\x32\x1b.google.monitoring.v3.RangeB\x12\n\x10window_criterionB\xae\x01\n\x18\x63om.google.monitoring.v3B\x16ServiceMonitoringProtoP\x01Z>google.golang.org/genproto/googleapis/monitoring/v3;monitoring\xaa\x02\x1aGoogle.Cloud.Monitoring.V3\xca\x02\x1aGoogle\\Cloud\\Monitoring\\V3b\x06proto3' + ), + dependencies=[ + google_dot_api_dot_monitored__resource__pb2.DESCRIPTOR, + google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, + google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, + google_dot_type_dot_calendar__period__pb2.DESCRIPTOR, + ], +) + + +_SERVICELEVELOBJECTIVE_VIEW = _descriptor.EnumDescriptor( + name="View", + full_name="google.monitoring.v3.ServiceLevelObjective.View", + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name="VIEW_UNSPECIFIED", + index=0, + number=0, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="FULL", index=1, number=2, serialized_options=None, type=None + ), + _descriptor.EnumValueDescriptor( + name="EXPLICIT", index=2, number=1, serialized_options=None, type=None + ), + ], + containing_type=None, + serialized_options=None, + serialized_start=1073, + serialized_end=1125, +) +_sym_db.RegisterEnumDescriptor(_SERVICELEVELOBJECTIVE_VIEW) + + +_SERVICE_CUSTOM = _descriptor.Descriptor( + name="Custom", + full_name="google.monitoring.v3.Service.Custom", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=578, + serialized_end=586, +) + +_SERVICE_APPENGINE = _descriptor.Descriptor( + name="AppEngine", + full_name="google.monitoring.v3.Service.AppEngine", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="module_id", + full_name="google.monitoring.v3.Service.AppEngine.module_id", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=588, + serialized_end=618, +) + +_SERVICE_CLOUDENDPOINTS = _descriptor.Descriptor( + name="CloudEndpoints", + full_name="google.monitoring.v3.Service.CloudEndpoints", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="service", + full_name="google.monitoring.v3.Service.CloudEndpoints.service", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=620, + serialized_end=653, +) + +_SERVICE_CLUSTERISTIO = _descriptor.Descriptor( + name="ClusterIstio", + full_name="google.monitoring.v3.Service.ClusterIstio", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="location", + full_name="google.monitoring.v3.Service.ClusterIstio.location", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="cluster_name", + full_name="google.monitoring.v3.Service.ClusterIstio.cluster_name", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="service_namespace", + full_name="google.monitoring.v3.Service.ClusterIstio.service_namespace", + index=2, + number=3, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="service_name", + full_name="google.monitoring.v3.Service.ClusterIstio.service_name", + index=3, + number=4, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=655, + serialized_end=758, +) + +_SERVICE_TELEMETRY = _descriptor.Descriptor( + name="Telemetry", + full_name="google.monitoring.v3.Service.Telemetry", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="resource_name", + full_name="google.monitoring.v3.Service.Telemetry.resource_name", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=760, + serialized_end=794, +) + +_SERVICE = _descriptor.Descriptor( + name="Service", + full_name="google.monitoring.v3.Service", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.monitoring.v3.Service.name", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="display_name", + full_name="google.monitoring.v3.Service.display_name", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="custom", + full_name="google.monitoring.v3.Service.custom", + index=2, + number=6, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="app_engine", + full_name="google.monitoring.v3.Service.app_engine", + index=3, + number=7, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="cloud_endpoints", + full_name="google.monitoring.v3.Service.cloud_endpoints", + index=4, + number=8, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="cluster_istio", + full_name="google.monitoring.v3.Service.cluster_istio", + index=5, + number=9, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="telemetry", + full_name="google.monitoring.v3.Service.telemetry", + index=6, + number=13, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[ + _SERVICE_CUSTOM, + _SERVICE_APPENGINE, + _SERVICE_CLOUDENDPOINTS, + _SERVICE_CLUSTERISTIO, + _SERVICE_TELEMETRY, + ], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="identifier", + full_name="google.monitoring.v3.Service.identifier", + index=0, + containing_type=None, + fields=[], + ), + ], + serialized_start=210, + serialized_end=808, +) + + +_SERVICELEVELOBJECTIVE = _descriptor.Descriptor( + name="ServiceLevelObjective", + full_name="google.monitoring.v3.ServiceLevelObjective", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.monitoring.v3.ServiceLevelObjective.name", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="display_name", + full_name="google.monitoring.v3.ServiceLevelObjective.display_name", + index=1, + number=11, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="service_level_indicator", + full_name="google.monitoring.v3.ServiceLevelObjective.service_level_indicator", + index=2, + number=3, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="goal", + full_name="google.monitoring.v3.ServiceLevelObjective.goal", + index=3, + number=4, + type=1, + cpp_type=5, + label=1, + has_default_value=False, + default_value=float(0), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="rolling_period", + full_name="google.monitoring.v3.ServiceLevelObjective.rolling_period", + index=4, + number=5, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="calendar_period", + full_name="google.monitoring.v3.ServiceLevelObjective.calendar_period", + index=5, + number=6, + type=14, + cpp_type=8, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[_SERVICELEVELOBJECTIVE_VIEW,], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="period", + full_name="google.monitoring.v3.ServiceLevelObjective.period", + index=0, + containing_type=None, + fields=[], + ), + ], + serialized_start=811, + serialized_end=1135, +) + + +_SERVICELEVELINDICATOR = _descriptor.Descriptor( + name="ServiceLevelIndicator", + full_name="google.monitoring.v3.ServiceLevelIndicator", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="basic_sli", + full_name="google.monitoring.v3.ServiceLevelIndicator.basic_sli", + index=0, + number=4, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="request_based", + full_name="google.monitoring.v3.ServiceLevelIndicator.request_based", + index=1, + number=1, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="windows_based", + full_name="google.monitoring.v3.ServiceLevelIndicator.windows_based", + index=2, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="type", + full_name="google.monitoring.v3.ServiceLevelIndicator.type", + index=0, + containing_type=None, + fields=[], + ), + ], + serialized_start=1138, + serialized_end=1350, +) + + +_BASICSLI_AVAILABILITYCRITERIA = _descriptor.Descriptor( + name="AvailabilityCriteria", + full_name="google.monitoring.v3.BasicSli.AvailabilityCriteria", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1560, + serialized_end=1582, +) + +_BASICSLI_LATENCYCRITERIA = _descriptor.Descriptor( + name="LatencyCriteria", + full_name="google.monitoring.v3.BasicSli.LatencyCriteria", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="threshold", + full_name="google.monitoring.v3.BasicSli.LatencyCriteria.threshold", + index=0, + number=3, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1584, + serialized_end=1647, +) + +_BASICSLI = _descriptor.Descriptor( + name="BasicSli", + full_name="google.monitoring.v3.BasicSli", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="method", + full_name="google.monitoring.v3.BasicSli.method", + index=0, + number=7, + type=9, + cpp_type=9, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="location", + full_name="google.monitoring.v3.BasicSli.location", + index=1, + number=8, + type=9, + cpp_type=9, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="version", + full_name="google.monitoring.v3.BasicSli.version", + index=2, + number=9, + type=9, + cpp_type=9, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="availability", + full_name="google.monitoring.v3.BasicSli.availability", + index=3, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="latency", + full_name="google.monitoring.v3.BasicSli.latency", + index=4, + number=3, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[_BASICSLI_AVAILABILITYCRITERIA, _BASICSLI_LATENCYCRITERIA,], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="sli_criteria", + full_name="google.monitoring.v3.BasicSli.sli_criteria", + index=0, + containing_type=None, + fields=[], + ), + ], + serialized_start=1353, + serialized_end=1663, +) + + +_RANGE = _descriptor.Descriptor( + name="Range", + full_name="google.monitoring.v3.Range", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="min", + full_name="google.monitoring.v3.Range.min", + index=0, + number=1, + type=1, + cpp_type=5, + label=1, + has_default_value=False, + default_value=float(0), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="max", + full_name="google.monitoring.v3.Range.max", + index=1, + number=2, + type=1, + cpp_type=5, + label=1, + has_default_value=False, + default_value=float(0), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1665, + serialized_end=1698, +) + + +_REQUESTBASEDSLI = _descriptor.Descriptor( + name="RequestBasedSli", + full_name="google.monitoring.v3.RequestBasedSli", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="good_total_ratio", + full_name="google.monitoring.v3.RequestBasedSli.good_total_ratio", + index=0, + number=1, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="distribution_cut", + full_name="google.monitoring.v3.RequestBasedSli.distribution_cut", + index=1, + number=3, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="method", + full_name="google.monitoring.v3.RequestBasedSli.method", + index=0, + containing_type=None, + fields=[], + ), + ], + serialized_start=1701, + serialized_end=1862, +) + + +_TIMESERIESRATIO = _descriptor.Descriptor( + name="TimeSeriesRatio", + full_name="google.monitoring.v3.TimeSeriesRatio", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="good_service_filter", + full_name="google.monitoring.v3.TimeSeriesRatio.good_service_filter", + index=0, + number=4, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="bad_service_filter", + full_name="google.monitoring.v3.TimeSeriesRatio.bad_service_filter", + index=1, + number=5, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="total_service_filter", + full_name="google.monitoring.v3.TimeSeriesRatio.total_service_filter", + index=2, + number=6, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1864, + serialized_end=1968, +) + + +_DISTRIBUTIONCUT = _descriptor.Descriptor( + name="DistributionCut", + full_name="google.monitoring.v3.DistributionCut", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="distribution_filter", + full_name="google.monitoring.v3.DistributionCut.distribution_filter", + index=0, + number=4, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="range", + full_name="google.monitoring.v3.DistributionCut.range", + index=1, + number=5, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1970, + serialized_end=2060, +) + + +_WINDOWSBASEDSLI_PERFORMANCETHRESHOLD = _descriptor.Descriptor( + name="PerformanceThreshold", + full_name="google.monitoring.v3.WindowsBasedSli.PerformanceThreshold", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="performance", + full_name="google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.performance", + index=0, + number=1, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="basic_sli_performance", + full_name="google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.basic_sli_performance", + index=1, + number=3, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="threshold", + full_name="google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.threshold", + index=2, + number=2, + type=1, + cpp_type=5, + label=1, + has_default_value=False, + default_value=float(0), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="type", + full_name="google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.type", + index=0, + containing_type=None, + fields=[], + ), + ], + serialized_start=2430, + serialized_end=2606, +) + +_WINDOWSBASEDSLI_METRICRANGE = _descriptor.Descriptor( + name="MetricRange", + full_name="google.monitoring.v3.WindowsBasedSli.MetricRange", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="time_series", + full_name="google.monitoring.v3.WindowsBasedSli.MetricRange.time_series", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="range", + full_name="google.monitoring.v3.WindowsBasedSli.MetricRange.range", + index=1, + number=4, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=2608, + serialized_end=2686, +) + +_WINDOWSBASEDSLI = _descriptor.Descriptor( + name="WindowsBasedSli", + full_name="google.monitoring.v3.WindowsBasedSli", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="good_bad_metric_filter", + full_name="google.monitoring.v3.WindowsBasedSli.good_bad_metric_filter", + index=0, + number=5, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="good_total_ratio_threshold", + full_name="google.monitoring.v3.WindowsBasedSli.good_total_ratio_threshold", + index=1, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="metric_mean_in_range", + full_name="google.monitoring.v3.WindowsBasedSli.metric_mean_in_range", + index=2, + number=6, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="metric_sum_in_range", + full_name="google.monitoring.v3.WindowsBasedSli.metric_sum_in_range", + index=3, + number=7, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="window_period", + full_name="google.monitoring.v3.WindowsBasedSli.window_period", + index=4, + number=4, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[_WINDOWSBASEDSLI_PERFORMANCETHRESHOLD, _WINDOWSBASEDSLI_METRICRANGE,], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="window_criterion", + full_name="google.monitoring.v3.WindowsBasedSli.window_criterion", + index=0, + containing_type=None, + fields=[], + ), + ], + serialized_start=2063, + serialized_end=2706, +) + +_SERVICE_CUSTOM.containing_type = _SERVICE +_SERVICE_APPENGINE.containing_type = _SERVICE +_SERVICE_CLOUDENDPOINTS.containing_type = _SERVICE +_SERVICE_CLUSTERISTIO.containing_type = _SERVICE +_SERVICE_TELEMETRY.containing_type = _SERVICE +_SERVICE.fields_by_name["custom"].message_type = _SERVICE_CUSTOM +_SERVICE.fields_by_name["app_engine"].message_type = _SERVICE_APPENGINE +_SERVICE.fields_by_name["cloud_endpoints"].message_type = _SERVICE_CLOUDENDPOINTS +_SERVICE.fields_by_name["cluster_istio"].message_type = _SERVICE_CLUSTERISTIO +_SERVICE.fields_by_name["telemetry"].message_type = _SERVICE_TELEMETRY +_SERVICE.oneofs_by_name["identifier"].fields.append(_SERVICE.fields_by_name["custom"]) +_SERVICE.fields_by_name["custom"].containing_oneof = _SERVICE.oneofs_by_name[ + "identifier" +] +_SERVICE.oneofs_by_name["identifier"].fields.append( + _SERVICE.fields_by_name["app_engine"] +) +_SERVICE.fields_by_name["app_engine"].containing_oneof = _SERVICE.oneofs_by_name[ + "identifier" +] +_SERVICE.oneofs_by_name["identifier"].fields.append( + _SERVICE.fields_by_name["cloud_endpoints"] +) +_SERVICE.fields_by_name["cloud_endpoints"].containing_oneof = _SERVICE.oneofs_by_name[ + "identifier" +] +_SERVICE.oneofs_by_name["identifier"].fields.append( + _SERVICE.fields_by_name["cluster_istio"] +) +_SERVICE.fields_by_name["cluster_istio"].containing_oneof = _SERVICE.oneofs_by_name[ + "identifier" +] +_SERVICELEVELOBJECTIVE.fields_by_name[ + "service_level_indicator" +].message_type = _SERVICELEVELINDICATOR +_SERVICELEVELOBJECTIVE.fields_by_name[ + "rolling_period" +].message_type = google_dot_protobuf_dot_duration__pb2._DURATION +_SERVICELEVELOBJECTIVE.fields_by_name[ + "calendar_period" +].enum_type = google_dot_type_dot_calendar__period__pb2._CALENDARPERIOD +_SERVICELEVELOBJECTIVE_VIEW.containing_type = _SERVICELEVELOBJECTIVE +_SERVICELEVELOBJECTIVE.oneofs_by_name["period"].fields.append( + _SERVICELEVELOBJECTIVE.fields_by_name["rolling_period"] +) +_SERVICELEVELOBJECTIVE.fields_by_name[ + "rolling_period" +].containing_oneof = _SERVICELEVELOBJECTIVE.oneofs_by_name["period"] +_SERVICELEVELOBJECTIVE.oneofs_by_name["period"].fields.append( + _SERVICELEVELOBJECTIVE.fields_by_name["calendar_period"] +) +_SERVICELEVELOBJECTIVE.fields_by_name[ + "calendar_period" +].containing_oneof = _SERVICELEVELOBJECTIVE.oneofs_by_name["period"] +_SERVICELEVELINDICATOR.fields_by_name["basic_sli"].message_type = _BASICSLI +_SERVICELEVELINDICATOR.fields_by_name["request_based"].message_type = _REQUESTBASEDSLI +_SERVICELEVELINDICATOR.fields_by_name["windows_based"].message_type = _WINDOWSBASEDSLI +_SERVICELEVELINDICATOR.oneofs_by_name["type"].fields.append( + _SERVICELEVELINDICATOR.fields_by_name["basic_sli"] +) +_SERVICELEVELINDICATOR.fields_by_name[ + "basic_sli" +].containing_oneof = _SERVICELEVELINDICATOR.oneofs_by_name["type"] +_SERVICELEVELINDICATOR.oneofs_by_name["type"].fields.append( + _SERVICELEVELINDICATOR.fields_by_name["request_based"] +) +_SERVICELEVELINDICATOR.fields_by_name[ + "request_based" +].containing_oneof = _SERVICELEVELINDICATOR.oneofs_by_name["type"] +_SERVICELEVELINDICATOR.oneofs_by_name["type"].fields.append( + _SERVICELEVELINDICATOR.fields_by_name["windows_based"] +) +_SERVICELEVELINDICATOR.fields_by_name[ + "windows_based" +].containing_oneof = _SERVICELEVELINDICATOR.oneofs_by_name["type"] +_BASICSLI_AVAILABILITYCRITERIA.containing_type = _BASICSLI +_BASICSLI_LATENCYCRITERIA.fields_by_name[ + "threshold" +].message_type = google_dot_protobuf_dot_duration__pb2._DURATION +_BASICSLI_LATENCYCRITERIA.containing_type = _BASICSLI +_BASICSLI.fields_by_name["availability"].message_type = _BASICSLI_AVAILABILITYCRITERIA +_BASICSLI.fields_by_name["latency"].message_type = _BASICSLI_LATENCYCRITERIA +_BASICSLI.oneofs_by_name["sli_criteria"].fields.append( + _BASICSLI.fields_by_name["availability"] +) +_BASICSLI.fields_by_name["availability"].containing_oneof = _BASICSLI.oneofs_by_name[ + "sli_criteria" +] +_BASICSLI.oneofs_by_name["sli_criteria"].fields.append( + _BASICSLI.fields_by_name["latency"] +) +_BASICSLI.fields_by_name["latency"].containing_oneof = _BASICSLI.oneofs_by_name[ + "sli_criteria" +] +_REQUESTBASEDSLI.fields_by_name["good_total_ratio"].message_type = _TIMESERIESRATIO +_REQUESTBASEDSLI.fields_by_name["distribution_cut"].message_type = _DISTRIBUTIONCUT +_REQUESTBASEDSLI.oneofs_by_name["method"].fields.append( + _REQUESTBASEDSLI.fields_by_name["good_total_ratio"] +) +_REQUESTBASEDSLI.fields_by_name[ + "good_total_ratio" +].containing_oneof = _REQUESTBASEDSLI.oneofs_by_name["method"] +_REQUESTBASEDSLI.oneofs_by_name["method"].fields.append( + _REQUESTBASEDSLI.fields_by_name["distribution_cut"] +) +_REQUESTBASEDSLI.fields_by_name[ + "distribution_cut" +].containing_oneof = _REQUESTBASEDSLI.oneofs_by_name["method"] +_DISTRIBUTIONCUT.fields_by_name["range"].message_type = _RANGE +_WINDOWSBASEDSLI_PERFORMANCETHRESHOLD.fields_by_name[ + "performance" +].message_type = _REQUESTBASEDSLI +_WINDOWSBASEDSLI_PERFORMANCETHRESHOLD.fields_by_name[ + "basic_sli_performance" +].message_type = _BASICSLI +_WINDOWSBASEDSLI_PERFORMANCETHRESHOLD.containing_type = _WINDOWSBASEDSLI +_WINDOWSBASEDSLI_PERFORMANCETHRESHOLD.oneofs_by_name["type"].fields.append( + _WINDOWSBASEDSLI_PERFORMANCETHRESHOLD.fields_by_name["performance"] +) +_WINDOWSBASEDSLI_PERFORMANCETHRESHOLD.fields_by_name[ + "performance" +].containing_oneof = _WINDOWSBASEDSLI_PERFORMANCETHRESHOLD.oneofs_by_name["type"] +_WINDOWSBASEDSLI_PERFORMANCETHRESHOLD.oneofs_by_name["type"].fields.append( + _WINDOWSBASEDSLI_PERFORMANCETHRESHOLD.fields_by_name["basic_sli_performance"] +) +_WINDOWSBASEDSLI_PERFORMANCETHRESHOLD.fields_by_name[ + "basic_sli_performance" +].containing_oneof = _WINDOWSBASEDSLI_PERFORMANCETHRESHOLD.oneofs_by_name["type"] +_WINDOWSBASEDSLI_METRICRANGE.fields_by_name["range"].message_type = _RANGE +_WINDOWSBASEDSLI_METRICRANGE.containing_type = _WINDOWSBASEDSLI +_WINDOWSBASEDSLI.fields_by_name[ + "good_total_ratio_threshold" +].message_type = _WINDOWSBASEDSLI_PERFORMANCETHRESHOLD +_WINDOWSBASEDSLI.fields_by_name[ + "metric_mean_in_range" +].message_type = _WINDOWSBASEDSLI_METRICRANGE +_WINDOWSBASEDSLI.fields_by_name[ + "metric_sum_in_range" +].message_type = _WINDOWSBASEDSLI_METRICRANGE +_WINDOWSBASEDSLI.fields_by_name[ + "window_period" +].message_type = google_dot_protobuf_dot_duration__pb2._DURATION +_WINDOWSBASEDSLI.oneofs_by_name["window_criterion"].fields.append( + _WINDOWSBASEDSLI.fields_by_name["good_bad_metric_filter"] +) +_WINDOWSBASEDSLI.fields_by_name[ + "good_bad_metric_filter" +].containing_oneof = _WINDOWSBASEDSLI.oneofs_by_name["window_criterion"] +_WINDOWSBASEDSLI.oneofs_by_name["window_criterion"].fields.append( + _WINDOWSBASEDSLI.fields_by_name["good_total_ratio_threshold"] +) +_WINDOWSBASEDSLI.fields_by_name[ + "good_total_ratio_threshold" +].containing_oneof = _WINDOWSBASEDSLI.oneofs_by_name["window_criterion"] +_WINDOWSBASEDSLI.oneofs_by_name["window_criterion"].fields.append( + _WINDOWSBASEDSLI.fields_by_name["metric_mean_in_range"] +) +_WINDOWSBASEDSLI.fields_by_name[ + "metric_mean_in_range" +].containing_oneof = _WINDOWSBASEDSLI.oneofs_by_name["window_criterion"] +_WINDOWSBASEDSLI.oneofs_by_name["window_criterion"].fields.append( + _WINDOWSBASEDSLI.fields_by_name["metric_sum_in_range"] +) +_WINDOWSBASEDSLI.fields_by_name[ + "metric_sum_in_range" +].containing_oneof = _WINDOWSBASEDSLI.oneofs_by_name["window_criterion"] +DESCRIPTOR.message_types_by_name["Service"] = _SERVICE +DESCRIPTOR.message_types_by_name["ServiceLevelObjective"] = _SERVICELEVELOBJECTIVE +DESCRIPTOR.message_types_by_name["ServiceLevelIndicator"] = _SERVICELEVELINDICATOR +DESCRIPTOR.message_types_by_name["BasicSli"] = _BASICSLI +DESCRIPTOR.message_types_by_name["Range"] = _RANGE +DESCRIPTOR.message_types_by_name["RequestBasedSli"] = _REQUESTBASEDSLI +DESCRIPTOR.message_types_by_name["TimeSeriesRatio"] = _TIMESERIESRATIO +DESCRIPTOR.message_types_by_name["DistributionCut"] = _DISTRIBUTIONCUT +DESCRIPTOR.message_types_by_name["WindowsBasedSli"] = _WINDOWSBASEDSLI +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Service = _reflection.GeneratedProtocolMessageType( + "Service", + (_message.Message,), + dict( + Custom=_reflection.GeneratedProtocolMessageType( + "Custom", + (_message.Message,), + dict( + DESCRIPTOR=_SERVICE_CUSTOM, + __module__="google.cloud.monitoring_v3.proto.service_pb2", + __doc__="""Custom view of service telemetry. Currently a place-holder pending final + design. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.Service.Custom) + ), + ), + AppEngine=_reflection.GeneratedProtocolMessageType( + "AppEngine", + (_message.Message,), + dict( + DESCRIPTOR=_SERVICE_APPENGINE, + __module__="google.cloud.monitoring_v3.proto.service_pb2", + __doc__="""App Engine service. Learn more at https://cloud.google.com/appengine. + + + Attributes: + module_id: + The ID of the App Engine module underlying this service. + Corresponds to the ``module_id`` resource label in the + ``gae_app`` monitored resource: https://cloud.google.com/monit + oring/api/resources#tag\_gae\_app + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.Service.AppEngine) + ), + ), + CloudEndpoints=_reflection.GeneratedProtocolMessageType( + "CloudEndpoints", + (_message.Message,), + dict( + DESCRIPTOR=_SERVICE_CLOUDENDPOINTS, + __module__="google.cloud.monitoring_v3.proto.service_pb2", + __doc__="""Cloud Endpoints service. Learn more at + https://cloud.google.com/endpoints. + + + Attributes: + service: + The name of the Cloud Endpoints service underlying this + service. Corresponds to the ``service`` resource label in the + ``api`` monitored resource: + https://cloud.google.com/monitoring/api/resources#tag\_api + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.Service.CloudEndpoints) + ), + ), + ClusterIstio=_reflection.GeneratedProtocolMessageType( + "ClusterIstio", + (_message.Message,), + dict( + DESCRIPTOR=_SERVICE_CLUSTERISTIO, + __module__="google.cloud.monitoring_v3.proto.service_pb2", + __doc__="""Istio service. Learn more at http://istio.io. + + + Attributes: + location: + The location of the Kubernetes cluster in which this Istio + service is defined. Corresponds to the ``location`` resource + label in ``k8s_cluster`` resources. + cluster_name: + The name of the Kubernetes cluster in which this Istio service + is defined. Corresponds to the ``cluster_name`` resource label + in ``k8s_cluster`` resources. + service_namespace: + The namespace of the Istio service underlying this service. + Corresponds to the ``destination_service_namespace`` metric + label in Istio metrics. + service_name: + The name of the Istio service underlying this service. + Corresponds to the ``destination_service_name`` metric label + in Istio metrics. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.Service.ClusterIstio) + ), + ), + Telemetry=_reflection.GeneratedProtocolMessageType( + "Telemetry", + (_message.Message,), + dict( + DESCRIPTOR=_SERVICE_TELEMETRY, + __module__="google.cloud.monitoring_v3.proto.service_pb2", + __doc__="""Configuration for how to query telemetry on a Service. + + + Attributes: + resource_name: + The full name of the resource that defines this service. + Formatted as described in + https://cloud.google.com/apis/design/resource\_names. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.Service.Telemetry) + ), + ), + DESCRIPTOR=_SERVICE, + __module__="google.cloud.monitoring_v3.proto.service_pb2", + __doc__="""A ``Service`` is a discrete, autonomous, and network-accessible unit, + designed to solve an individual concern + (`Wikipedia `__). In + Stackdriver Monitoring, a ``Service`` acts as the root resource under + which operational aspects of the service are accessible. + + + Attributes: + name: + Resource name for this Service. Of the form + ``projects/{project_id}/services/{service_id}``. + display_name: + Name used for UI elements listing this Service. + identifier: + REQUIRED. Service-identifying atoms specifying the underlying + service. + custom: + Custom service type. + app_engine: + Type used for App Engine services. + cloud_endpoints: + Type used for Cloud Endpoints services. + cluster_istio: + Type used for Istio services that live in a Kubernetes + cluster. + telemetry: + Configuration for how to query telemetry on a Service. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.Service) + ), +) +_sym_db.RegisterMessage(Service) +_sym_db.RegisterMessage(Service.Custom) +_sym_db.RegisterMessage(Service.AppEngine) +_sym_db.RegisterMessage(Service.CloudEndpoints) +_sym_db.RegisterMessage(Service.ClusterIstio) +_sym_db.RegisterMessage(Service.Telemetry) + +ServiceLevelObjective = _reflection.GeneratedProtocolMessageType( + "ServiceLevelObjective", + (_message.Message,), + dict( + DESCRIPTOR=_SERVICELEVELOBJECTIVE, + __module__="google.cloud.monitoring_v3.proto.service_pb2", + __doc__="""A Service-Level Objective (SLO) describes a level of desired good + service. It consists of a service-level indicator (SLI), a performance + goal, and a period over which the objective is to be evaluated against + that goal. The SLO can use SLIs defined in a number of different + manners. Typical SLOs might include "99% of requests in each rolling + week have latency below 200 milliseconds" or "99.5% of requests in each + calendar month return successfully." + + + Attributes: + name: + Resource name for this ``ServiceLevelObjective``. Of the form + ``projects/{project_id}/services/{service_id}/serviceLevelObje + ctives/{slo_name}``. + display_name: + Name used for UI elements listing this SLO. + service_level_indicator: + The definition of good service, used to measure and calculate + the quality of the ``Service``'s performance with respect to a + single aspect of service quality. + goal: + The fraction of service that must be good in order for this + objective to be met. ``0 < goal <= 1``. + period: + The time period over which the objective will be evaluated. + rolling_period: + A rolling time period, semantically "in the past + ````". Must be an integer multiple of 1 day no + larger than 30 days. + calendar_period: + A calendar period, semantically "since the start of the + current ````". At this time, only ``DAY``, + ``WEEK``, ``FORTNIGHT``, and ``MONTH`` are supported. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.ServiceLevelObjective) + ), +) +_sym_db.RegisterMessage(ServiceLevelObjective) + +ServiceLevelIndicator = _reflection.GeneratedProtocolMessageType( + "ServiceLevelIndicator", + (_message.Message,), + dict( + DESCRIPTOR=_SERVICELEVELINDICATOR, + __module__="google.cloud.monitoring_v3.proto.service_pb2", + __doc__="""A Service-Level Indicator (SLI) describes the "performance" of a + service. For some services, the SLI is well-defined. In such cases, the + SLI can be described easily by referencing the well-known SLI and + providing the needed parameters. Alternatively, a "custom" SLI can be + defined with a query to the underlying metric store. An SLI is defined + to be ``good_service / total_service`` over any queried time interval. + The value of performance always falls into the range + ``0 <= performance <= 1``. A custom SLI describes how to compute this + ratio, whether this is by dividing values from a pair of time series, + cutting a ``Distribution`` into good and bad counts, or counting time + windows in which the service complies with a criterion. For separation + of concerns, a single Service-Level Indicator measures performance for + only one aspect of service quality, such as fraction of successful + queries or fast-enough queries. + + + Attributes: + type: + Service level indicators can be grouped by whether the "unit" + of service being measured is based on counts of good requests + or on counts of good time windows + basic_sli: + Basic SLI on a well-known service type. + request_based: + Request-based SLIs + windows_based: + Windows-based SLIs + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.ServiceLevelIndicator) + ), +) +_sym_db.RegisterMessage(ServiceLevelIndicator) + +BasicSli = _reflection.GeneratedProtocolMessageType( + "BasicSli", + (_message.Message,), + dict( + AvailabilityCriteria=_reflection.GeneratedProtocolMessageType( + "AvailabilityCriteria", + (_message.Message,), + dict( + DESCRIPTOR=_BASICSLI_AVAILABILITYCRITERIA, + __module__="google.cloud.monitoring_v3.proto.service_pb2", + __doc__="""Future parameters for the availability SLI. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.BasicSli.AvailabilityCriteria) + ), + ), + LatencyCriteria=_reflection.GeneratedProtocolMessageType( + "LatencyCriteria", + (_message.Message,), + dict( + DESCRIPTOR=_BASICSLI_LATENCYCRITERIA, + __module__="google.cloud.monitoring_v3.proto.service_pb2", + __doc__="""Parameters for a latency threshold SLI. + + + Attributes: + threshold: + Good service is defined to be the count of requests made to + this service that return in no more than ``threshold``. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.BasicSli.LatencyCriteria) + ), + ), + DESCRIPTOR=_BASICSLI, + __module__="google.cloud.monitoring_v3.proto.service_pb2", + __doc__="""An SLI measuring performance on a well-known service type. Performance + will be computed on the basis of pre-defined metrics. The type of the + ``service_resource`` determines the metrics to use and the + ``service_resource.labels`` and ``metric_labels`` are used to construct + a monitoring filter to filter that metric down to just the data relevant + to this service. + + + Attributes: + method: + OPTIONAL: The set of RPCs to which this SLI is relevant. + Telemetry from other methods will not be used to calculate + performance for this SLI. If omitted, this SLI applies to all + the Service's methods. For service types that don't support + breaking down by method, setting this field will result in an + error. + location: + OPTIONAL: The set of locations to which this SLI is relevant. + Telemetry from other locations will not be used to calculate + performance for this SLI. If omitted, this SLI applies to all + locations in which the Service has activity. For service types + that don't support breaking down by location, setting this + field will result in an error. + version: + OPTIONAL: The set of API versions to which this SLI is + relevant. Telemetry from other API versions will not be used + to calculate performance for this SLI. If omitted, this SLI + applies to all API versions. For service types that don't + support breaking down by version, setting this field will + result in an error. + sli_criteria: + This SLI can be evaluated on the basis of availability or + latency. + availability: + Good service is defined to be the count of requests made to + this service that return successfully. + latency: + Good service is defined to be the count of requests made to + this service that are fast enough with respect to + ``latency.threshold``. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.BasicSli) + ), +) +_sym_db.RegisterMessage(BasicSli) +_sym_db.RegisterMessage(BasicSli.AvailabilityCriteria) +_sym_db.RegisterMessage(BasicSli.LatencyCriteria) + +Range = _reflection.GeneratedProtocolMessageType( + "Range", + (_message.Message,), + dict( + DESCRIPTOR=_RANGE, + __module__="google.cloud.monitoring_v3.proto.service_pb2", + __doc__="""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``. + + + Attributes: + min: + Range minimum. + max: + Range maximum. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.Range) + ), +) +_sym_db.RegisterMessage(Range) + +RequestBasedSli = _reflection.GeneratedProtocolMessageType( + "RequestBasedSli", + (_message.Message,), + dict( + DESCRIPTOR=_REQUESTBASEDSLI, + __module__="google.cloud.monitoring_v3.proto.service_pb2", + __doc__="""Service Level Indicators for which atomic units of service are counted + directly. + + + Attributes: + method: + The means to compute a ratio of ``good_service`` to + ``total_service``. + good_total_ratio: + ``good_total_ratio`` is used when the ratio of + ``good_service`` to ``total_service`` is computed from two + ``TimeSeries``. + distribution_cut: + ``distribution_cut`` is used when ``good_service`` is a count + of values aggregated in a ``Distribution`` that fall into a + good range. The ``total_service`` is the total count of all + values aggregated in the ``Distribution``. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.RequestBasedSli) + ), +) +_sym_db.RegisterMessage(RequestBasedSli) + +TimeSeriesRatio = _reflection.GeneratedProtocolMessageType( + "TimeSeriesRatio", + (_message.Message,), + dict( + DESCRIPTOR=_TIMESERIESRATIO, + __module__="google.cloud.monitoring_v3.proto.service_pb2", + __doc__="""A ``TimeSeriesRatio`` specifies two ``TimeSeries`` to use for computing + the ``good_service / total_service`` ratio. The specified ``TimeSeries`` + must have ``ValueType = DOUBLE`` or ``ValueType = INT64`` and must have + ``MetricKind = DELTA`` or ``MetricKind = CUMULATIVE``. The + ``TimeSeriesRatio`` must specify exactly two of good, bad, and total, + and the relationship ``good_service + bad_service = total_service`` will + be assumed. + + + Attributes: + good_service_filter: + A `monitoring filter + `__ + specifying a ``TimeSeries`` quantifying good service provided. + Must have ``ValueType = DOUBLE`` or ``ValueType = INT64`` and + must have ``MetricKind = DELTA`` or ``MetricKind = + CUMULATIVE``. + bad_service_filter: + A `monitoring filter + `__ + specifying a ``TimeSeries`` quantifying bad service, either + demanded service that was not provided or demanded service + that was of inadequate quality. Must have ``ValueType = + DOUBLE`` or ``ValueType = INT64`` and must have ``MetricKind = + DELTA`` or ``MetricKind = CUMULATIVE``. + total_service_filter: + A `monitoring filter + `__ + specifying a ``TimeSeries`` quantifying total demanded + service. Must have ``ValueType = DOUBLE`` or ``ValueType = + INT64`` and must have ``MetricKind = DELTA`` or ``MetricKind = + CUMULATIVE``. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.TimeSeriesRatio) + ), +) +_sym_db.RegisterMessage(TimeSeriesRatio) + +DistributionCut = _reflection.GeneratedProtocolMessageType( + "DistributionCut", + (_message.Message,), + dict( + DESCRIPTOR=_DISTRIBUTIONCUT, + __module__="google.cloud.monitoring_v3.proto.service_pb2", + __doc__="""A ``DistributionCut`` defines a ``TimeSeries`` and thresholds used 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``. + + + Attributes: + distribution_filter: + A `monitoring filter + `__ + specifying a ``TimeSeries`` aggregating values. Must have + ``ValueType = DISTRIBUTION`` and ``MetricKind = DELTA`` or + ``MetricKind = CUMULATIVE``. + range: + Range of values considered "good." For a one-sided range, set + one bound to an infinite value. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.DistributionCut) + ), +) +_sym_db.RegisterMessage(DistributionCut) + +WindowsBasedSli = _reflection.GeneratedProtocolMessageType( + "WindowsBasedSli", + (_message.Message,), + dict( + PerformanceThreshold=_reflection.GeneratedProtocolMessageType( + "PerformanceThreshold", + (_message.Message,), + dict( + DESCRIPTOR=_WINDOWSBASEDSLI_PERFORMANCETHRESHOLD, + __module__="google.cloud.monitoring_v3.proto.service_pb2", + __doc__="""A ``PerformanceThreshold`` is used when each window is good when that + window has a sufficiently high ``performance``. + + + Attributes: + type: + The means, either a request-based SLI or a basic SLI, by which + to compute performance over a window. + performance: + ``RequestBasedSli`` to evaluate to judge window quality. + basic_sli_performance: + ``BasicSli`` to evaluate to judge window quality. + threshold: + If window ``performance >= threshold``, the window is counted + as good. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.WindowsBasedSli.PerformanceThreshold) + ), + ), + MetricRange=_reflection.GeneratedProtocolMessageType( + "MetricRange", + (_message.Message,), + dict( + DESCRIPTOR=_WINDOWSBASEDSLI_METRICRANGE, + __module__="google.cloud.monitoring_v3.proto.service_pb2", + __doc__="""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``. + + + Attributes: + time_series: + A `monitoring filter + `__ + specifying the ``TimeSeries`` to use for evaluating window + quality. + range: + Range of values considered "good." For a one-sided range, set + one bound to an infinite value. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.WindowsBasedSli.MetricRange) + ), + ), + DESCRIPTOR=_WINDOWSBASEDSLI, + __module__="google.cloud.monitoring_v3.proto.service_pb2", + __doc__="""A ``WindowsBasedSli`` defines ``good_service`` as the count of time + windows for which the provided service was of good quality. Criteria for + determining if service was good are embedded in the + ``window_criterion``. + + + Attributes: + window_criterion: + The criterion to use for evaluating window goodness. + good_bad_metric_filter: + A `monitoring filter + `__ + specifying a ``TimeSeries`` with ``ValueType = BOOL``. The + window is good if any ``true`` values appear in the window. + good_total_ratio_threshold: + A window is good if its ``performance`` is high enough. + metric_mean_in_range: + A window is good if the metric's value is in a good range, + averaged across returned streams. + metric_sum_in_range: + A window is good if the metric's value is in a good range, + summed across returned streams. + window_period: + Duration over which window quality is evaluated. Must be an + integer fraction of a day and at least ``60s``. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.WindowsBasedSli) + ), +) +_sym_db.RegisterMessage(WindowsBasedSli) +_sym_db.RegisterMessage(WindowsBasedSli.PerformanceThreshold) +_sym_db.RegisterMessage(WindowsBasedSli.MetricRange) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/monitoring/google/cloud/monitoring_v3/proto/service_pb2_grpc.py b/monitoring/google/cloud/monitoring_v3/proto/service_pb2_grpc.py new file mode 100644 index 000000000000..07cb78fe03a9 --- /dev/null +++ b/monitoring/google/cloud/monitoring_v3/proto/service_pb2_grpc.py @@ -0,0 +1,2 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc diff --git a/monitoring/google/cloud/monitoring_v3/proto/service_service.proto b/monitoring/google/cloud/monitoring_v3/proto/service_service.proto new file mode 100644 index 000000000000..e0a35833e5b8 --- /dev/null +++ b/monitoring/google/cloud/monitoring_v3/proto/service_service.proto @@ -0,0 +1,285 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.monitoring.v3; + +import "google/api/annotations.proto"; +import "google/api/monitored_resource.proto"; +import "google/monitoring/v3/service.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/api/client.proto"; + +option csharp_namespace = "Google.Cloud.Monitoring.V3"; +option go_package = "google.golang.org/genproto/googleapis/monitoring/v3;monitoring"; +option java_multiple_files = true; +option java_outer_classname = "ServiceMonitoringServiceProto"; +option java_package = "com.google.monitoring.v3"; +option php_namespace = "Google\\Cloud\\Monitoring\\V3"; + +// The Stackdriver Monitoring Service-Oriented Monitoring API has endpoints for +// managing and querying aspects of a workspace's services. These include the +// `Service`'s monitored resources, its Service-Level Objectives, and a taxonomy +// of categorized Health Metrics. +service ServiceMonitoringService { + option (google.api.default_host) = "monitoring.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/monitoring," + "https://www.googleapis.com/auth/monitoring.read"; + + // Create a `Service`. + rpc CreateService(CreateServiceRequest) returns (Service) { + option (google.api.http) = { + post: "/v3/{parent=*/*}/services" + body: "service" + }; + } + + // Get the named `Service`. + rpc GetService(GetServiceRequest) returns (Service) { + option (google.api.http) = { + get: "/v3/{name=*/*/services/*}" + }; + } + + // List `Service`s for this workspace. + rpc ListServices(ListServicesRequest) returns (ListServicesResponse) { + option (google.api.http) = { + get: "/v3/{parent=*/*}/services" + }; + } + + // Update this `Service`. + rpc UpdateService(UpdateServiceRequest) returns (Service) { + option (google.api.http) = { + patch: "/v3/{service.name=*/*/services/*}" + body: "service" + }; + } + + // Soft delete this `Service`. + rpc DeleteService(DeleteServiceRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3/{name=*/*/services/*}" + }; + } + + // Create a `ServiceLevelObjective` for the given `Service`. + rpc CreateServiceLevelObjective(CreateServiceLevelObjectiveRequest) returns (ServiceLevelObjective) { + option (google.api.http) = { + post: "/v3/{parent=*/*/services/*}/serviceLevelObjectives" + body: "service_level_objective" + }; + } + + // Get a `ServiceLevelObjective` by name. + rpc GetServiceLevelObjective(GetServiceLevelObjectiveRequest) returns (ServiceLevelObjective) { + option (google.api.http) = { + get: "/v3/{name=*/*/services/*/serviceLevelObjectives/*}" + }; + } + + // List the `ServiceLevelObjective`s for the given `Service`. + rpc ListServiceLevelObjectives(ListServiceLevelObjectivesRequest) returns (ListServiceLevelObjectivesResponse) { + option (google.api.http) = { + get: "/v3/{parent=*/*/services/*}/serviceLevelObjectives" + }; + } + + // Update the given `ServiceLevelObjective`. + rpc UpdateServiceLevelObjective(UpdateServiceLevelObjectiveRequest) returns (ServiceLevelObjective) { + option (google.api.http) = { + patch: "/v3/{service_level_objective.name=*/*/services/*/serviceLevelObjectives/*}" + body: "service_level_objective" + }; + } + + // Delete the given `ServiceLevelObjective`. + rpc DeleteServiceLevelObjective(DeleteServiceLevelObjectiveRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3/{name=*/*/services/*/serviceLevelObjectives/*}" + }; + } +} + +// The `CreateService` request. +message CreateServiceRequest { + // Resource name of the parent workspace. + // Of the form `projects/{project_id}`. + string parent = 1; + + // Optional. The Service id to use for this Service. If omitted, an id will be + // generated instead. Must match the pattern [a-z0-9\-]+ + string service_id = 3; + + // The `Service` to create. + Service service = 2; +} + +// The `GetService` request. +message GetServiceRequest { + // Resource name of the `Service`. + // Of the form `projects/{project_id}/services/{service_id}`. + string name = 1; +} + +// The `ListServices` request. +message ListServicesRequest { + // Resource name of the parent `Workspace`. + // Of the form `projects/{project_id}`. + string parent = 1; + + // A filter specifying what `Service`s to return. The filter currently + // supports the following fields: + // + // - `identifier_case` + // - `app_engine.module_id` + // - `cloud_endpoints.service` + // - `cluster_istio.location` + // - `cluster_istio.cluster_name` + // - `cluster_istio.service_namespace` + // - `cluster_istio.service_name` + // + // `identifier_case` refers to which option in the identifier oneof is + // populated. For example, the filter `identifier_case = "CUSTOM"` would match + // all services with a value for the `custom` field. Valid options are + // "CUSTOM", "APP_ENGINE", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". + string filter = 2; + + // A non-negative number that is the maximum number of results to return. + // When 0, use default page size. + int32 page_size = 3; + + // If this field is not empty then it must contain the `nextPageToken` value + // returned by a previous call to this method. Using this field causes the + // method to return additional results from the previous method call. + string page_token = 4; +} + +// The `ListServices` response. +message ListServicesResponse { + // The `Service`s matching the specified filter. + repeated Service services = 1; + + // If there are more results than have been returned, then this field is set + // to a non-empty value. To see the additional results, + // use that value as `pageToken` in the next call to this method. + string next_page_token = 2; +} + +// The `UpdateService` request. +message UpdateServiceRequest { + // The `Service` to draw updates from. + // The given `name` specifies the resource to update. + Service service = 1; + + // A set of field paths defining which fields to use for the update. + google.protobuf.FieldMask update_mask = 2; +} + +// The `DeleteService` request. +message DeleteServiceRequest { + // Resource name of the `Service` to delete. + // Of the form `projects/{project_id}/service/{service_id}`. + string name = 1; +} + +// The `CreateServiceLevelObjective` request. +message CreateServiceLevelObjectiveRequest { + // Resource name of the parent `Service`. + // Of the form `projects/{project_id}/services/{service_id}`. + string parent = 1; + + // Optional. The ServiceLevelObjective id to use for this + // ServiceLevelObjective. If omitted, an id will be generated instead. Must + // match the pattern [a-z0-9\-]+ + string service_level_objective_id = 3; + + // The `ServiceLevelObjective` to create. + // The provided `name` will be respected if no `ServiceLevelObjective` exists + // with this name. + ServiceLevelObjective service_level_objective = 2; +} + +// The `GetServiceLevelObjective` request. +message GetServiceLevelObjectiveRequest { + // Resource name of the `ServiceLevelObjective` to get. + // Of the form + // `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. + string name = 1; + + // View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the + // `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + // `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + // `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + ServiceLevelObjective.View view = 2; +} + +// The `ListServiceLevelObjectives` request. +message ListServiceLevelObjectivesRequest { + // Resource name of the parent `Service`. + // Of the form `projects/{project_id}/services/{service_id}`. + string parent = 1; + + // A filter specifying what `ServiceLevelObjective`s to return. + string filter = 2; + + // A non-negative number that is the maximum number of results to return. + // When 0, use default page size. + int32 page_size = 3; + + // If this field is not empty then it must contain the `nextPageToken` value + // returned by a previous call to this method. Using this field causes the + // method to return additional results from the previous method call. + string page_token = 4; + + // View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each + // `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + // `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + // `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + ServiceLevelObjective.View view = 5; +} + +// The `ListServiceLevelObjectives` response. +message ListServiceLevelObjectivesResponse { + // The `ServiceLevelObjective`s matching the specified filter. + repeated ServiceLevelObjective service_level_objectives = 1; + + // If there are more results than have been returned, then this field is set + // to a non-empty value. To see the additional results, + // use that value as `pageToken` in the next call to this method. + string next_page_token = 2; +} + +// The `UpdateServiceLevelObjective` request. +message UpdateServiceLevelObjectiveRequest { + // The `ServiceLevelObjective` to draw updates from. + // The given `name` specifies the resource to update. + ServiceLevelObjective service_level_objective = 1; + + // A set of field paths defining which fields to use for the update. + google.protobuf.FieldMask update_mask = 2; +} + +// The `DeleteServiceLevelObjective` request. +message DeleteServiceLevelObjectiveRequest { + // Resource name of the `ServiceLevelObjective` to delete. + // Of the form + // `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. + string name = 1; +} diff --git a/monitoring/google/cloud/monitoring_v3/proto/service_service_pb2.py b/monitoring/google/cloud/monitoring_v3/proto/service_service_pb2.py new file mode 100644 index 000000000000..b69435e080e3 --- /dev/null +++ b/monitoring/google/cloud/monitoring_v3/proto/service_service_pb2.py @@ -0,0 +1,1307 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/monitoring_v3/proto/service_service.proto + +import sys + +_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import ( + monitored_resource_pb2 as google_dot_api_dot_monitored__resource__pb2, +) +from google.cloud.monitoring_v3.proto import ( + service_pb2 as google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2, +) +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 +from google.api import client_pb2 as google_dot_api_dot_client__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name="google/cloud/monitoring_v3/proto/service_service.proto", + package="google.monitoring.v3", + syntax="proto3", + serialized_options=_b( + "\n\030com.google.monitoring.v3B\035ServiceMonitoringServiceProtoP\001Z>google.golang.org/genproto/googleapis/monitoring/v3;monitoring\252\002\032Google.Cloud.Monitoring.V3\312\002\032Google\\Cloud\\Monitoring\\V3" + ), + serialized_pb=_b( + '\n6google/cloud/monitoring_v3/proto/service_service.proto\x12\x14google.monitoring.v3\x1a\x1cgoogle/api/annotations.proto\x1a#google/api/monitored_resource.proto\x1a.google/cloud/monitoring_v3/proto/service.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/api/client.proto"j\n\x14\x43reateServiceRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x12\n\nservice_id\x18\x03 \x01(\t\x12.\n\x07service\x18\x02 \x01(\x0b\x32\x1d.google.monitoring.v3.Service"!\n\x11GetServiceRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"\\\n\x13ListServicesRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t"`\n\x14ListServicesResponse\x12/\n\x08services\x18\x01 \x03(\x0b\x32\x1d.google.monitoring.v3.Service\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"w\n\x14UpdateServiceRequest\x12.\n\x07service\x18\x01 \x01(\x0b\x32\x1d.google.monitoring.v3.Service\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"$\n\x14\x44\x65leteServiceRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"\xa6\x01\n"CreateServiceLevelObjectiveRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12"\n\x1aservice_level_objective_id\x18\x03 \x01(\t\x12L\n\x17service_level_objective\x18\x02 \x01(\x0b\x32+.google.monitoring.v3.ServiceLevelObjective"o\n\x1fGetServiceLevelObjectiveRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12>\n\x04view\x18\x02 \x01(\x0e\x32\x30.google.monitoring.v3.ServiceLevelObjective.View"\xaa\x01\n!ListServiceLevelObjectivesRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12>\n\x04view\x18\x05 \x01(\x0e\x32\x30.google.monitoring.v3.ServiceLevelObjective.View"\x8c\x01\n"ListServiceLevelObjectivesResponse\x12M\n\x18service_level_objectives\x18\x01 \x03(\x0b\x32+.google.monitoring.v3.ServiceLevelObjective\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\xa3\x01\n"UpdateServiceLevelObjectiveRequest\x12L\n\x17service_level_objective\x18\x01 \x01(\x0b\x32+.google.monitoring.v3.ServiceLevelObjective\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"2\n"DeleteServiceLevelObjectiveRequest\x12\x0c\n\x04name\x18\x01 \x01(\t2\xe5\x0e\n\x18ServiceMonitoringService\x12\x86\x01\n\rCreateService\x12*.google.monitoring.v3.CreateServiceRequest\x1a\x1d.google.monitoring.v3.Service"*\x82\xd3\xe4\x93\x02$"\x19/v3/{parent=*/*}/services:\x07service\x12w\n\nGetService\x12\'.google.monitoring.v3.GetServiceRequest\x1a\x1d.google.monitoring.v3.Service"!\x82\xd3\xe4\x93\x02\x1b\x12\x19/v3/{name=*/*/services/*}\x12\x88\x01\n\x0cListServices\x12).google.monitoring.v3.ListServicesRequest\x1a*.google.monitoring.v3.ListServicesResponse"!\x82\xd3\xe4\x93\x02\x1b\x12\x19/v3/{parent=*/*}/services\x12\x8e\x01\n\rUpdateService\x12*.google.monitoring.v3.UpdateServiceRequest\x1a\x1d.google.monitoring.v3.Service"2\x82\xd3\xe4\x93\x02,2!/v3/{service.name=*/*/services/*}:\x07service\x12v\n\rDeleteService\x12*.google.monitoring.v3.DeleteServiceRequest\x1a\x16.google.protobuf.Empty"!\x82\xd3\xe4\x93\x02\x1b*\x19/v3/{name=*/*/services/*}\x12\xd9\x01\n\x1b\x43reateServiceLevelObjective\x12\x38.google.monitoring.v3.CreateServiceLevelObjectiveRequest\x1a+.google.monitoring.v3.ServiceLevelObjective"S\x82\xd3\xe4\x93\x02M"2/v3/{parent=*/*/services/*}/serviceLevelObjectives:\x17service_level_objective\x12\xba\x01\n\x18GetServiceLevelObjective\x12\x35.google.monitoring.v3.GetServiceLevelObjectiveRequest\x1a+.google.monitoring.v3.ServiceLevelObjective":\x82\xd3\xe4\x93\x02\x34\x12\x32/v3/{name=*/*/services/*/serviceLevelObjectives/*}\x12\xcb\x01\n\x1aListServiceLevelObjectives\x12\x37.google.monitoring.v3.ListServiceLevelObjectivesRequest\x1a\x38.google.monitoring.v3.ListServiceLevelObjectivesResponse":\x82\xd3\xe4\x93\x02\x34\x12\x32/v3/{parent=*/*/services/*}/serviceLevelObjectives\x12\xf1\x01\n\x1bUpdateServiceLevelObjective\x12\x38.google.monitoring.v3.UpdateServiceLevelObjectiveRequest\x1a+.google.monitoring.v3.ServiceLevelObjective"k\x82\xd3\xe4\x93\x02\x65\x32J/v3/{service_level_objective.name=*/*/services/*/serviceLevelObjectives/*}:\x17service_level_objective\x12\xab\x01\n\x1b\x44\x65leteServiceLevelObjective\x12\x38.google.monitoring.v3.DeleteServiceLevelObjectiveRequest\x1a\x16.google.protobuf.Empty":\x82\xd3\xe4\x93\x02\x34*2/v3/{name=*/*/services/*/serviceLevelObjectives/*}\x1a\xa9\x01\xca\x41\x19monitoring.googleapis.com\xd2\x41\x89\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.readB\xb5\x01\n\x18\x63om.google.monitoring.v3B\x1dServiceMonitoringServiceProtoP\x01Z>google.golang.org/genproto/googleapis/monitoring/v3;monitoring\xaa\x02\x1aGoogle.Cloud.Monitoring.V3\xca\x02\x1aGoogle\\Cloud\\Monitoring\\V3b\x06proto3' + ), + dependencies=[ + google_dot_api_dot_annotations__pb2.DESCRIPTOR, + google_dot_api_dot_monitored__resource__pb2.DESCRIPTOR, + google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2.DESCRIPTOR, + google_dot_protobuf_dot_empty__pb2.DESCRIPTOR, + google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, + google_dot_api_dot_client__pb2.DESCRIPTOR, + ], +) + + +_CREATESERVICEREQUEST = _descriptor.Descriptor( + name="CreateServiceRequest", + full_name="google.monitoring.v3.CreateServiceRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="parent", + full_name="google.monitoring.v3.CreateServiceRequest.parent", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="service_id", + full_name="google.monitoring.v3.CreateServiceRequest.service_id", + index=1, + number=3, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="service", + full_name="google.monitoring.v3.CreateServiceRequest.service", + index=2, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=283, + serialized_end=389, +) + + +_GETSERVICEREQUEST = _descriptor.Descriptor( + name="GetServiceRequest", + full_name="google.monitoring.v3.GetServiceRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.monitoring.v3.GetServiceRequest.name", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=391, + serialized_end=424, +) + + +_LISTSERVICESREQUEST = _descriptor.Descriptor( + name="ListServicesRequest", + full_name="google.monitoring.v3.ListServicesRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="parent", + full_name="google.monitoring.v3.ListServicesRequest.parent", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="filter", + full_name="google.monitoring.v3.ListServicesRequest.filter", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="page_size", + full_name="google.monitoring.v3.ListServicesRequest.page_size", + index=2, + number=3, + type=5, + cpp_type=1, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="page_token", + full_name="google.monitoring.v3.ListServicesRequest.page_token", + index=3, + number=4, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=426, + serialized_end=518, +) + + +_LISTSERVICESRESPONSE = _descriptor.Descriptor( + name="ListServicesResponse", + full_name="google.monitoring.v3.ListServicesResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="services", + full_name="google.monitoring.v3.ListServicesResponse.services", + index=0, + number=1, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="next_page_token", + full_name="google.monitoring.v3.ListServicesResponse.next_page_token", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=520, + serialized_end=616, +) + + +_UPDATESERVICEREQUEST = _descriptor.Descriptor( + name="UpdateServiceRequest", + full_name="google.monitoring.v3.UpdateServiceRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="service", + full_name="google.monitoring.v3.UpdateServiceRequest.service", + index=0, + number=1, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="update_mask", + full_name="google.monitoring.v3.UpdateServiceRequest.update_mask", + index=1, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=618, + serialized_end=737, +) + + +_DELETESERVICEREQUEST = _descriptor.Descriptor( + name="DeleteServiceRequest", + full_name="google.monitoring.v3.DeleteServiceRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.monitoring.v3.DeleteServiceRequest.name", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=739, + serialized_end=775, +) + + +_CREATESERVICELEVELOBJECTIVEREQUEST = _descriptor.Descriptor( + name="CreateServiceLevelObjectiveRequest", + full_name="google.monitoring.v3.CreateServiceLevelObjectiveRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="parent", + full_name="google.monitoring.v3.CreateServiceLevelObjectiveRequest.parent", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="service_level_objective_id", + full_name="google.monitoring.v3.CreateServiceLevelObjectiveRequest.service_level_objective_id", + index=1, + number=3, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="service_level_objective", + full_name="google.monitoring.v3.CreateServiceLevelObjectiveRequest.service_level_objective", + index=2, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=778, + serialized_end=944, +) + + +_GETSERVICELEVELOBJECTIVEREQUEST = _descriptor.Descriptor( + name="GetServiceLevelObjectiveRequest", + full_name="google.monitoring.v3.GetServiceLevelObjectiveRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.monitoring.v3.GetServiceLevelObjectiveRequest.name", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="view", + full_name="google.monitoring.v3.GetServiceLevelObjectiveRequest.view", + index=1, + number=2, + type=14, + cpp_type=8, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=946, + serialized_end=1057, +) + + +_LISTSERVICELEVELOBJECTIVESREQUEST = _descriptor.Descriptor( + name="ListServiceLevelObjectivesRequest", + full_name="google.monitoring.v3.ListServiceLevelObjectivesRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="parent", + full_name="google.monitoring.v3.ListServiceLevelObjectivesRequest.parent", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="filter", + full_name="google.monitoring.v3.ListServiceLevelObjectivesRequest.filter", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="page_size", + full_name="google.monitoring.v3.ListServiceLevelObjectivesRequest.page_size", + index=2, + number=3, + type=5, + cpp_type=1, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="page_token", + full_name="google.monitoring.v3.ListServiceLevelObjectivesRequest.page_token", + index=3, + number=4, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="view", + full_name="google.monitoring.v3.ListServiceLevelObjectivesRequest.view", + index=4, + number=5, + type=14, + cpp_type=8, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1060, + serialized_end=1230, +) + + +_LISTSERVICELEVELOBJECTIVESRESPONSE = _descriptor.Descriptor( + name="ListServiceLevelObjectivesResponse", + full_name="google.monitoring.v3.ListServiceLevelObjectivesResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="service_level_objectives", + full_name="google.monitoring.v3.ListServiceLevelObjectivesResponse.service_level_objectives", + index=0, + number=1, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="next_page_token", + full_name="google.monitoring.v3.ListServiceLevelObjectivesResponse.next_page_token", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1233, + serialized_end=1373, +) + + +_UPDATESERVICELEVELOBJECTIVEREQUEST = _descriptor.Descriptor( + name="UpdateServiceLevelObjectiveRequest", + full_name="google.monitoring.v3.UpdateServiceLevelObjectiveRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="service_level_objective", + full_name="google.monitoring.v3.UpdateServiceLevelObjectiveRequest.service_level_objective", + index=0, + number=1, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="update_mask", + full_name="google.monitoring.v3.UpdateServiceLevelObjectiveRequest.update_mask", + index=1, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1376, + serialized_end=1539, +) + + +_DELETESERVICELEVELOBJECTIVEREQUEST = _descriptor.Descriptor( + name="DeleteServiceLevelObjectiveRequest", + full_name="google.monitoring.v3.DeleteServiceLevelObjectiveRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.monitoring.v3.DeleteServiceLevelObjectiveRequest.name", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1541, + serialized_end=1591, +) + +_CREATESERVICEREQUEST.fields_by_name[ + "service" +].message_type = google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2._SERVICE +_LISTSERVICESRESPONSE.fields_by_name[ + "services" +].message_type = google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2._SERVICE +_UPDATESERVICEREQUEST.fields_by_name[ + "service" +].message_type = google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2._SERVICE +_UPDATESERVICEREQUEST.fields_by_name[ + "update_mask" +].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK +_CREATESERVICELEVELOBJECTIVEREQUEST.fields_by_name[ + "service_level_objective" +].message_type = ( + google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2._SERVICELEVELOBJECTIVE +) +_GETSERVICELEVELOBJECTIVEREQUEST.fields_by_name[ + "view" +].enum_type = ( + google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2._SERVICELEVELOBJECTIVE_VIEW +) +_LISTSERVICELEVELOBJECTIVESREQUEST.fields_by_name[ + "view" +].enum_type = ( + google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2._SERVICELEVELOBJECTIVE_VIEW +) +_LISTSERVICELEVELOBJECTIVESRESPONSE.fields_by_name[ + "service_level_objectives" +].message_type = ( + google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2._SERVICELEVELOBJECTIVE +) +_UPDATESERVICELEVELOBJECTIVEREQUEST.fields_by_name[ + "service_level_objective" +].message_type = ( + google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2._SERVICELEVELOBJECTIVE +) +_UPDATESERVICELEVELOBJECTIVEREQUEST.fields_by_name[ + "update_mask" +].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK +DESCRIPTOR.message_types_by_name["CreateServiceRequest"] = _CREATESERVICEREQUEST +DESCRIPTOR.message_types_by_name["GetServiceRequest"] = _GETSERVICEREQUEST +DESCRIPTOR.message_types_by_name["ListServicesRequest"] = _LISTSERVICESREQUEST +DESCRIPTOR.message_types_by_name["ListServicesResponse"] = _LISTSERVICESRESPONSE +DESCRIPTOR.message_types_by_name["UpdateServiceRequest"] = _UPDATESERVICEREQUEST +DESCRIPTOR.message_types_by_name["DeleteServiceRequest"] = _DELETESERVICEREQUEST +DESCRIPTOR.message_types_by_name[ + "CreateServiceLevelObjectiveRequest" +] = _CREATESERVICELEVELOBJECTIVEREQUEST +DESCRIPTOR.message_types_by_name[ + "GetServiceLevelObjectiveRequest" +] = _GETSERVICELEVELOBJECTIVEREQUEST +DESCRIPTOR.message_types_by_name[ + "ListServiceLevelObjectivesRequest" +] = _LISTSERVICELEVELOBJECTIVESREQUEST +DESCRIPTOR.message_types_by_name[ + "ListServiceLevelObjectivesResponse" +] = _LISTSERVICELEVELOBJECTIVESRESPONSE +DESCRIPTOR.message_types_by_name[ + "UpdateServiceLevelObjectiveRequest" +] = _UPDATESERVICELEVELOBJECTIVEREQUEST +DESCRIPTOR.message_types_by_name[ + "DeleteServiceLevelObjectiveRequest" +] = _DELETESERVICELEVELOBJECTIVEREQUEST +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +CreateServiceRequest = _reflection.GeneratedProtocolMessageType( + "CreateServiceRequest", + (_message.Message,), + dict( + DESCRIPTOR=_CREATESERVICEREQUEST, + __module__="google.cloud.monitoring_v3.proto.service_service_pb2", + __doc__="""The ``CreateService`` request. + + + Attributes: + parent: + Resource name of the parent workspace. Of the form + ``projects/{project_id}``. + service_id: + Optional. The Service id to use for this Service. If omitted, + an id will be generated instead. Must match the pattern + [a-z0-9-]+ + service: + The ``Service`` to create. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.CreateServiceRequest) + ), +) +_sym_db.RegisterMessage(CreateServiceRequest) + +GetServiceRequest = _reflection.GeneratedProtocolMessageType( + "GetServiceRequest", + (_message.Message,), + dict( + DESCRIPTOR=_GETSERVICEREQUEST, + __module__="google.cloud.monitoring_v3.proto.service_service_pb2", + __doc__="""The ``GetService`` request. + + + Attributes: + name: + Resource name of the ``Service``. Of the form + ``projects/{project_id}/services/{service_id}``. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.GetServiceRequest) + ), +) +_sym_db.RegisterMessage(GetServiceRequest) + +ListServicesRequest = _reflection.GeneratedProtocolMessageType( + "ListServicesRequest", + (_message.Message,), + dict( + DESCRIPTOR=_LISTSERVICESREQUEST, + __module__="google.cloud.monitoring_v3.proto.service_service_pb2", + __doc__="""The ``ListServices`` request. + + + Attributes: + parent: + Resource name of the parent ``Workspace``. Of the form + ``projects/{project_id}``. + filter: + A filter specifying what ``Service``\ s to return. The filter + currently supports the following fields: :: - + `identifier_case` - `app_engine.module_id` - + `cloud_endpoints.service` - `cluster_istio.location` - + `cluster_istio.cluster_name` - + `cluster_istio.service_namespace` - + `cluster_istio.service_name` ``identifier_case`` refers to + which option in the identifier oneof is populated. For + example, the filter ``identifier_case = "CUSTOM"`` would match + all services with a value for the ``custom`` field. Valid + options are "CUSTOM", "APP\_ENGINE", "CLOUD\_ENDPOINTS", and + "CLUSTER\_ISTIO". + page_size: + A non-negative number that is the maximum number of results to + return. When 0, use default page size. + page_token: + If this field is not empty then it must contain the + ``nextPageToken`` value returned by a previous call to this + method. Using this field causes the method to return + additional results from the previous method call. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.ListServicesRequest) + ), +) +_sym_db.RegisterMessage(ListServicesRequest) + +ListServicesResponse = _reflection.GeneratedProtocolMessageType( + "ListServicesResponse", + (_message.Message,), + dict( + DESCRIPTOR=_LISTSERVICESRESPONSE, + __module__="google.cloud.monitoring_v3.proto.service_service_pb2", + __doc__="""The ``ListServices`` response. + + + Attributes: + services: + The ``Service``\ s matching the specified filter. + next_page_token: + If there are more results than have been returned, then this + field is set to a non-empty value. To see the additional + results, use that value as ``pageToken`` in the next call to + this method. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.ListServicesResponse) + ), +) +_sym_db.RegisterMessage(ListServicesResponse) + +UpdateServiceRequest = _reflection.GeneratedProtocolMessageType( + "UpdateServiceRequest", + (_message.Message,), + dict( + DESCRIPTOR=_UPDATESERVICEREQUEST, + __module__="google.cloud.monitoring_v3.proto.service_service_pb2", + __doc__="""The ``UpdateService`` request. + + + Attributes: + service: + The ``Service`` to draw updates from. The given ``name`` + specifies the resource to update. + update_mask: + A set of field paths defining which fields to use for the + update. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.UpdateServiceRequest) + ), +) +_sym_db.RegisterMessage(UpdateServiceRequest) + +DeleteServiceRequest = _reflection.GeneratedProtocolMessageType( + "DeleteServiceRequest", + (_message.Message,), + dict( + DESCRIPTOR=_DELETESERVICEREQUEST, + __module__="google.cloud.monitoring_v3.proto.service_service_pb2", + __doc__="""The ``DeleteService`` request. + + + Attributes: + name: + Resource name of the ``Service`` to delete. Of the form + ``projects/{project_id}/service/{service_id}``. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.DeleteServiceRequest) + ), +) +_sym_db.RegisterMessage(DeleteServiceRequest) + +CreateServiceLevelObjectiveRequest = _reflection.GeneratedProtocolMessageType( + "CreateServiceLevelObjectiveRequest", + (_message.Message,), + dict( + DESCRIPTOR=_CREATESERVICELEVELOBJECTIVEREQUEST, + __module__="google.cloud.monitoring_v3.proto.service_service_pb2", + __doc__="""The ``CreateServiceLevelObjective`` request. + + + Attributes: + parent: + Resource name of the parent ``Service``. Of the form + ``projects/{project_id}/services/{service_id}``. + service_level_objective_id: + Optional. The ServiceLevelObjective id to use for this + ServiceLevelObjective. If omitted, an id will be generated + instead. Must match the pattern [a-z0-9-]+ + service_level_objective: + The ``ServiceLevelObjective`` to create. The provided ``name`` + will be respected if no ``ServiceLevelObjective`` exists with + this name. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.CreateServiceLevelObjectiveRequest) + ), +) +_sym_db.RegisterMessage(CreateServiceLevelObjectiveRequest) + +GetServiceLevelObjectiveRequest = _reflection.GeneratedProtocolMessageType( + "GetServiceLevelObjectiveRequest", + (_message.Message,), + dict( + DESCRIPTOR=_GETSERVICELEVELOBJECTIVEREQUEST, + __module__="google.cloud.monitoring_v3.proto.service_service_pb2", + __doc__="""The ``GetServiceLevelObjective`` request. + + + Attributes: + name: + Resource name of the ``ServiceLevelObjective`` to get. Of the + form ``projects/{project_id}/services/{service_id}/serviceLeve + lObjectives/{slo_name}``. + view: + View of the ``ServiceLevelObjective`` to return. If + ``DEFAULT``, return the ``ServiceLevelObjective`` as + originally defined. If ``EXPLICIT`` and the + ``ServiceLevelObjective`` is defined in terms of a + ``BasicSli``, replace the ``BasicSli`` with a + ``RequestBasedSli`` spelling out how the SLI is computed. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.GetServiceLevelObjectiveRequest) + ), +) +_sym_db.RegisterMessage(GetServiceLevelObjectiveRequest) + +ListServiceLevelObjectivesRequest = _reflection.GeneratedProtocolMessageType( + "ListServiceLevelObjectivesRequest", + (_message.Message,), + dict( + DESCRIPTOR=_LISTSERVICELEVELOBJECTIVESREQUEST, + __module__="google.cloud.monitoring_v3.proto.service_service_pb2", + __doc__="""The ``ListServiceLevelObjectives`` request. + + + Attributes: + parent: + Resource name of the parent ``Service``. Of the form + ``projects/{project_id}/services/{service_id}``. + filter: + A filter specifying what ``ServiceLevelObjective``\ s to + return. + page_size: + A non-negative number that is the maximum number of results to + return. When 0, use default page size. + page_token: + If this field is not empty then it must contain the + ``nextPageToken`` value returned by a previous call to this + method. Using this field causes the method to return + additional results from the previous method call. + view: + View of the ``ServiceLevelObjective``\ s to return. If + ``DEFAULT``, return each ``ServiceLevelObjective`` as + originally defined. If ``EXPLICIT`` and the + ``ServiceLevelObjective`` is defined in terms of a + ``BasicSli``, replace the ``BasicSli`` with a + ``RequestBasedSli`` spelling out how the SLI is computed. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.ListServiceLevelObjectivesRequest) + ), +) +_sym_db.RegisterMessage(ListServiceLevelObjectivesRequest) + +ListServiceLevelObjectivesResponse = _reflection.GeneratedProtocolMessageType( + "ListServiceLevelObjectivesResponse", + (_message.Message,), + dict( + DESCRIPTOR=_LISTSERVICELEVELOBJECTIVESRESPONSE, + __module__="google.cloud.monitoring_v3.proto.service_service_pb2", + __doc__="""The ``ListServiceLevelObjectives`` response. + + + Attributes: + service_level_objectives: + The ``ServiceLevelObjective``\ s matching the specified + filter. + next_page_token: + If there are more results than have been returned, then this + field is set to a non-empty value. To see the additional + results, use that value as ``pageToken`` in the next call to + this method. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.ListServiceLevelObjectivesResponse) + ), +) +_sym_db.RegisterMessage(ListServiceLevelObjectivesResponse) + +UpdateServiceLevelObjectiveRequest = _reflection.GeneratedProtocolMessageType( + "UpdateServiceLevelObjectiveRequest", + (_message.Message,), + dict( + DESCRIPTOR=_UPDATESERVICELEVELOBJECTIVEREQUEST, + __module__="google.cloud.monitoring_v3.proto.service_service_pb2", + __doc__="""The ``UpdateServiceLevelObjective`` request. + + + Attributes: + service_level_objective: + The ``ServiceLevelObjective`` to draw updates from. The given + ``name`` specifies the resource to update. + update_mask: + A set of field paths defining which fields to use for the + update. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.UpdateServiceLevelObjectiveRequest) + ), +) +_sym_db.RegisterMessage(UpdateServiceLevelObjectiveRequest) + +DeleteServiceLevelObjectiveRequest = _reflection.GeneratedProtocolMessageType( + "DeleteServiceLevelObjectiveRequest", + (_message.Message,), + dict( + DESCRIPTOR=_DELETESERVICELEVELOBJECTIVEREQUEST, + __module__="google.cloud.monitoring_v3.proto.service_service_pb2", + __doc__="""The ``DeleteServiceLevelObjective`` request. + + + Attributes: + name: + Resource name of the ``ServiceLevelObjective`` to delete. Of + the form ``projects/{project_id}/services/{service_id}/service + LevelObjectives/{slo_name}``. + """, + # @@protoc_insertion_point(class_scope:google.monitoring.v3.DeleteServiceLevelObjectiveRequest) + ), +) +_sym_db.RegisterMessage(DeleteServiceLevelObjectiveRequest) + + +DESCRIPTOR._options = None + +_SERVICEMONITORINGSERVICE = _descriptor.ServiceDescriptor( + name="ServiceMonitoringService", + full_name="google.monitoring.v3.ServiceMonitoringService", + file=DESCRIPTOR, + index=0, + serialized_options=_b( + "\312A\031monitoring.googleapis.com\322A\211\001https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.read" + ), + serialized_start=1594, + serialized_end=3487, + methods=[ + _descriptor.MethodDescriptor( + name="CreateService", + full_name="google.monitoring.v3.ServiceMonitoringService.CreateService", + index=0, + containing_service=None, + input_type=_CREATESERVICEREQUEST, + output_type=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2._SERVICE, + serialized_options=_b( + '\202\323\344\223\002$"\031/v3/{parent=*/*}/services:\007service' + ), + ), + _descriptor.MethodDescriptor( + name="GetService", + full_name="google.monitoring.v3.ServiceMonitoringService.GetService", + index=1, + containing_service=None, + input_type=_GETSERVICEREQUEST, + output_type=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2._SERVICE, + serialized_options=_b( + "\202\323\344\223\002\033\022\031/v3/{name=*/*/services/*}" + ), + ), + _descriptor.MethodDescriptor( + name="ListServices", + full_name="google.monitoring.v3.ServiceMonitoringService.ListServices", + index=2, + containing_service=None, + input_type=_LISTSERVICESREQUEST, + output_type=_LISTSERVICESRESPONSE, + serialized_options=_b( + "\202\323\344\223\002\033\022\031/v3/{parent=*/*}/services" + ), + ), + _descriptor.MethodDescriptor( + name="UpdateService", + full_name="google.monitoring.v3.ServiceMonitoringService.UpdateService", + index=3, + containing_service=None, + input_type=_UPDATESERVICEREQUEST, + output_type=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2._SERVICE, + serialized_options=_b( + "\202\323\344\223\002,2!/v3/{service.name=*/*/services/*}:\007service" + ), + ), + _descriptor.MethodDescriptor( + name="DeleteService", + full_name="google.monitoring.v3.ServiceMonitoringService.DeleteService", + index=4, + containing_service=None, + input_type=_DELETESERVICEREQUEST, + output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + serialized_options=_b( + "\202\323\344\223\002\033*\031/v3/{name=*/*/services/*}" + ), + ), + _descriptor.MethodDescriptor( + name="CreateServiceLevelObjective", + full_name="google.monitoring.v3.ServiceMonitoringService.CreateServiceLevelObjective", + index=5, + containing_service=None, + input_type=_CREATESERVICELEVELOBJECTIVEREQUEST, + output_type=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2._SERVICELEVELOBJECTIVE, + serialized_options=_b( + '\202\323\344\223\002M"2/v3/{parent=*/*/services/*}/serviceLevelObjectives:\027service_level_objective' + ), + ), + _descriptor.MethodDescriptor( + name="GetServiceLevelObjective", + full_name="google.monitoring.v3.ServiceMonitoringService.GetServiceLevelObjective", + index=6, + containing_service=None, + input_type=_GETSERVICELEVELOBJECTIVEREQUEST, + output_type=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2._SERVICELEVELOBJECTIVE, + serialized_options=_b( + "\202\323\344\223\0024\0222/v3/{name=*/*/services/*/serviceLevelObjectives/*}" + ), + ), + _descriptor.MethodDescriptor( + name="ListServiceLevelObjectives", + full_name="google.monitoring.v3.ServiceMonitoringService.ListServiceLevelObjectives", + index=7, + containing_service=None, + input_type=_LISTSERVICELEVELOBJECTIVESREQUEST, + output_type=_LISTSERVICELEVELOBJECTIVESRESPONSE, + serialized_options=_b( + "\202\323\344\223\0024\0222/v3/{parent=*/*/services/*}/serviceLevelObjectives" + ), + ), + _descriptor.MethodDescriptor( + name="UpdateServiceLevelObjective", + full_name="google.monitoring.v3.ServiceMonitoringService.UpdateServiceLevelObjective", + index=8, + containing_service=None, + input_type=_UPDATESERVICELEVELOBJECTIVEREQUEST, + output_type=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2._SERVICELEVELOBJECTIVE, + serialized_options=_b( + "\202\323\344\223\002e2J/v3/{service_level_objective.name=*/*/services/*/serviceLevelObjectives/*}:\027service_level_objective" + ), + ), + _descriptor.MethodDescriptor( + name="DeleteServiceLevelObjective", + full_name="google.monitoring.v3.ServiceMonitoringService.DeleteServiceLevelObjective", + index=9, + containing_service=None, + input_type=_DELETESERVICELEVELOBJECTIVEREQUEST, + output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + serialized_options=_b( + "\202\323\344\223\0024*2/v3/{name=*/*/services/*/serviceLevelObjectives/*}" + ), + ), + ], +) +_sym_db.RegisterServiceDescriptor(_SERVICEMONITORINGSERVICE) + +DESCRIPTOR.services_by_name["ServiceMonitoringService"] = _SERVICEMONITORINGSERVICE + +# @@protoc_insertion_point(module_scope) diff --git a/monitoring/google/cloud/monitoring_v3/proto/service_service_pb2_grpc.py b/monitoring/google/cloud/monitoring_v3/proto/service_service_pb2_grpc.py new file mode 100644 index 000000000000..3c03dc9c3706 --- /dev/null +++ b/monitoring/google/cloud/monitoring_v3/proto/service_service_pb2_grpc.py @@ -0,0 +1,212 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + +from google.cloud.monitoring_v3.proto import ( + service_pb2 as google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2, +) +from google.cloud.monitoring_v3.proto import ( + service_service_pb2 as google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2, +) +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 + + +class ServiceMonitoringServiceStub(object): + """The Stackdriver Monitoring Service-Oriented Monitoring API has endpoints for + managing and querying aspects of a workspace's services. These include the + `Service`'s monitored resources, its Service-Level Objectives, and a taxonomy + of categorized Health Metrics. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.CreateService = channel.unary_unary( + "/google.monitoring.v3.ServiceMonitoringService/CreateService", + request_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2.CreateServiceRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2.Service.FromString, + ) + self.GetService = channel.unary_unary( + "/google.monitoring.v3.ServiceMonitoringService/GetService", + request_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2.GetServiceRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2.Service.FromString, + ) + self.ListServices = channel.unary_unary( + "/google.monitoring.v3.ServiceMonitoringService/ListServices", + request_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2.ListServicesRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2.ListServicesResponse.FromString, + ) + self.UpdateService = channel.unary_unary( + "/google.monitoring.v3.ServiceMonitoringService/UpdateService", + request_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2.UpdateServiceRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2.Service.FromString, + ) + self.DeleteService = channel.unary_unary( + "/google.monitoring.v3.ServiceMonitoringService/DeleteService", + request_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2.DeleteServiceRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) + self.CreateServiceLevelObjective = channel.unary_unary( + "/google.monitoring.v3.ServiceMonitoringService/CreateServiceLevelObjective", + request_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2.CreateServiceLevelObjectiveRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2.ServiceLevelObjective.FromString, + ) + self.GetServiceLevelObjective = channel.unary_unary( + "/google.monitoring.v3.ServiceMonitoringService/GetServiceLevelObjective", + request_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2.GetServiceLevelObjectiveRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2.ServiceLevelObjective.FromString, + ) + self.ListServiceLevelObjectives = channel.unary_unary( + "/google.monitoring.v3.ServiceMonitoringService/ListServiceLevelObjectives", + request_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2.ListServiceLevelObjectivesRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2.ListServiceLevelObjectivesResponse.FromString, + ) + self.UpdateServiceLevelObjective = channel.unary_unary( + "/google.monitoring.v3.ServiceMonitoringService/UpdateServiceLevelObjective", + request_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2.UpdateServiceLevelObjectiveRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2.ServiceLevelObjective.FromString, + ) + self.DeleteServiceLevelObjective = channel.unary_unary( + "/google.monitoring.v3.ServiceMonitoringService/DeleteServiceLevelObjective", + request_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2.DeleteServiceLevelObjectiveRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) + + +class ServiceMonitoringServiceServicer(object): + """The Stackdriver Monitoring Service-Oriented Monitoring API has endpoints for + managing and querying aspects of a workspace's services. These include the + `Service`'s monitored resources, its Service-Level Objectives, and a taxonomy + of categorized Health Metrics. + """ + + def CreateService(self, request, context): + """Create a `Service`. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def GetService(self, request, context): + """Get the named `Service`. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def ListServices(self, request, context): + """List `Service`s for this workspace. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def UpdateService(self, request, context): + """Update this `Service`. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def DeleteService(self, request, context): + """Soft delete this `Service`. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def CreateServiceLevelObjective(self, request, context): + """Create a `ServiceLevelObjective` for the given `Service`. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def GetServiceLevelObjective(self, request, context): + """Get a `ServiceLevelObjective` by name. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def ListServiceLevelObjectives(self, request, context): + """List the `ServiceLevelObjective`s for the given `Service`. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def UpdateServiceLevelObjective(self, request, context): + """Update the given `ServiceLevelObjective`. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def DeleteServiceLevelObjective(self, request, context): + """Delete the given `ServiceLevelObjective`. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + +def add_ServiceMonitoringServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + "CreateService": grpc.unary_unary_rpc_method_handler( + servicer.CreateService, + request_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2.CreateServiceRequest.FromString, + response_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2.Service.SerializeToString, + ), + "GetService": grpc.unary_unary_rpc_method_handler( + servicer.GetService, + request_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2.GetServiceRequest.FromString, + response_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2.Service.SerializeToString, + ), + "ListServices": grpc.unary_unary_rpc_method_handler( + servicer.ListServices, + request_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2.ListServicesRequest.FromString, + response_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2.ListServicesResponse.SerializeToString, + ), + "UpdateService": grpc.unary_unary_rpc_method_handler( + servicer.UpdateService, + request_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2.UpdateServiceRequest.FromString, + response_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2.Service.SerializeToString, + ), + "DeleteService": grpc.unary_unary_rpc_method_handler( + servicer.DeleteService, + request_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2.DeleteServiceRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + "CreateServiceLevelObjective": grpc.unary_unary_rpc_method_handler( + servicer.CreateServiceLevelObjective, + request_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2.CreateServiceLevelObjectiveRequest.FromString, + response_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2.ServiceLevelObjective.SerializeToString, + ), + "GetServiceLevelObjective": grpc.unary_unary_rpc_method_handler( + servicer.GetServiceLevelObjective, + request_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2.GetServiceLevelObjectiveRequest.FromString, + response_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2.ServiceLevelObjective.SerializeToString, + ), + "ListServiceLevelObjectives": grpc.unary_unary_rpc_method_handler( + servicer.ListServiceLevelObjectives, + request_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2.ListServiceLevelObjectivesRequest.FromString, + response_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2.ListServiceLevelObjectivesResponse.SerializeToString, + ), + "UpdateServiceLevelObjective": grpc.unary_unary_rpc_method_handler( + servicer.UpdateServiceLevelObjective, + request_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2.UpdateServiceLevelObjectiveRequest.FromString, + response_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__pb2.ServiceLevelObjective.SerializeToString, + ), + "DeleteServiceLevelObjective": grpc.unary_unary_rpc_method_handler( + servicer.DeleteServiceLevelObjective, + request_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_service__service__pb2.DeleteServiceLevelObjectiveRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + "google.monitoring.v3.ServiceMonitoringService", rpc_method_handlers + ) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/monitoring/google/cloud/monitoring_v3/proto/span_context_pb2.py b/monitoring/google/cloud/monitoring_v3/proto/span_context_pb2.py index d0a53f5f4a59..b3017f4697bc 100644 --- a/monitoring/google/cloud/monitoring_v3/proto/span_context_pb2.py +++ b/monitoring/google/cloud/monitoring_v3/proto/span_context_pb2.py @@ -52,7 +52,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + ), ], extensions=[], nested_types=[], diff --git a/monitoring/google/cloud/monitoring_v3/proto/uptime.proto b/monitoring/google/cloud/monitoring_v3/proto/uptime.proto index 2601f531ba71..eb424e971517 100644 --- a/monitoring/google/cloud/monitoring_v3/proto/uptime.proto +++ b/monitoring/google/cloud/monitoring_v3/proto/uptime.proto @@ -27,27 +27,6 @@ option java_outer_classname = "UptimeProto"; option java_package = "com.google.monitoring.v3"; option php_namespace = "Google\\Cloud\\Monitoring\\V3"; -// The regions from which an Uptime check can be run. -enum UptimeCheckRegion { - // Default value if no region is specified. Will result in Uptime checks - // running from all regions. - REGION_UNSPECIFIED = 0; - - // Allows checks to run from locations within the United States of America. - USA = 1; - - // Allows checks to run from locations within the continent of Europe. - EUROPE = 2; - - // Allows checks to run from locations within the continent of South - // America. - SOUTH_AMERICA = 3; - - // Allows checks to run from locations within the Asia Pacific area (ex: - // Singapore). - ASIA_PACIFIC = 4; -} - // An internal checker allows Uptime checks to run on private/internal GCP // resources. message InternalChecker { @@ -104,21 +83,25 @@ message InternalChecker { State state = 7; } -// The supported resource types that can be used as values of -// `group_resource.resource_type`. -// `INSTANCE` includes `gce_instance` and `aws_ec2_instance` resource types. -// The resource types `gae_app` and `uptime_url` are not valid here because -// group checks on App Engine modules and URLs are not allowed. -enum GroupResourceType { - // Default value (not valid). - RESOURCE_TYPE_UNSPECIFIED = 0; +// The regions from which an Uptime check can be run. +enum UptimeCheckRegion { + // Default value if no region is specified. Will result in Uptime checks + // running from all regions. + REGION_UNSPECIFIED = 0; - // A group of instances from Google Cloud Platform (GCP) or - // Amazon Web Services (AWS). - INSTANCE = 1; + // Allows checks to run from locations within the United States of America. + USA = 1; - // A group of Amazon ELB load balancers. - AWS_ELB_LOAD_BALANCER = 2; + // Allows checks to run from locations within the continent of Europe. + EUROPE = 2; + + // Allows checks to run from locations within the continent of South + // America. + SOUTH_AMERICA = 3; + + // Allows checks to run from locations within the Asia Pacific area (ex: + // Singapore). + ASIA_PACIFIC = 4; } // This message configures which resources and services to monitor for @@ -202,8 +185,11 @@ message UptimeCheckConfig { int32 port = 1; } - // Used to perform string matching. It allows substring and regular - // expressions, together with their negations. + // Optional. Used to perform content matching. This allows matching based on + // substrings and regular expressions, together with their negations. Only the + // first 4 MB of an HTTP or HTTPS check's response (and the first + // 1 MB of a TCP check's response) are examined for purposes of content + // matching. message ContentMatcher { // Options to perform content matching. enum ContentMatcherOption { @@ -212,27 +198,28 @@ message UptimeCheckConfig { // Treated as `CONTAINS_STRING`. CONTENT_MATCHER_OPTION_UNSPECIFIED = 0; - // Selects substring matching (there is a match if the output contains - // the `content` string). This is the default value for checks without + // Selects substring matching. The match succeeds if the output contains + // the `content` string. This is the default value for checks without // a `matcher` option, or where the value of `matcher` is // `CONTENT_MATCHER_OPTION_UNSPECIFIED`. CONTAINS_STRING = 1; - // Selects negation of substring matching (there is a match if the output - // does NOT contain the `content` string). + // Selects negation of substring matching. The match succeeds if the + // output does _NOT_ contain the `content` string. NOT_CONTAINS_STRING = 2; - // Selects regular expression matching (there is a match of the output - // matches the regular expression specified in the `content` string). + // Selects regular-expression matching. The match succeeds of the output + // matches the regular expression specified in the `content` string. MATCHES_REGEX = 3; - // Selects negation of regular expression matching (there is a match if - // the output does NOT match the regular expression specified in the - // `content` string). + // Selects negation of regular-expression matching. The match succeeds if + // the output does _NOT_ match the regular expression specified in the + // `content` string. NOT_MATCHES_REGEX = 4; } - // String or regex content to match (max 1024 bytes) + // String or regex content to match. Maximum 1024 bytes. An empty `content` + // string indicates no content matching is to be performed. string content = 1; // The type of content matcher that will be applied to the server output, @@ -335,3 +322,20 @@ message UptimeCheckIp { // interpreting this field in either IPv4 or IPv6 format. string ip_address = 3; } + +// The supported resource types that can be used as values of +// `group_resource.resource_type`. +// `INSTANCE` includes `gce_instance` and `aws_ec2_instance` resource types. +// The resource types `gae_app` and `uptime_url` are not valid here because +// group checks on App Engine modules and URLs are not allowed. +enum GroupResourceType { + // Default value (not valid). + RESOURCE_TYPE_UNSPECIFIED = 0; + + // A group of instances from Google Cloud Platform (GCP) or + // Amazon Web Services (AWS). + INSTANCE = 1; + + // A group of Amazon ELB load balancers. + AWS_ELB_LOAD_BALANCER = 2; +} diff --git a/monitoring/google/cloud/monitoring_v3/proto/uptime_pb2.py b/monitoring/google/cloud/monitoring_v3/proto/uptime_pb2.py index eda8862b08d5..8ed99b3b20cd 100644 --- a/monitoring/google/cloud/monitoring_v3/proto/uptime_pb2.py +++ b/monitoring/google/cloud/monitoring_v3/proto/uptime_pb2.py @@ -301,7 +301,7 @@ ], extensions=[], nested_types=[], - enum_types=[_INTERNALCHECKER_STATE], + enum_types=[_INTERNALCHECKER_STATE,], serialized_options=_b("\030\001"), is_extendable=False, syntax="proto3", @@ -653,7 +653,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + ), ], extensions=[], nested_types=[], @@ -713,7 +713,7 @@ ], extensions=[], nested_types=[], - enum_types=[_UPTIMECHECKCONFIG_CONTENTMATCHER_CONTENTMATCHEROPTION], + enum_types=[_UPTIMECHECKCONFIG_CONTENTMATCHER_CONTENTMATCHEROPTION,], serialized_options=None, is_extendable=False, syntax="proto3", @@ -1308,13 +1308,18 @@ dict( DESCRIPTOR=_UPTIMECHECKCONFIG_CONTENTMATCHER, __module__="google.cloud.monitoring_v3.proto.uptime_pb2", - __doc__="""Used to perform string matching. It allows substring and regular - expressions, together with their negations. + __doc__="""Optional. Used to perform content matching. This allows matching based + on substrings and regular expressions, together with their negations. + Only the first 4 MB of an HTTP or HTTPS check's response (and the first + 1 MB of a TCP check's response) are examined for purposes of content + matching. Attributes: content: - String or regex content to match (max 1024 bytes) + String or regex content to match. Maximum 1024 bytes. An empty + ``content`` string indicates no content matching is to be + performed. matcher: The type of content matcher that will be applied to the server output, compared to the ``content`` string when the check is diff --git a/monitoring/google/cloud/monitoring_v3/proto/uptime_service_pb2.py b/monitoring/google/cloud/monitoring_v3/proto/uptime_service_pb2.py index 1cdf48be0bab..51ff5e5c3e7a 100644 --- a/monitoring/google/cloud/monitoring_v3/proto/uptime_service_pb2.py +++ b/monitoring/google/cloud/monitoring_v3/proto/uptime_service_pb2.py @@ -220,7 +220,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + ), ], extensions=[], nested_types=[], @@ -373,7 +373,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + ), ], extensions=[], nested_types=[], diff --git a/monitoring/google/cloud/monitoring_v3/types.py b/monitoring/google/cloud/monitoring_v3/types.py index 4cf6acb006fd..3e170e43e049 100644 --- a/monitoring/google/cloud/monitoring_v3/types.py +++ b/monitoring/google/cloud/monitoring_v3/types.py @@ -35,6 +35,8 @@ from google.cloud.monitoring_v3.proto import mutation_record_pb2 from google.cloud.monitoring_v3.proto import notification_pb2 from google.cloud.monitoring_v3.proto import notification_service_pb2 +from google.cloud.monitoring_v3.proto import service_pb2 +from google.cloud.monitoring_v3.proto import service_service_pb2 from google.cloud.monitoring_v3.proto import span_context_pb2 from google.cloud.monitoring_v3.proto import uptime_pb2 from google.cloud.monitoring_v3.proto import uptime_service_pb2 @@ -75,6 +77,8 @@ mutation_record_pb2, notification_pb2, notification_service_pb2, + service_pb2, + service_service_pb2, span_context_pb2, uptime_pb2, uptime_service_pb2, diff --git a/monitoring/synth.metadata b/monitoring/synth.metadata index 68e258131e4e..43a7e49f530a 100644 --- a/monitoring/synth.metadata +++ b/monitoring/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-10-26T12:27:22.100450Z", + "updateTime": "2019-11-14T13:26:57.703896Z", "sources": [ { "generator": { "name": "artman", - "version": "0.40.3", - "dockerImage": "googleapis/artman@sha256:c805f50525f5f557886c94ab76f56eaa09cb1da58c3ee95111fd34259376621a" + "version": "0.41.1", + "dockerImage": "googleapis/artman@sha256:545c758c76c3f779037aa259023ec3d1ef2d57d2c8cd00a222cb187d63ceac5e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d27a44798506d28e8e6d874bd128da43f45f74c4", - "internalRef": "276716410" + "sha": "4f747bda9b099b4426f495985680d16d0227fa5f", + "internalRef": "280394936" } }, { diff --git a/monitoring/tests/unit/gapic/v3/test_service_monitoring_service_client_v3.py b/monitoring/tests/unit/gapic/v3/test_service_monitoring_service_client_v3.py new file mode 100644 index 000000000000..f16f43520005 --- /dev/null +++ b/monitoring/tests/unit/gapic/v3/test_service_monitoring_service_client_v3.py @@ -0,0 +1,481 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Unit tests.""" + +import mock +import pytest + +from google.cloud import monitoring_v3 +from google.cloud.monitoring_v3.proto import service_pb2 +from google.cloud.monitoring_v3.proto import service_service_pb2 +from google.protobuf import empty_pb2 + + +class MultiCallableStub(object): + """Stub for the grpc.UnaryUnaryMultiCallable interface.""" + + def __init__(self, method, channel_stub): + self.method = method + self.channel_stub = channel_stub + + def __call__(self, request, timeout=None, metadata=None, credentials=None): + self.channel_stub.requests.append((self.method, request)) + + response = None + if self.channel_stub.responses: + response = self.channel_stub.responses.pop() + + if isinstance(response, Exception): + raise response + + if response: + return response + + +class ChannelStub(object): + """Stub for the grpc.Channel interface.""" + + def __init__(self, responses=[]): + self.responses = responses + self.requests = [] + + def unary_unary(self, method, request_serializer=None, response_deserializer=None): + return MultiCallableStub(method, self) + + +class CustomException(Exception): + pass + + +class TestServiceMonitoringServiceClient(object): + def test_create_service(self): + # Setup Expected Response + name = "name3373707" + display_name = "displayName1615086568" + expected_response = {"name": name, "display_name": display_name} + expected_response = service_pb2.Service(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = monitoring_v3.ServiceMonitoringServiceClient() + + # Setup Request + parent = client.project_path("[PROJECT]") + service = {} + + response = client.create_service(parent, service) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = service_service_pb2.CreateServiceRequest( + parent=parent, service=service + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_create_service_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = monitoring_v3.ServiceMonitoringServiceClient() + + # Setup request + parent = client.project_path("[PROJECT]") + service = {} + + with pytest.raises(CustomException): + client.create_service(parent, service) + + def test_get_service(self): + # Setup Expected Response + name_2 = "name2-1052831874" + display_name = "displayName1615086568" + expected_response = {"name": name_2, "display_name": display_name} + expected_response = service_pb2.Service(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = monitoring_v3.ServiceMonitoringServiceClient() + + # Setup Request + name = client.service_path("[PROJECT]", "[SERVICE]") + + response = client.get_service(name) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = service_service_pb2.GetServiceRequest(name=name) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_get_service_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = monitoring_v3.ServiceMonitoringServiceClient() + + # Setup request + name = client.service_path("[PROJECT]", "[SERVICE]") + + with pytest.raises(CustomException): + client.get_service(name) + + def test_list_services(self): + # Setup Expected Response + next_page_token = "" + services_element = {} + services = [services_element] + expected_response = {"next_page_token": next_page_token, "services": services} + expected_response = service_service_pb2.ListServicesResponse( + **expected_response + ) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = monitoring_v3.ServiceMonitoringServiceClient() + + # Setup Request + parent = client.project_path("[PROJECT]") + + paged_list_response = client.list_services(parent) + resources = list(paged_list_response) + assert len(resources) == 1 + + assert expected_response.services[0] == resources[0] + + assert len(channel.requests) == 1 + expected_request = service_service_pb2.ListServicesRequest(parent=parent) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_list_services_exception(self): + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = monitoring_v3.ServiceMonitoringServiceClient() + + # Setup request + parent = client.project_path("[PROJECT]") + + paged_list_response = client.list_services(parent) + with pytest.raises(CustomException): + list(paged_list_response) + + def test_update_service(self): + # Setup Expected Response + name = "name3373707" + display_name = "displayName1615086568" + expected_response = {"name": name, "display_name": display_name} + expected_response = service_pb2.Service(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = monitoring_v3.ServiceMonitoringServiceClient() + + # Setup Request + service = {} + + response = client.update_service(service) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = service_service_pb2.UpdateServiceRequest(service=service) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_update_service_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = monitoring_v3.ServiceMonitoringServiceClient() + + # Setup request + service = {} + + with pytest.raises(CustomException): + client.update_service(service) + + def test_delete_service(self): + channel = ChannelStub() + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = monitoring_v3.ServiceMonitoringServiceClient() + + # Setup Request + name = client.service_path("[PROJECT]", "[SERVICE]") + + client.delete_service(name) + + assert len(channel.requests) == 1 + expected_request = service_service_pb2.DeleteServiceRequest(name=name) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_delete_service_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = monitoring_v3.ServiceMonitoringServiceClient() + + # Setup request + name = client.service_path("[PROJECT]", "[SERVICE]") + + with pytest.raises(CustomException): + client.delete_service(name) + + def test_create_service_level_objective(self): + # Setup Expected Response + name = "name3373707" + display_name = "displayName1615086568" + goal = 317825.0 + expected_response = {"name": name, "display_name": display_name, "goal": goal} + expected_response = service_pb2.ServiceLevelObjective(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = monitoring_v3.ServiceMonitoringServiceClient() + + # Setup Request + parent = client.service_path("[PROJECT]", "[SERVICE]") + service_level_objective = {} + + response = client.create_service_level_objective( + parent, service_level_objective + ) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = service_service_pb2.CreateServiceLevelObjectiveRequest( + parent=parent, service_level_objective=service_level_objective + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_create_service_level_objective_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = monitoring_v3.ServiceMonitoringServiceClient() + + # Setup request + parent = client.service_path("[PROJECT]", "[SERVICE]") + service_level_objective = {} + + with pytest.raises(CustomException): + client.create_service_level_objective(parent, service_level_objective) + + def test_get_service_level_objective(self): + # Setup Expected Response + name_2 = "name2-1052831874" + display_name = "displayName1615086568" + goal = 317825.0 + expected_response = {"name": name_2, "display_name": display_name, "goal": goal} + expected_response = service_pb2.ServiceLevelObjective(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = monitoring_v3.ServiceMonitoringServiceClient() + + # Setup Request + name = client.service_level_objective_path( + "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]" + ) + + response = client.get_service_level_objective(name) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = service_service_pb2.GetServiceLevelObjectiveRequest( + name=name + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_get_service_level_objective_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = monitoring_v3.ServiceMonitoringServiceClient() + + # Setup request + name = client.service_level_objective_path( + "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]" + ) + + with pytest.raises(CustomException): + client.get_service_level_objective(name) + + def test_list_service_level_objectives(self): + # Setup Expected Response + next_page_token = "" + service_level_objectives_element = {} + service_level_objectives = [service_level_objectives_element] + expected_response = { + "next_page_token": next_page_token, + "service_level_objectives": service_level_objectives, + } + expected_response = service_service_pb2.ListServiceLevelObjectivesResponse( + **expected_response + ) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = monitoring_v3.ServiceMonitoringServiceClient() + + # Setup Request + parent = client.service_path("[PROJECT]", "[SERVICE]") + + paged_list_response = client.list_service_level_objectives(parent) + resources = list(paged_list_response) + assert len(resources) == 1 + + assert expected_response.service_level_objectives[0] == resources[0] + + assert len(channel.requests) == 1 + expected_request = service_service_pb2.ListServiceLevelObjectivesRequest( + parent=parent + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_list_service_level_objectives_exception(self): + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = monitoring_v3.ServiceMonitoringServiceClient() + + # Setup request + parent = client.service_path("[PROJECT]", "[SERVICE]") + + paged_list_response = client.list_service_level_objectives(parent) + with pytest.raises(CustomException): + list(paged_list_response) + + def test_update_service_level_objective(self): + # Setup Expected Response + name = "name3373707" + display_name = "displayName1615086568" + goal = 317825.0 + expected_response = {"name": name, "display_name": display_name, "goal": goal} + expected_response = service_pb2.ServiceLevelObjective(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = monitoring_v3.ServiceMonitoringServiceClient() + + # Setup Request + service_level_objective = {} + + response = client.update_service_level_objective(service_level_objective) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = service_service_pb2.UpdateServiceLevelObjectiveRequest( + service_level_objective=service_level_objective + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_update_service_level_objective_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = monitoring_v3.ServiceMonitoringServiceClient() + + # Setup request + service_level_objective = {} + + with pytest.raises(CustomException): + client.update_service_level_objective(service_level_objective) + + def test_delete_service_level_objective(self): + channel = ChannelStub() + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = monitoring_v3.ServiceMonitoringServiceClient() + + # Setup Request + name = client.service_level_objective_path( + "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]" + ) + + client.delete_service_level_objective(name) + + assert len(channel.requests) == 1 + expected_request = service_service_pb2.DeleteServiceLevelObjectiveRequest( + name=name + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_delete_service_level_objective_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = monitoring_v3.ServiceMonitoringServiceClient() + + # Setup request + name = client.service_level_objective_path( + "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]" + ) + + with pytest.raises(CustomException): + client.delete_service_level_objective(name)