Skip to content

Commit aef2210

Browse files
yoshi-automationbusunkim96
authored andcommitted
feat(monitoring): add monitoring.v3.InternalChecker.state; add monitoring.v3.UptimeCheckConfig.ContentMatcher.ContentMatcherOption; add recursive parameter to delete_group; add read-only validity field to monitoring.v3.AlertPolicy; add validate_ssl parameter to monitoring.v3.UptimeCheckConfig.HttpCheck (#9546)
* Add `monitoring.v3.InternalChecker.state` * Add `monitoring.v3.UptimeCheckConfig.ContentMatcher.ContentMatcherOption` * Add `recursive` parameter to `delete_group` * Add read-only `validity` field to `monitoring.v3.AlertPolicy` * Add `validate_ssl` parameter to `monitoring.v3.UptimeCheckConfig.HttpCheck`
1 parent e9ca02a commit aef2210

35 files changed

+1011
-651
lines changed

monitoring/docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@
344344
"google-gax": ("https://gax-python.readthedocs.io/en/latest/", None),
345345
"google.api_core": ("https://googleapis.dev/python/google-api-core/latest", None),
346346
"grpc": ("https://grpc.io/grpc/python/", None),
347-
"requests": ("https://requests.kennethreitz.org/en/stable/", None),
347+
"requests": ("https://requests.kennethreitz.org/en/master/", None),
348348
"fastavro": ("https://fastavro.readthedocs.io/en/stable/", None),
349349
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
350350
}

monitoring/google/cloud/monitoring_v3/gapic/enums.py

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ class ServiceTier(enum.IntEnum):
148148

149149
class UptimeCheckRegion(enum.IntEnum):
150150
"""
151-
The regions from which an uptime check can be run.
151+
The regions from which an Uptime check can be run.
152152
153153
Attributes:
154-
REGION_UNSPECIFIED (int): Default value if no region is specified. Will result in uptime checks
154+
REGION_UNSPECIFIED (int): Default value if no region is specified. Will result in Uptime checks
155155
running from all regions.
156156
USA (int): Allows checks to run from locations within the United States of America.
157157
EUROPE (int): Allows checks to run from locations within the continent of Europe.
@@ -397,6 +397,31 @@ class ConditionCombinerType(enum.IntEnum):
397397
AND_WITH_MATCHING_RESOURCE = 3
398398

399399

400+
class InternalChecker(object):
401+
class State(enum.IntEnum):
402+
"""
403+
Operational states for an internal checker.
404+
405+
Attributes:
406+
UNSPECIFIED (int): An internal checker should never be in the unspecified state.
407+
CREATING (int): The checker is being created, provisioned, and configured. A checker in
408+
this state can be returned by ``ListInternalCheckers`` or
409+
``GetInternalChecker``, as well as by examining the `long running
410+
Operation <https://cloud.google.com/apis/design/design_patterns#long_running_operations>`__
411+
that created it.
412+
RUNNING (int): The checker is running and available for use. A checker in this state
413+
can be returned by ``ListInternalCheckers`` or ``GetInternalChecker`` as
414+
well as by examining the `long running
415+
Operation <https://cloud.google.com/apis/design/design_patterns#long_running_operations>`__
416+
that created it. If a checker is being torn down, it is neither visible
417+
nor usable, so there is no "deleting" or "down" state.
418+
"""
419+
420+
UNSPECIFIED = 0
421+
CREATING = 1
422+
RUNNING = 2
423+
424+
400425
class LabelDescriptor(object):
401426
class ValueType(enum.IntEnum):
402427
"""
@@ -498,3 +523,33 @@ class VerificationStatus(enum.IntEnum):
498523
VERIFICATION_STATUS_UNSPECIFIED = 0
499524
UNVERIFIED = 1
500525
VERIFIED = 2
526+
527+
528+
class UptimeCheckConfig(object):
529+
class ContentMatcher(object):
530+
class ContentMatcherOption(enum.IntEnum):
531+
"""
532+
Options to perform content matching.
533+
534+
Attributes:
535+
CONTENT_MATCHER_OPTION_UNSPECIFIED (int): No content matcher type specified (maintained for backward
536+
compatibility, but deprecated for future use). Treated as
537+
``CONTAINS_STRING``.
538+
CONTAINS_STRING (int): Selects substring matching (there is a match if the output contains the
539+
``content`` string). This is the default value for checks without a
540+
``matcher`` option, or where the value of ``matcher`` is
541+
``CONTENT_MATCHER_OPTION_UNSPECIFIED``.
542+
NOT_CONTAINS_STRING (int): Selects negation of substring matching (there is a match if the output
543+
does NOT contain the ``content`` string).
544+
MATCHES_REGEX (int): Selects regular expression matching (there is a match of the output
545+
matches the regular expression specified in the ``content`` string).
546+
NOT_MATCHES_REGEX (int): Selects negation of regular expression matching (there is a match if the
547+
output does NOT match the regular expression specified in the
548+
``content`` string).
549+
"""
550+
551+
CONTENT_MATCHER_OPTION_UNSPECIFIED = 0
552+
CONTAINS_STRING = 1
553+
NOT_CONTAINS_STRING = 2
554+
MATCHES_REGEX = 3
555+
NOT_MATCHES_REGEX = 4

monitoring/google/cloud/monitoring_v3/gapic/group_service_client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ def update_group(
599599
def delete_group(
600600
self,
601601
name,
602+
recursive=None,
602603
retry=google.api_core.gapic_v1.method.DEFAULT,
603604
timeout=google.api_core.gapic_v1.method.DEFAULT,
604605
metadata=None,
@@ -618,6 +619,9 @@ def delete_group(
618619
Args:
619620
name (str): The group to delete. The format is
620621
``"projects/{project_id_or_number}/groups/{group_id}"``.
622+
recursive (bool): If this field is true, then the request means to delete a group with all
623+
its descendants. Otherwise, the request means to delete a group only when
624+
it has no descendants. The default value is false.
621625
retry (Optional[google.api_core.retry.Retry]): A retry object used
622626
to retry requests. If ``None`` is specified, requests will
623627
be retried using a default configuration.
@@ -648,7 +652,7 @@ def delete_group(
648652
client_info=self._client_info,
649653
)
650654

651-
request = group_service_pb2.DeleteGroupRequest(name=name)
655+
request = group_service_pb2.DeleteGroupRequest(name=name, recursive=recursive)
652656
if metadata is None:
653657
metadata = []
654658
metadata = list(metadata)

monitoring/google/cloud/monitoring_v3/gapic/metric_service_client.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,7 @@ def list_monitored_resource_descriptors(
236236
metadata=None,
237237
):
238238
"""
239-
Lists monitored resource descriptors that match a filter. This method does
240-
not require a Stackdriver account.
239+
Lists monitored resource descriptors that match a filter. This method does not require a Stackdriver account.
241240
242241
Example:
243242
>>> from google.cloud import monitoring_v3
@@ -356,8 +355,7 @@ def get_monitored_resource_descriptor(
356355
metadata=None,
357356
):
358357
"""
359-
Gets a single monitored resource descriptor. This method does not require a
360-
Stackdriver account.
358+
Gets a single monitored resource descriptor. This method does not require a Stackdriver account.
361359
362360
Example:
363361
>>> from google.cloud import monitoring_v3
@@ -438,8 +436,7 @@ def list_metric_descriptors(
438436
metadata=None,
439437
):
440438
"""
441-
Lists metric descriptors that match a filter. This method does not require
442-
a Stackdriver account.
439+
Lists metric descriptors that match a filter. This method does not require a Stackdriver account.
443440
444441
Example:
445442
>>> from google.cloud import monitoring_v3
@@ -555,8 +552,7 @@ def get_metric_descriptor(
555552
metadata=None,
556553
):
557554
"""
558-
Gets a single metric descriptor. This method does not require a Stackdriver
559-
account.
555+
Gets a single metric descriptor. This method does not require a Stackdriver account.
560556
561557
Example:
562558
>>> from google.cloud import monitoring_v3
@@ -797,8 +793,7 @@ def list_time_series(
797793
metadata=None,
798794
):
799795
"""
800-
Lists time series that match a filter. This method does not require a
801-
Stackdriver account.
796+
Lists time series that match a filter. This method does not require a Stackdriver account.
802797
803798
Example:
804799
>>> from google.cloud import monitoring_v3
@@ -843,7 +838,7 @@ def list_time_series(
843838
::
844839
845840
metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND
846-
metric.label.instance_name = "my-instance-name"
841+
metric.labels.instance_name = "my-instance-name"
847842
interval (Union[dict, ~google.cloud.monitoring_v3.types.TimeInterval]): The time interval for which results should be returned. Only time series
848843
that contain data points in the specified interval are included
849844
in the response.
@@ -972,6 +967,9 @@ def create_time_series(
972967
value must fully specify a unique time series by supplying all label
973968
values for the metric and the monitored resource.
974969
970+
The maximum number of ``TimeSeries`` objects per ``Create`` request is
971+
200.
972+
975973
If a dict is provided, it must be of the same form as the protobuf
976974
message :class:`~google.cloud.monitoring_v3.types.TimeSeries`
977975
retry (Optional[google.api_core.retry.Retry]): A retry object used

monitoring/google/cloud/monitoring_v3/gapic/transports/metric_service_grpc_transport.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ def channel(self):
116116
def list_monitored_resource_descriptors(self):
117117
"""Return the gRPC stub for :meth:`MetricServiceClient.list_monitored_resource_descriptors`.
118118
119-
Lists monitored resource descriptors that match a filter. This method does
120-
not require a Stackdriver account.
119+
Lists monitored resource descriptors that match a filter. This method does not require a Stackdriver account.
121120
122121
Returns:
123122
Callable: A callable which accepts the appropriate
@@ -130,8 +129,7 @@ def list_monitored_resource_descriptors(self):
130129
def get_monitored_resource_descriptor(self):
131130
"""Return the gRPC stub for :meth:`MetricServiceClient.get_monitored_resource_descriptor`.
132131
133-
Gets a single monitored resource descriptor. This method does not require a
134-
Stackdriver account.
132+
Gets a single monitored resource descriptor. This method does not require a Stackdriver account.
135133
136134
Returns:
137135
Callable: A callable which accepts the appropriate
@@ -144,8 +142,7 @@ def get_monitored_resource_descriptor(self):
144142
def list_metric_descriptors(self):
145143
"""Return the gRPC stub for :meth:`MetricServiceClient.list_metric_descriptors`.
146144
147-
Lists metric descriptors that match a filter. This method does not require
148-
a Stackdriver account.
145+
Lists metric descriptors that match a filter. This method does not require a Stackdriver account.
149146
150147
Returns:
151148
Callable: A callable which accepts the appropriate
@@ -158,8 +155,7 @@ def list_metric_descriptors(self):
158155
def get_metric_descriptor(self):
159156
"""Return the gRPC stub for :meth:`MetricServiceClient.get_metric_descriptor`.
160157
161-
Gets a single metric descriptor. This method does not require a Stackdriver
162-
account.
158+
Gets a single metric descriptor. This method does not require a Stackdriver account.
163159
164160
Returns:
165161
Callable: A callable which accepts the appropriate
@@ -201,8 +197,7 @@ def delete_metric_descriptor(self):
201197
def list_time_series(self):
202198
"""Return the gRPC stub for :meth:`MetricServiceClient.list_time_series`.
203199
204-
Lists time series that match a filter. This method does not require a
205-
Stackdriver account.
200+
Lists time series that match a filter. This method does not require a Stackdriver account.
206201
207202
Returns:
208203
Callable: A callable which accepts the appropriate

monitoring/google/cloud/monitoring_v3/gapic/transports/uptime_check_service_grpc_transport.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ def channel(self):
118118
def list_uptime_check_configs(self):
119119
"""Return the gRPC stub for :meth:`UptimeCheckServiceClient.list_uptime_check_configs`.
120120
121-
Lists the existing valid uptime check configurations for the project,
122-
leaving out any invalid configurations.
121+
Lists the existing valid Uptime check configurations for the project
122+
(leaving out any invalid configurations).
123123
124124
Returns:
125125
Callable: A callable which accepts the appropriate
@@ -132,7 +132,7 @@ def list_uptime_check_configs(self):
132132
def get_uptime_check_config(self):
133133
"""Return the gRPC stub for :meth:`UptimeCheckServiceClient.get_uptime_check_config`.
134134
135-
Gets a single uptime check configuration.
135+
Gets a single Uptime check configuration.
136136
137137
Returns:
138138
Callable: A callable which accepts the appropriate
@@ -145,7 +145,7 @@ def get_uptime_check_config(self):
145145
def create_uptime_check_config(self):
146146
"""Return the gRPC stub for :meth:`UptimeCheckServiceClient.create_uptime_check_config`.
147147
148-
Creates a new uptime check configuration.
148+
Creates a new Uptime check configuration.
149149
150150
Returns:
151151
Callable: A callable which accepts the appropriate
@@ -158,10 +158,10 @@ def create_uptime_check_config(self):
158158
def update_uptime_check_config(self):
159159
"""Return the gRPC stub for :meth:`UptimeCheckServiceClient.update_uptime_check_config`.
160160
161-
Updates an uptime check configuration. You can either replace the entire
161+
Updates an Uptime check configuration. You can either replace the entire
162162
configuration with a new one or replace only certain fields in the
163163
current configuration by specifying the fields to be updated via
164-
``"updateMask"``. Returns the updated configuration.
164+
``updateMask``. Returns the updated configuration.
165165
166166
Returns:
167167
Callable: A callable which accepts the appropriate
@@ -174,8 +174,8 @@ def update_uptime_check_config(self):
174174
def delete_uptime_check_config(self):
175175
"""Return the gRPC stub for :meth:`UptimeCheckServiceClient.delete_uptime_check_config`.
176176
177-
Deletes an uptime check configuration. Note that this method will fail
178-
if the uptime check configuration is referenced by an alert policy or
177+
Deletes an Uptime check configuration. Note that this method will fail
178+
if the Uptime check configuration is referenced by an alert policy or
179179
other dependent configs that would be rendered invalid by the deletion.
180180
181181
Returns:
@@ -189,7 +189,7 @@ def delete_uptime_check_config(self):
189189
def list_uptime_check_ips(self):
190190
"""Return the gRPC stub for :meth:`UptimeCheckServiceClient.list_uptime_check_ips`.
191191
192-
Returns the list of IPs that checkers run from
192+
Returns the list of IP addresses that checkers run from
193193
194194
Returns:
195195
Callable: A callable which accepts the appropriate

0 commit comments

Comments
 (0)