From 83db4cdae44438484444313c4e2cff27578a1d17 Mon Sep 17 00:00:00 2001 From: DPE bot Date: Tue, 6 Nov 2018 08:49:29 -0800 Subject: [PATCH] Fix client_info bug, update docstrings and timeouts. (#6416) --- .../gapic/alert_policy_service_client.py | 102 +++---- .../alert_policy_service_client_config.py | 10 +- .../google/cloud/monitoring_v3/gapic/enums.py | 269 +++++++++--------- .../gapic/group_service_client.py | 91 +++--- .../gapic/group_service_client_config.py | 12 +- .../gapic/metric_service_client.py | 115 ++++---- .../gapic/metric_service_client_config.py | 16 +- .../notification_channel_service_client.py | 61 ++-- ...ification_channel_service_client_config.py | 15 +- .../alert_policy_service_grpc_transport.py | 8 +- .../group_service_grpc_transport.py | 4 +- .../metric_service_grpc_transport.py | 10 +- .../uptime_check_service_grpc_transport.py | 6 +- .../gapic/uptime_check_service_client.py | 76 ++--- 14 files changed, 400 insertions(+), 395 deletions(-) diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client.py b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client.py index 360a49dcc526..1e55d8b9c42f 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client.py @@ -44,14 +44,14 @@ class AlertPolicyServiceClient(object): """ The AlertPolicyService API is used to manage (list, create, delete, - edit) alert policies in Stackdriver Monitoring. An alerting policy is - a description of the conditions under which some aspect of your - system is considered to be \"unhealthy\" and the ways to notify - people or services about this state. In addition to using this API, alert - policies can also be managed through - `Stackdriver Monitoring `_, - which can be reached by clicking the \"Monitoring\" tab in - `Cloud Console `_. + edit) alert policies in Stackdriver Monitoring. An alerting policy is a + description of the conditions under which some aspect of your system is + considered to be "unhealthy" and the ways to notify people or services + about this state. In addition to using this API, alert policies can also + be managed through `Stackdriver + Monitoring `__, which can be + reached by clicking the "Monitoring" tab in `Cloud + Console `__. """ SERVICE_ADDRESS = 'monitoring.googleapis.com:443' @@ -178,9 +178,10 @@ def __init__(self, ) if client_info is None: - client_info = ( - google.api_core.gapic_v1.client_info.DEFAULT_CLIENT_INFO) - client_info.gapic_version = _GAPIC_LIBRARY_VERSION + 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 @@ -224,7 +225,7 @@ def list_alert_policies(self, >>> # Alternatively: >>> >>> # Iterate over results one page at a time - >>> for page in client.list_alert_policies(name, options=CallOptions(page_token=INITIAL_PAGE)): + >>> for page in client.list_alert_policies(name).pages: ... for element in page: ... # process element ... pass @@ -232,24 +233,22 @@ def list_alert_policies(self, Args: name (str): The project whose alert policies are to be listed. The format is - projects/[PROJECT_ID] + projects/[PROJECT_ID] Note that this field names the parent container in which the alerting policies to be listed are stored. To retrieve a single alerting policy - by name, use the - ``GetAlertPolicy`` - operation, instead. - filter_ (str): If provided, this field specifies the criteria that must be met by - alert policies to be included in the response. - - For more details, see [sorting and - filtering](/monitoring/api/v3/sorting-and-filtering). + by name, use the ``GetAlertPolicy`` operation, instead. + filter_ (str): If provided, this field specifies the criteria that must be met by alert + policies to be included in the response. + + For more details, see `sorting and + filtering `__. order_by (str): A comma-separated list of fields by which to sort the result. Supports the same set of field references as the ``filter`` field. Entries can be prefixed with a minus sign to sort by the field in descending order. - For more details, see [sorting and - filtering](/monitoring/api/v3/sorting-and-filtering). + For more details, see `sorting and + filtering `__. 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 @@ -332,7 +331,7 @@ def get_alert_policy(self, Args: name (str): The alerting policy to retrieve. The format is - projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] + projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will not be retried. @@ -386,7 +385,7 @@ def create_alert_policy(self, >>> >>> name = client.project_path('[PROJECT]') >>> - >>> # TODO: Initialize ``alert_policy``: + >>> # TODO: Initialize `alert_policy`: >>> alert_policy = {} >>> >>> response = client.create_alert_policy(name, alert_policy) @@ -400,9 +399,10 @@ def create_alert_policy(self, policy that is returned will have a name that contains a normalized representation of this name as a prefix but adds a suffix of the form ``/alertPolicies/[POLICY_ID]``, identifying the policy in the container. - alert_policy (Union[dict, ~google.cloud.monitoring_v3.types.AlertPolicy]): The requested alerting policy. You should omit the ``name`` field in this - policy. The name will be returned in the new policy, including - a new [ALERT_POLICY_ID] value. + alert_policy (Union[dict, ~google.cloud.monitoring_v3.types.AlertPolicy]): The requested alerting policy. You should omit the ``name`` field in + this policy. The name will be returned in the new policy, including a + new [ALERT\_POLICY\_ID] value. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.monitoring_v3.types.AlertPolicy` retry (Optional[google.api_core.retry.Retry]): A retry object used @@ -466,7 +466,7 @@ def delete_alert_policy(self, Args: name (str): The alerting policy to delete. The format is: - projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] + projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] For more information, see ``AlertPolicy``. retry (Optional[google.api_core.retry.Retry]): A retry object used @@ -511,49 +511,51 @@ def update_alert_policy(self, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None): """ - Updates an alerting policy. You can either replace the entire policy with - a new one or replace only certain fields in the current alerting policy by - specifying the fields to be updated via ``updateMask``. Returns the - updated alerting policy. + Updates an alerting policy. You can either replace the entire policy + with a new one or replace only certain fields in the current alerting + policy by specifying the fields to be updated via ``updateMask``. + Returns the updated alerting policy. Example: >>> from google.cloud import monitoring_v3 >>> >>> client = monitoring_v3.AlertPolicyServiceClient() >>> - >>> # TODO: Initialize ``alert_policy``: + >>> # TODO: Initialize `alert_policy`: >>> alert_policy = {} >>> >>> response = client.update_alert_policy(alert_policy) Args: alert_policy (Union[dict, ~google.cloud.monitoring_v3.types.AlertPolicy]): Required. The updated alerting policy or the updated values for the - fields listed in ``update_mask``. - If ``update_mask`` is not empty, any fields in this policy that are - not in ``update_mask`` are ignored. + fields listed in ``update_mask``. If ``update_mask`` is not empty, any + fields in this policy that are not in ``update_mask`` are ignored. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.monitoring_v3.types.AlertPolicy` update_mask (Union[dict, ~google.cloud.monitoring_v3.types.FieldMask]): Optional. A list of alerting policy field names. If this field is not empty, each listed field in the existing alerting policy is set to the - value of the corresponding field in the supplied policy (``alert_policy``), - or to the field's default value if the field is not in the supplied - alerting policy. Fields not listed retain their previous value. + value of the corresponding field in the supplied policy + (``alert_policy``), or to the field's default value if the field is not + in the supplied alerting policy. Fields not listed retain their previous + value. - Examples of valid field masks include ``display_name``, ``documentation``, - ``documentation.content``, ``documentation.mime_type``, ``user_labels``, - ``user_label.nameofkey``, ``enabled``, ``conditions``, ``combiner``, etc. + Examples of valid field masks include ``display_name``, + ``documentation``, ``documentation.content``, + ``documentation.mime_type``, ``user_labels``, ``user_label.nameofkey``, + ``enabled``, ``conditions``, ``combiner``, etc. If this field is empty, then the supplied alerting policy replaces the existing policy. It is the same as deleting the existing policy and adding the supplied policy, except for the following: - + The new policy will have the same ``[ALERT_POLICY_ID]`` as the former - policy. This gives you continuity with the former policy in your - notifications and incidents. - + Conditions in the new policy will keep their former ``[CONDITION_ID]`` if - the supplied condition includes the `name` field with that - `[CONDITION_ID]`. If the supplied condition omits the `name` field, - then a new `[CONDITION_ID]` is created. + - The new policy will have the same ``[ALERT_POLICY_ID]`` as the former + policy. This gives you continuity with the former policy in your + notifications and incidents. + - Conditions in the new policy will keep their former + ``[CONDITION_ID]`` if the supplied condition includes the ``name`` + field with that ``[CONDITION_ID]``. If the supplied condition omits + the ``name`` field, then a new ``[CONDITION_ID]`` is created. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.monitoring_v3.types.FieldMask` diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client_config.py b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client_config.py index 39185cab3235..b1c085b57d11 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client_config.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client_config.py @@ -18,27 +18,27 @@ }, "methods": { "ListAlertPolicies": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetAlertPolicy": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "CreateAlertPolicy": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DeleteAlertPolicy": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "UpdateAlertPolicy": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" } diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/enums.py b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/enums.py index 7a2e531aeadb..fdae3fbb5688 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/enums.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/enums.py @@ -20,10 +20,10 @@ class NullValue(enum.IntEnum): """ - ``NullValue`` is a singleton enumeration to represent the null value for the - ``Value`` type union. + ``NullValue`` is a singleton enumeration to represent the null value for + the ``Value`` type union. - The JSON representation for ``NullValue`` is JSON ``null``. + The JSON representation for ``NullValue`` is JSON ``null``. Attributes: NULL_VALUE (int): Null value. @@ -56,8 +56,9 @@ class ComparisonType(enum.IntEnum): class ServiceTier(enum.IntEnum): """ - The tier of service for a Stackdriver account. Please see the - `service tiers documentation `_ + The tier of service for a Stackdriver account. Please see the `service + tiers + documentation `__ for more details. Attributes: @@ -66,11 +67,13 @@ class ServiceTier(enum.IntEnum): SERVICE_TIER_BASIC (int): The Stackdriver Basic tier, a free tier of service that provides basic features, a moderate allotment of logs, and access to built-in metrics. A number of features are not available in this tier. For more details, - see `the service tiers documentation `_. + see `the service tiers + documentation `__. SERVICE_TIER_PREMIUM (int): The Stackdriver Premium tier, a higher, more expensive tier of service - that provides access to all Stackdriver features, lets you use Stackdriver - with AWS accounts, and has a larger allotments for logs and metrics. For - more details, see `the service tiers documentation `_. + that provides access to all Stackdriver features, lets you use + Stackdriver with AWS accounts, and has a larger allotments for logs and + metrics. For more details, see `the service tiers + documentation `__. """ SERVICE_TIER_UNSPECIFIED = 0 SERVICE_TIER_BASIC = 1 @@ -79,8 +82,8 @@ class ServiceTier(enum.IntEnum): class LaunchStage(enum.IntEnum): """ - The launch stage as defined by [Google Cloud Platform - Launch Stages](http://cloud.google.com/terms/launch-stages). + The launch stage as defined by `Google Cloud Platform Launch + Stages `__. Attributes: LAUNCH_STAGE_UNSPECIFIED (int): Do not use this default value. @@ -106,10 +109,10 @@ class LaunchStage(enum.IntEnum): GA (int): GA features are open to all developers and are considered stable and fully qualified for production use. DEPRECATED (int): Deprecated features are scheduled to be shut down and removed. For more - information, see the “Deprecation Policy” section of our [Terms of - Service](https://cloud.google.com/terms/) - and the [Google Cloud Platform Subject to the Deprecation - Policy](https://cloud.google.com/terms/deprecation) documentation. + information, see the “Deprecation Policy” section of our `Terms of + Service `__ and the `Google Cloud + Platform Subject to the Deprecation + Policy `__ documentation. """ LAUNCH_STAGE_UNSPECIFIED = 0 EARLY_ACCESS = 1 @@ -143,10 +146,10 @@ class UptimeCheckRegion(enum.IntEnum): class GroupResourceType(enum.IntEnum): """ 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. + ``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. Attributes: RESOURCE_TYPE_UNSPECIFIED (int): Default value (not valid). @@ -184,23 +187,21 @@ class Aligner(enum.IntEnum): ALIGN_NONE (int): No alignment. Raw data is returned. Not valid if cross-time series reduction is requested. The value type of the result is the same as the value type of the input. - ALIGN_DELTA (int): Align and convert to delta metric type. This alignment is valid - for cumulative metrics and delta metrics. Aligning an existing - delta metric to a delta metric requires that the alignment - period be increased. The value type of the result is the same - as the value type of the input. - - One can think of this aligner as a rate but without time units; that - is, the output is conceptually (second_point - first_point). - ALIGN_RATE (int): Align and convert to a rate. This alignment is valid for - cumulative metrics and delta metrics with numeric values. The output is a - gauge metric with value type - ``DOUBLE``. - - One can think of this aligner as conceptually providing the slope of - the line that passes through the value at the start and end of the - window. In other words, this is conceptually ((y1 - y0)/(t1 - t0)), - and the output unit is one that has a \"/time\" dimension. + ALIGN_DELTA (int): Align and convert to delta metric type. This alignment is valid for + cumulative metrics and delta metrics. Aligning an existing delta metric + to a delta metric requires that the alignment period be increased. The + value type of the result is the same as the value type of the input. + + One can think of this aligner as a rate but without time units; that is, + the output is conceptually (second\_point - first\_point). + ALIGN_RATE (int): Align and convert to a rate. This alignment is valid for cumulative + metrics and delta metrics with numeric values. The output is a gauge + metric with value type ``DOUBLE``. + + One can think of this aligner as conceptually providing the slope of the + line that passes through the value at the start and end of the window. + In other words, this is conceptually ((y1 - y0)/(t1 - t0)), and the + output unit is one that has a "/time" dimension. If, by rate, you are looking for percentage change, see the ``ALIGN_PERCENT_CHANGE`` aligner option. @@ -222,76 +223,67 @@ class Aligner(enum.IntEnum): period. This alignment is valid for gauge and delta metrics with numeric values. The value type of the result is the same as the value type of the input. - ALIGN_MEAN (int): Align time series via aggregation. The resulting data point in - the alignment period is the average or arithmetic mean of all - data points in the period. This alignment is valid for gauge and delta - metrics with numeric values. The value type of the output is - ``DOUBLE``. - ALIGN_COUNT (int): Align time series via aggregation. The resulting data point in - the alignment period is the count of all data points in the - period. This alignment is valid for gauge and delta metrics with numeric - or Boolean values. The value type of the output is - ``INT64``. + ALIGN_MEAN (int): Align time series via aggregation. The resulting data point in the + alignment period is the average or arithmetic mean of all data points in + the period. This alignment is valid for gauge and delta metrics with + numeric values. The value type of the output is ``DOUBLE``. + ALIGN_COUNT (int): Align time series via aggregation. The resulting data point in the + alignment period is the count of all data points in the period. This + alignment is valid for gauge and delta metrics with numeric or Boolean + values. The value type of the output is ``INT64``. ALIGN_SUM (int): Align time series via aggregation. The resulting data point in the alignment period is the sum of all data points in the period. This alignment is valid for gauge and delta metrics with numeric and distribution values. The value type of the output is the same as the value type of the input. - ALIGN_STDDEV (int): Align time series via aggregation. The resulting data point in - the alignment period is the standard deviation of all data - points in the period. This alignment is valid for gauge and delta metrics - with numeric values. The value type of the output is - ``DOUBLE``. - ALIGN_COUNT_TRUE (int): Align time series via aggregation. The resulting data point in - the alignment period is the count of True-valued data points in the - period. This alignment is valid for gauge metrics with - Boolean values. The value type of the output is - ``INT64``. - ALIGN_COUNT_FALSE (int): Align time series via aggregation. The resulting data point in - the alignment period is the count of False-valued data points in the - period. This alignment is valid for gauge metrics with - Boolean values. The value type of the output is - ``INT64``. - ALIGN_FRACTION_TRUE (int): Align time series via aggregation. The resulting data point in - the alignment period is the fraction of True-valued data points in the + ALIGN_STDDEV (int): Align time series via aggregation. The resulting data point in the + alignment period is the standard deviation of all data points in the + period. This alignment is valid for gauge and delta metrics with numeric + values. The value type of the output is ``DOUBLE``. + ALIGN_COUNT_TRUE (int): Align time series via aggregation. The resulting data point in the + alignment period is the count of True-valued data points in the period. + This alignment is valid for gauge metrics with Boolean values. The value + type of the output is ``INT64``. + ALIGN_COUNT_FALSE (int): Align time series via aggregation. The resulting data point in the + alignment period is the count of False-valued data points in the period. + This alignment is valid for gauge metrics with Boolean values. The value + type of the output is ``INT64``. + ALIGN_FRACTION_TRUE (int): Align time series via aggregation. The resulting data point in the + alignment period is the fraction of True-valued data points in the period. This alignment is valid for gauge metrics with Boolean values. - The output value is in the range [0, 1] and has value type - ``DOUBLE``. - ALIGN_PERCENTILE_99 (int): Align time series via aggregation. The resulting data point in - the alignment period is the 99th percentile of all data - points in the period. This alignment is valid for gauge and delta metrics - with distribution values. The output is a gauge metric with value type - ``DOUBLE``. - ALIGN_PERCENTILE_95 (int): Align time series via aggregation. The resulting data point in - the alignment period is the 95th percentile of all data - points in the period. This alignment is valid for gauge and delta metrics - with distribution values. The output is a gauge metric with value type + The output value is in the range [0, 1] and has value type ``DOUBLE``. + ALIGN_PERCENTILE_99 (int): Align time series via aggregation. The resulting data point in the + alignment period is the 99th percentile of all data points in the + period. This alignment is valid for gauge and delta metrics with + distribution values. The output is a gauge metric with value type ``DOUBLE``. - ALIGN_PERCENTILE_50 (int): Align time series via aggregation. The resulting data point in - the alignment period is the 50th percentile of all data - points in the period. This alignment is valid for gauge and delta metrics - with distribution values. The output is a gauge metric with value type + ALIGN_PERCENTILE_95 (int): Align time series via aggregation. The resulting data point in the + alignment period is the 95th percentile of all data points in the + period. This alignment is valid for gauge and delta metrics with + distribution values. The output is a gauge metric with value type ``DOUBLE``. - ALIGN_PERCENTILE_05 (int): Align time series via aggregation. The resulting data point in - the alignment period is the 5th percentile of all data - points in the period. This alignment is valid for gauge and delta metrics - with distribution values. The output is a gauge metric with value type + ALIGN_PERCENTILE_50 (int): Align time series via aggregation. The resulting data point in the + alignment period is the 50th percentile of all data points in the + period. This alignment is valid for gauge and delta metrics with + distribution values. The output is a gauge metric with value type ``DOUBLE``. + ALIGN_PERCENTILE_05 (int): Align time series via aggregation. The resulting data point in the + alignment period is the 5th percentile of all data points in the period. + This alignment is valid for gauge and delta metrics with distribution + values. The output is a gauge metric with value type ``DOUBLE``. ALIGN_PERCENT_CHANGE (int): Align and convert to a percentage change. This alignment is valid for gauge and delta metrics with numeric values. This alignment conceptually - computes the equivalent of \"((current - previous)/previous)*100\" - where previous value is determined based on the alignmentPeriod. - In the event that previous is 0 the calculated value is infinity with the - exception that if both (current - previous) and previous are 0 the - calculated value is 0. - A 10 minute moving mean is computed at each point of the time window - prior to the above calculation to smooth the metric and prevent false - positives from very short lived spikes. - Only applicable for data that is >= 0. Any values < 0 are treated as - no data. While delta metrics are accepted by this alignment special care - should be taken that the values for the metric will always be positive. - The output is a gauge metric with value type - ``DOUBLE``. + computes the equivalent of "((current - previous)/previous)\*100" where + previous value is determined based on the alignmentPeriod. In the event + that previous is 0 the calculated value is infinity with the exception + that if both (current - previous) and previous are 0 the calculated + value is 0. A 10 minute moving mean is computed at each point of the + time window prior to the above calculation to smooth the metric and + prevent false positives from very short lived spikes. Only applicable + for data that is >= 0. Any values < 0 are treated as no data. While + delta metrics are accepted by this alignment special care should be + taken that the values for the metric will always be positive. The output + is a gauge metric with value type ``DOUBLE``. """ ALIGN_NONE = 0 ALIGN_DELTA = 1 @@ -321,10 +313,9 @@ class Reducer(enum.IntEnum): Attributes: REDUCE_NONE (int): No cross-time series reduction. The output of the aligner is returned. - REDUCE_MEAN (int): Reduce by computing the mean across time series for each - alignment period. This reducer is valid for delta and - gauge metrics with numeric or distribution values. The value type of the - output is ``DOUBLE``. + REDUCE_MEAN (int): Reduce by computing the mean across time series for each alignment + period. This reducer is valid for delta and gauge metrics with numeric + or distribution values. The value type of the output is ``DOUBLE``. REDUCE_MIN (int): Reduce by computing the minimum across time series for each alignment period. This reducer is valid for delta and gauge metrics with numeric values. The value type of the output @@ -337,28 +328,26 @@ class Reducer(enum.IntEnum): alignment period. This reducer is valid for delta and gauge metrics with numeric and distribution values. The value type of the output is the same as the value type of the input. - REDUCE_STDDEV (int): Reduce by computing the standard deviation across time series - for each alignment period. This reducer is valid for delta - and gauge metrics with numeric or distribution values. The value type of - the output is ``DOUBLE``. - REDUCE_COUNT (int): Reduce by computing the count of data points across time series - for each alignment period. This reducer is valid for delta - and gauge metrics of numeric, Boolean, distribution, and string value - type. The value type of the output is - ``INT64``. - REDUCE_COUNT_TRUE (int): Reduce by computing the count of True-valued data points across time - series for each alignment period. This reducer is valid for delta - and gauge metrics of Boolean value type. The value type of + REDUCE_STDDEV (int): Reduce by computing the standard deviation across time series for each + alignment period. This reducer is valid for delta and gauge metrics with + numeric or distribution values. The value type of the output is + ``DOUBLE``. + REDUCE_COUNT (int): Reduce by computing the count of data points across time series for each + alignment period. This reducer is valid for delta and gauge metrics of + numeric, Boolean, distribution, and string value type. The value type of the output is ``INT64``. + REDUCE_COUNT_TRUE (int): Reduce by computing the count of True-valued data points across time + series for each alignment period. This reducer is valid for delta and + gauge metrics of Boolean value type. The value type of the output is + ``INT64``. REDUCE_COUNT_FALSE (int): Reduce by computing the count of False-valued data points across time - series for each alignment period. This reducer is valid for delta - and gauge metrics of Boolean value type. The value type of - the output is ``INT64``. + series for each alignment period. This reducer is valid for delta and + gauge metrics of Boolean value type. The value type of the output is + ``INT64``. REDUCE_FRACTION_TRUE (int): Reduce by computing the fraction of True-valued data points across time - series for each alignment period. This reducer is valid for delta - and gauge metrics of Boolean value type. The output value is in the - range [0, 1] and has value type - ``DOUBLE``. + series for each alignment period. This reducer is valid for delta and + gauge metrics of Boolean value type. The output value is in the range + [0, 1] and has value type ``DOUBLE``. REDUCE_PERCENTILE_99 (int): Reduce by computing 99th percentile of data points across time series for each alignment period. This reducer is valid for gauge and delta metrics of numeric and distribution type. The value of the output is @@ -371,10 +360,9 @@ class Reducer(enum.IntEnum): for each alignment period. This reducer is valid for gauge and delta metrics of numeric and distribution type. The value of the output is ``DOUBLE`` - REDUCE_PERCENTILE_05 (int): Reduce by computing 5th percentile of data points across time series - for each alignment period. This reducer is valid for gauge and delta - metrics of numeric and distribution type. The value of the output is - ``DOUBLE`` + REDUCE_PERCENTILE_05 (int): Reduce by computing 5th percentile of data points across time series for + each alignment period. This reducer is valid for gauge and delta metrics + of numeric and distribution type. The value of the output is ``DOUBLE`` """ REDUCE_NONE = 0 REDUCE_MEAN = 1 @@ -418,13 +406,13 @@ class ValueType(enum.IntEnum): Attributes: VALUE_TYPE_UNSPECIFIED (int): Do not use this default value. - BOOL (int): The value is a boolean. - This value type can be used only if the metric kind is ``GAUGE``. + BOOL (int): The value is a boolean. This value type can be used only if the metric + kind is ``GAUGE``. INT64 (int): The value is a signed 64-bit integer. DOUBLE (int): The value is a double precision floating point number. - STRING (int): The value is a text string. - This value type can be used only if the metric kind is ``GAUGE``. - DISTRIBUTION (int): The value is a ````Distribution````. + STRING (int): The value is a text string. This value type can be used only if the + metric kind is ``GAUGE``. + DISTRIBUTION (int): The value is a ``Distribution``. MONEY (int): The value is money. """ VALUE_TYPE_UNSPECIFIED = 0 @@ -443,15 +431,15 @@ class ConditionCombinerType(enum.IntEnum): Attributes: COMBINE_UNSPECIFIED (int): An unspecified combiner. - AND (int): Combine conditions using the logical ``AND`` operator. An - incident is created only if all conditions are met - simultaneously. This combiner is satisfied if all conditions are - met, even if they are met on completely different resources. - OR (int): Combine conditions using the logical ``OR`` operator. An incident - is created if any of the listed conditions is met. - AND_WITH_MATCHING_RESOURCE (int): Combine conditions using logical ``AND`` operator, but unlike the regular - ``AND`` option, an incident is created only if all conditions are met - simultaneously on at least one resource. + AND (int): Combine conditions using the logical ``AND`` operator. An incident is + created only if all conditions are met simultaneously. This combiner is + satisfied if all conditions are met, even if they are met on completely + different resources. + OR (int): Combine conditions using the logical ``OR`` operator. An incident is + created if any of the listed conditions is met. + AND_WITH_MATCHING_RESOURCE (int): Combine conditions using logical ``AND`` operator, but unlike the + regular ``AND`` option, an incident is created only if all conditions + are met simultaneously on at least one resource. """ COMBINE_UNSPECIFIED = 0 AND = 1 @@ -462,12 +450,9 @@ class ConditionCombinerType(enum.IntEnum): class NotificationChannel(object): class VerificationStatus(enum.IntEnum): """ - Indicates whether the channel has been verified or not. It is illegal - to specify this field in a - ````CreateNotificationChannel```` - or an - ````UpdateNotificationChannel```` - operation. + Indicates whether the channel has been verified or not. It is illegal to + specify this field in a ``CreateNotificationChannel`` or an + ``UpdateNotificationChannel`` operation. Attributes: VERIFICATION_STATUS_UNSPECIFIED (int): Sentinel value used to indicate that the state is unknown, omitted, or diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/group_service_client.py b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/group_service_client.py index f2d281dea0cf..3989e87c12e2 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/group_service_client.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/group_service_client.py @@ -49,17 +49,16 @@ class GroupServiceClient(object): """ The Group API lets you inspect and manage your - `groups `_. - - A group is a named filter that is used to identify - a collection of monitored resources. Groups are typically used to - mirror the physical and/or logical topology of the environment. - Because group membership is computed dynamically, monitored - resources that are started in the future are automatically placed - in matching groups. By using a group to name monitored resources in, - for example, an alert policy, the target of that alert policy is - updated automatically as monitored resources are added and removed - from the infrastructure. + `groups <#google.monitoring.v3.Group>`__. + + A group is a named filter that is used to identify a collection of + monitored resources. Groups are typically used to mirror the physical + and/or logical topology of the environment. Because group membership is + computed dynamically, monitored resources that are started in the future + are automatically placed in matching groups. By using a group to name + monitored resources in, for example, an alert policy, the target of that + alert policy is updated automatically as monitored resources are added + and removed from the infrastructure. """ SERVICE_ADDRESS = 'monitoring.googleapis.com:443' @@ -176,9 +175,10 @@ def __init__(self, ) if client_info is None: - client_info = ( - google.api_core.gapic_v1.client_info.DEFAULT_CLIENT_INFO) - client_info.gapic_version = _GAPIC_LIBRARY_VERSION + 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 @@ -223,24 +223,24 @@ def list_groups(self, >>> # Alternatively: >>> >>> # Iterate over results one page at a time - >>> for page in client.list_groups(name, options=CallOptions(page_token=INITIAL_PAGE)): + >>> for page in client.list_groups(name).pages: ... for element in page: ... # process element ... pass Args: name (str): The project whose groups are to be listed. The format is - ``\"projects/{project_id_or_number}\"``. - children_of_group (str): A group name: ``\"projects/{project_id_or_number}/groups/{group_id}\"``. - Returns groups whose ``parentName`` field contains the group - name. If no groups have this parent, the results are empty. - ancestors_of_group (str): A group name: ``\"projects/{project_id_or_number}/groups/{group_id}\"``. - Returns groups that are ancestors of the specified group. - The groups are returned in order, starting with the immediate parent and - ending with the most distant ancestor. If the specified group has no - immediate parent, the results are empty. - descendants_of_group (str): A group name: ``\"projects/{project_id_or_number}/groups/{group_id}\"``. - Returns the descendants of the specified group. This is a superset of + ``"projects/{project_id_or_number}"``. + children_of_group (str): A group name: ``"projects/{project_id_or_number}/groups/{group_id}"``. + Returns groups whose ``parentName`` field contains the group name. If no + groups have this parent, the results are empty. + ancestors_of_group (str): A group name: ``"projects/{project_id_or_number}/groups/{group_id}"``. + Returns groups that are ancestors of the specified group. The groups are + returned in order, starting with the immediate parent and ending with + the most distant ancestor. If the specified group has no immediate + parent, the results are empty. + descendants_of_group (str): A group name: ``"projects/{project_id_or_number}/groups/{group_id}"``. + Returns the descendants of the specified group. This is a superset of the results returned by the ``childrenOfGroup`` filter, and includes children-of-children, and so forth. page_size (int): The maximum number of resources contained in the @@ -331,7 +331,7 @@ def get_group(self, Args: name (str): The group to retrieve. The format is - ``\"projects/{project_id_or_number}/groups/{group_id}\"``. + ``"projects/{project_id_or_number}/groups/{group_id}"``. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will not be retried. @@ -385,16 +385,17 @@ def create_group(self, >>> >>> name = client.project_path('[PROJECT]') >>> - >>> # TODO: Initialize ``group``: + >>> # TODO: Initialize `group`: >>> group = {} >>> >>> response = client.create_group(name, group) Args: name (str): The project in which to create the group. The format is - ``\"projects/{project_id_or_number}\"``. + ``"projects/{project_id_or_number}"``. group (Union[dict, ~google.cloud.monitoring_v3.types.Group]): A group definition. It is an error to define the ``name`` field because the system assigns the name. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.monitoring_v3.types.Group` validate_only (bool): If true, validate this request but do not create the group. @@ -446,22 +447,24 @@ def update_group(self, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None): """ - Updates an existing group. - You can change any group attributes except ``name``. + Updates an existing group. You can change any group attributes except + ``name``. Example: >>> from google.cloud import monitoring_v3 >>> >>> client = monitoring_v3.GroupServiceClient() >>> - >>> # TODO: Initialize ``group``: + >>> # TODO: Initialize `group`: >>> group = {} >>> >>> response = client.update_group(group) Args: - group (Union[dict, ~google.cloud.monitoring_v3.types.Group]): The new definition of the group. All fields of the existing group, - excepting ``name``, are replaced with the corresponding fields of this group. + group (Union[dict, ~google.cloud.monitoring_v3.types.Group]): The new definition of the group. All fields of the existing group, + excepting ``name``, are replaced with the corresponding fields of this + group. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.monitoring_v3.types.Group` validate_only (bool): If true, validate this request but do not update the existing group. @@ -524,7 +527,7 @@ def delete_group(self, Args: name (str): The group to delete. The format is - ``\"projects/{project_id_or_number}/groups/{group_id}\"``. + ``"projects/{project_id_or_number}/groups/{group_id}"``. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will not be retried. @@ -586,32 +589,34 @@ def list_group_members(self, >>> # Alternatively: >>> >>> # Iterate over results one page at a time - >>> for page in client.list_group_members(name, options=CallOptions(page_token=INITIAL_PAGE)): + >>> for page in client.list_group_members(name).pages: ... for element in page: ... # process element ... pass Args: name (str): The group whose members are listed. The format is - ``\"projects/{project_id_or_number}/groups/{group_id}\"``. + ``"projects/{project_id_or_number}/groups/{group_id}"``. 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. - filter_ (str): An optional `list filter `_ describing - the members to be returned. The filter may reference the type, labels, and - metadata of monitored resources that comprise the group. - For example, to return only resources representing Compute Engine VM - instances, use this filter: + filter_ (str): An optional `list + filter `__ + describing the members to be returned. The filter may reference the + type, labels, and metadata of monitored resources that comprise the + group. For example, to return only resources representing Compute Engine + VM instances, use this filter: :: - resource.type = \"gce_instance\" + resource.type = "gce_instance" interval (Union[dict, ~google.cloud.monitoring_v3.types.TimeInterval]): An optional time interval for which results should be returned. Only members that were part of the group during the specified interval are included in the response. If no interval is provided then the group membership over the last minute is returned. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.monitoring_v3.types.TimeInterval` retry (Optional[google.api_core.retry.Retry]): A retry object used diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/group_service_client_config.py b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/group_service_client_config.py index 18788b255fbc..72f991f41f9d 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/group_service_client_config.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/group_service_client_config.py @@ -18,32 +18,32 @@ }, "methods": { "ListGroups": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetGroup": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "CreateGroup": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateGroup": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "DeleteGroup": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListGroupMembers": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", "retry_params_name": "default" } diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/metric_service_client.py b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/metric_service_client.py index 8627384c01d8..cc118571e80f 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/metric_service_client.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/metric_service_client.py @@ -180,9 +180,10 @@ def __init__(self, ) if client_info is None: - client_info = ( - google.api_core.gapic_v1.client_info.DEFAULT_CLIENT_INFO) - client_info.gapic_version = _GAPIC_LIBRARY_VERSION + 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 @@ -226,23 +227,23 @@ def list_monitored_resource_descriptors( >>> # Alternatively: >>> >>> # Iterate over results one page at a time - >>> for page in client.list_monitored_resource_descriptors(name, options=CallOptions(page_token=INITIAL_PAGE)): + >>> for page in client.list_monitored_resource_descriptors(name).pages: ... for element in page: ... # process element ... pass Args: name (str): The project on which to execute the request. The format is - ``\"projects/{project_id_or_number}\"``. - filter_ (str): An optional `filter `_ describing - the descriptors to be returned. The filter can reference - the descriptor's type and labels. For example, the - following filter returns only Google Compute Engine descriptors - that have an ``id`` label: + ``"projects/{project_id_or_number}"``. + filter_ (str): An optional + `filter `__ + describing the descriptors to be returned. The filter can reference the + descriptor's type and labels. For example, the following filter returns + only Google Compute Engine descriptors that have an ``id`` label: :: - resource.type = starts_with(\"gce_\") AND resource.label:id + resource.type = starts_with("gce_") AND resource.label:id 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 @@ -323,8 +324,8 @@ def get_monitored_resource_descriptor( >>> response = client.get_monitored_resource_descriptor(name) Args: - name (str): The monitored resource descriptor to get. The format is - ``\"projects/{project_id_or_number}/monitoredResourceDescriptors/{resource_type}\"``. + name (str): The monitored resource descriptor to get. The format is + ``"projects/{project_id_or_number}/monitoredResourceDescriptors/{resource_type}"``. The ``{resource_type}`` is a predefined type, such as ``cloudsql_database``. retry (Optional[google.api_core.retry.Retry]): A retry object used @@ -393,24 +394,24 @@ def list_metric_descriptors( >>> # Alternatively: >>> >>> # Iterate over results one page at a time - >>> for page in client.list_metric_descriptors(name, options=CallOptions(page_token=INITIAL_PAGE)): + >>> for page in client.list_metric_descriptors(name).pages: ... for element in page: ... # process element ... pass Args: name (str): The project on which to execute the request. The format is - ``\"projects/{project_id_or_number}\"``. - filter_ (str): If this field is empty, all custom and - system-defined metric descriptors are returned. - Otherwise, the `filter `_ - specifies which metric descriptors are to be - returned. For example, the following filter matches all - `custom metrics `_: + ``"projects/{project_id_or_number}"``. + filter_ (str): If this field is empty, all custom and system-defined metric descriptors + are returned. Otherwise, the + `filter `__ + specifies which metric descriptors are to be returned. For example, the + following filter matches all `custom + metrics `__: :: - metric.type = starts_with(\"custom.googleapis.com/\") + metric.type = starts_with("custom.googleapis.com/") 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 @@ -491,9 +492,9 @@ def get_metric_descriptor(self, Args: name (str): The metric descriptor on which to execute the request. The format is - ``\"projects/{project_id_or_number}/metricDescriptors/{metric_id}\"``. - An example value of ``{metric_id}`` is - ``\"compute.googleapis.com/instance/disk/read_bytes_count\"``. + ``"projects/{project_id_or_number}/metricDescriptors/{metric_id}"``. An + example value of ``{metric_id}`` is + ``"compute.googleapis.com/instance/disk/read_bytes_count"``. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will not be retried. @@ -540,9 +541,8 @@ def create_metric_descriptor( timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None): """ - Creates a new metric descriptor. - User-created metric descriptors define - `custom metrics `_. + Creates a new metric descriptor. User-created metric descriptors define + `custom metrics `__. Example: >>> from google.cloud import monitoring_v3 @@ -551,16 +551,18 @@ def create_metric_descriptor( >>> >>> name = client.project_path('[PROJECT]') >>> - >>> # TODO: Initialize ``metric_descriptor``: + >>> # TODO: Initialize `metric_descriptor`: >>> metric_descriptor = {} >>> >>> response = client.create_metric_descriptor(name, metric_descriptor) Args: name (str): The project on which to execute the request. The format is - ``\"projects/{project_id_or_number}\"``. - metric_descriptor (Union[dict, ~google.cloud.monitoring_v3.types.MetricDescriptor]): The new `custom metric `_ + ``"projects/{project_id_or_number}"``. + metric_descriptor (Union[dict, ~google.cloud.monitoring_v3.types.MetricDescriptor]): The new `custom + metric `__ descriptor. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.monitoring_v3.types.MetricDescriptor` retry (Optional[google.api_core.retry.Retry]): A retry object used @@ -611,8 +613,9 @@ def delete_metric_descriptor( timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None): """ - Deletes a metric descriptor. Only user-created - `custom metrics `_ can be deleted. + Deletes a metric descriptor. Only user-created `custom + metrics `__ can be + deleted. Example: >>> from google.cloud import monitoring_v3 @@ -625,9 +628,9 @@ def delete_metric_descriptor( Args: name (str): The metric descriptor on which to execute the request. The format is - ``\"projects/{project_id_or_number}/metricDescriptors/{metric_id}\"``. - An example of ``{metric_id}`` is: - ``\"custom.googleapis.com/my_test_metric\"``. + ``"projects/{project_id_or_number}/metricDescriptors/{metric_id}"``. An + example of ``{metric_id}`` is: + ``"custom.googleapis.com/my_test_metric"``. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will not be retried. @@ -685,13 +688,13 @@ def list_time_series(self, >>> >>> name = client.project_path('[PROJECT]') >>> - >>> # TODO: Initialize ``filter_``: + >>> # TODO: Initialize `filter_`: >>> filter_ = '' >>> - >>> # TODO: Initialize ``interval``: + >>> # TODO: Initialize `interval`: >>> interval = {} >>> - >>> # TODO: Initialize ``view``: + >>> # TODO: Initialize `view`: >>> view = enums.ListTimeSeriesRequest.TimeSeriesView.FULL >>> >>> # Iterate over all results @@ -703,32 +706,35 @@ def list_time_series(self, >>> # Alternatively: >>> >>> # Iterate over results one page at a time - >>> for page in client.list_time_series(name, filter_, interval, view, options=CallOptions(page_token=INITIAL_PAGE)): + >>> for page in client.list_time_series(name, filter_, interval, view).pages: ... for element in page: ... # process element ... pass Args: name (str): The project on which to execute the request. The format is - \"projects/{project_id_or_number}\". - filter_ (str): A `monitoring filter `_ that specifies which time - series should be returned. The filter must specify a single metric type, - and can additionally specify metric labels and other information. For - example: + "projects/{project\_id\_or\_number}". + filter_ (str): A `monitoring + filter `__ that + specifies which time series should be returned. The filter must specify + a single metric type, and can additionally specify metric labels and + other information. For example: :: - metric.type = \"compute.googleapis.com/instance/cpu/usage_time\" AND - metric.label.instance_name = \"my-instance-name\" + metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND + metric.label.instance_name = "my-instance-name" interval (Union[dict, ~google.cloud.monitoring_v3.types.TimeInterval]): The time interval for which results should be returned. Only time series that contain data points in the specified interval are included in the response. + 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. + 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 @@ -816,19 +822,20 @@ def create_time_series(self, >>> >>> name = client.project_path('[PROJECT]') >>> - >>> # TODO: Initialize ``time_series``: + >>> # TODO: Initialize `time_series`: >>> time_series = [] >>> >>> client.create_time_series(name, time_series) Args: name (str): The project on which to execute the request. The format is - ``\"projects/{project_id_or_number}\"``. - time_series (list[Union[dict, ~google.cloud.monitoring_v3.types.TimeSeries]]): The new data to be added to a list of time series. - Adds at most one data point to each of several time series. The new data - point must be more recent than any other point in its time series. Each - ``TimeSeries`` value must fully specify a unique time series by supplying - all label values for the metric and the monitored resource. + ``"projects/{project_id_or_number}"``. + time_series (list[Union[dict, ~google.cloud.monitoring_v3.types.TimeSeries]]): The new data to be added to a list of time series. Adds at most one data + point to each of several time series. The new data point must be more + recent than any other point in its time series. Each ``TimeSeries`` + value must fully specify a unique time series by supplying all label + values for the metric and the monitored resource. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.monitoring_v3.types.TimeSeries` retry (Optional[google.api_core.retry.Retry]): A retry object used diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/metric_service_client_config.py b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/metric_service_client_config.py index 24353b5c4f7a..ad1c5ec4e5d9 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/metric_service_client_config.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/metric_service_client_config.py @@ -18,42 +18,42 @@ }, "methods": { "ListMonitoredResourceDescriptors": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetMonitoredResourceDescriptor": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListMetricDescriptors": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetMetricDescriptor": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "CreateMetricDescriptor": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DeleteMetricDescriptor": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListTimeSeries": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "CreateTimeSeries": { - "timeout_millis": 60000, + "timeout_millis": 12000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" } diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client.py b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client.py index 79780adcaaef..21443f67e74a 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client.py @@ -183,9 +183,10 @@ def __init__( ) if client_info is None: - client_info = ( - google.api_core.gapic_v1.client_info.DEFAULT_CLIENT_INFO) - client_info.gapic_version = _GAPIC_LIBRARY_VERSION + 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 @@ -229,23 +230,22 @@ def list_notification_channel_descriptors( >>> # Alternatively: >>> >>> # Iterate over results one page at a time - >>> for page in client.list_notification_channel_descriptors(name, options=CallOptions(page_token=INITIAL_PAGE)): + >>> for page in client.list_notification_channel_descriptors(name).pages: ... for element in page: ... # process element ... pass Args: - name (str): The REST resource name of the parent from which to retrieve - the notification channel descriptors. The expected syntax is: + name (str): The REST resource name of the parent from which to retrieve the + notification channel descriptors. The expected syntax is: :: - projects/[PROJECT_ID] + projects/[PROJECT_ID] Note that this names the parent container in which to look for the descriptors; to retrieve a single descriptor by name, use the - ``GetNotificationChannelDescriptor`` - operation, instead. + ``GetNotificationChannelDescriptor`` operation, instead. 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 @@ -395,29 +395,28 @@ def list_notification_channels( >>> # Alternatively: >>> >>> # Iterate over results one page at a time - >>> for page in client.list_notification_channels(name, options=CallOptions(page_token=INITIAL_PAGE)): + >>> for page in client.list_notification_channels(name).pages: ... for element in page: ... # process element ... pass Args: name (str): The project on which to execute the request. The format is - ``projects/[PROJECT_ID]``. That is, this names the container - in which to look for the notification channels; it does not name a - specific channel. To query a specific channel by REST resource name, use - the - ````GetNotificationChannel```` operation. + ``projects/[PROJECT_ID]``. That is, this names the container in which to + look for the notification channels; it does not name a specific channel. + To query a specific channel by REST resource name, use the + ``GetNotificationChannel`` operation. filter_ (str): If provided, this field specifies the criteria that must be met by notification channels to be included in the response. - For more details, see [sorting and - filtering](/monitoring/api/v3/sorting-and-filtering). + For more details, see `sorting and + filtering `__. order_by (str): A comma-separated list of fields by which to sort the result. Supports - the same set of fields as in ``filter``. Entries can be prefixed with - a minus sign to sort in descending rather than ascending order. + the same set of fields as in ``filter``. Entries can be prefixed with a + minus sign to sort in descending rather than ascending order. - For more details, see [sorting and - filtering](/monitoring/api/v3/sorting-and-filtering). + For more details, see `sorting and + filtering `__. 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 @@ -562,7 +561,7 @@ def create_notification_channel( >>> >>> name = client.project_path('[PROJECT]') >>> - >>> # TODO: Initialize ``notification_channel``: + >>> # TODO: Initialize `notification_channel`: >>> notification_channel = {} >>> >>> response = client.create_notification_channel(name, notification_channel) @@ -572,13 +571,15 @@ def create_notification_channel( :: - projects/[PROJECT_ID] + projects/[PROJECT_ID] Note that this names the container into which the channel will be written. This does not name the newly created channel. The resulting channel's name will have a normalized version of this field as a prefix, - but will add ``/notificationChannels/[CHANNEL_ID]`` to identify the channel. + but will add ``/notificationChannels/[CHANNEL_ID]`` to identify the + channel. notification_channel (Union[dict, ~google.cloud.monitoring_v3.types.NotificationChannel]): The definition of the ``NotificationChannel`` to create. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.monitoring_v3.types.NotificationChannel` retry (Optional[google.api_core.retry.Retry]): A retry object used @@ -638,19 +639,21 @@ def update_notification_channel( >>> >>> client = monitoring_v3.NotificationChannelServiceClient() >>> - >>> # TODO: Initialize ``notification_channel``: + >>> # TODO: Initialize `notification_channel`: >>> notification_channel = {} >>> >>> response = client.update_notification_channel(notification_channel) Args: - notification_channel (Union[dict, ~google.cloud.monitoring_v3.types.NotificationChannel]): A description of the changes to be applied to the specified - notification channel. The description must provide a definition for - fields to be updated; the names of these fields should also be - included in the ``update_mask``. + notification_channel (Union[dict, ~google.cloud.monitoring_v3.types.NotificationChannel]): A description of the changes to be applied to the specified notification + channel. The description must provide a definition for fields to be + updated; the names of these fields should also be included in the + ``update_mask``. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.monitoring_v3.types.NotificationChannel` update_mask (Union[dict, ~google.cloud.monitoring_v3.types.FieldMask]): The fields to 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 diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client_config.py b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client_config.py index 783262ba5b77..66ac6a22e25a 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client_config.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client_config.py @@ -3,7 +3,6 @@ "google.monitoring.v3.NotificationChannelService": { "retry_codes": { "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "no_retry": [], "non_idempotent": [] }, "retry_params": { @@ -19,37 +18,37 @@ }, "methods": { "ListNotificationChannelDescriptors": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetNotificationChannelDescriptor": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListNotificationChannels": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetNotificationChannel": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "CreateNotificationChannel": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateNotificationChannel": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DeleteNotificationChannel": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", "retry_params_name": "default" } diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/transports/alert_policy_service_grpc_transport.py b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/transports/alert_policy_service_grpc_transport.py index 1819c2d969cb..5ed98ac8741d 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/transports/alert_policy_service_grpc_transport.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/transports/alert_policy_service_grpc_transport.py @@ -157,10 +157,10 @@ def delete_alert_policy(self): def update_alert_policy(self): """Return the gRPC stub for {$apiMethod.name}. - Updates an alerting policy. You can either replace the entire policy with - a new one or replace only certain fields in the current alerting policy by - specifying the fields to be updated via ``updateMask``. Returns the - updated alerting policy. + Updates an alerting policy. You can either replace the entire policy + with a new one or replace only certain fields in the current alerting + policy by specifying the fields to be updated via ``updateMask``. + Returns the updated alerting policy. Returns: Callable: A callable which accepts the appropriate diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/transports/group_service_grpc_transport.py b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/transports/group_service_grpc_transport.py index 977a4d1d9c20..1309c1f36458 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/transports/group_service_grpc_transport.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/transports/group_service_grpc_transport.py @@ -144,8 +144,8 @@ def create_group(self): def update_group(self): """Return the gRPC stub for {$apiMethod.name}. - Updates an existing group. - You can change any group attributes except ``name``. + Updates an existing group. You can change any group attributes except + ``name``. Returns: Callable: A callable which accepts the appropriate diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/transports/metric_service_grpc_transport.py b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/transports/metric_service_grpc_transport.py index a8945ca5430e..04ee8f9a3c3d 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/transports/metric_service_grpc_transport.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/transports/metric_service_grpc_transport.py @@ -159,9 +159,8 @@ def get_metric_descriptor(self): def create_metric_descriptor(self): """Return the gRPC stub for {$apiMethod.name}. - Creates a new metric descriptor. - User-created metric descriptors define - `custom metrics `_. + Creates a new metric descriptor. User-created metric descriptors define + `custom metrics `__. Returns: Callable: A callable which accepts the appropriate @@ -174,8 +173,9 @@ def create_metric_descriptor(self): def delete_metric_descriptor(self): """Return the gRPC stub for {$apiMethod.name}. - Deletes a metric descriptor. Only user-created - `custom metrics `_ can be deleted. + Deletes a metric descriptor. Only user-created `custom + metrics `__ can be + deleted. Returns: Callable: A callable which accepts the appropriate diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/transports/uptime_check_service_grpc_transport.py b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/transports/uptime_check_service_grpc_transport.py index 0fc2b8374506..80a3e6f7ca5d 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/transports/uptime_check_service_grpc_transport.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/transports/uptime_check_service_grpc_transport.py @@ -146,9 +146,9 @@ def update_uptime_check_config(self): """Return the gRPC stub for {$apiMethod.name}. Updates an uptime check configuration. You can either replace the entire - configuration with a new one or replace only certain fields in the current - configuration by specifying the fields to be updated via ``\"updateMask\"``. - Returns the updated configuration. + configuration with a new one or replace only certain fields in the + current configuration by specifying the fields to be updated via + ``"updateMask"``. Returns the updated configuration. Returns: Callable: A callable which accepts the appropriate diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/uptime_check_service_client.py b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/uptime_check_service_client.py index fd97e1f1ff05..2328132ec8d8 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/uptime_check_service_client.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic/uptime_check_service_client.py @@ -58,14 +58,14 @@ class UptimeCheckServiceClient(object): """ - The UptimeCheckService API is used to manage (list, create, delete, edit) - uptime check configurations in the Stackdriver Monitoring product. An uptime - check is a piece of configuration that determines which resources and - services to monitor for availability. These configurations can also be - configured interactively by navigating to the [Cloud Console] - (http://console.cloud.google.com), selecting the appropriate project, - clicking on \"Monitoring\" on the left-hand side to navigate to Stackdriver, - and then clicking on \"Uptime\". + The UptimeCheckService API is used to manage (list, create, delete, + edit) uptime check configurations in the Stackdriver Monitoring product. + An uptime check is a piece of configuration that determines which + resources and services to monitor for availability. These configurations + can also be configured interactively by navigating to the [Cloud + Console] (http://console.cloud.google.com), selecting the appropriate + project, clicking on "Monitoring" on the left-hand side to navigate to + Stackdriver, and then clicking on "Uptime". """ SERVICE_ADDRESS = 'monitoring.googleapis.com:443' @@ -182,9 +182,10 @@ def __init__(self, ) if client_info is None: - client_info = ( - google.api_core.gapic_v1.client_info.DEFAULT_CLIENT_INFO) - client_info.gapic_version = _GAPIC_LIBRARY_VERSION + 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 @@ -228,14 +229,14 @@ def list_uptime_check_configs( >>> # Alternatively: >>> >>> # Iterate over results one page at a time - >>> for page in client.list_uptime_check_configs(parent, options=CallOptions(page_token=INITIAL_PAGE)): + >>> for page in client.list_uptime_check_configs(parent).pages: ... for element in page: ... # process element ... pass Args: - parent (str): The project whose uptime check configurations are listed. The format - is ``projects/[PROJECT_ID]``. + parent (str): The project whose uptime check configurations are listed. The format is + ``projects/[PROJECT_ID]``. 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 @@ -315,8 +316,8 @@ def get_uptime_check_config( >>> response = client.get_uptime_check_config(name) Args: - name (str): The uptime check configuration to retrieve. The format - is ``projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID]``. + name (str): The uptime check configuration to retrieve. The format is + ``projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID]``. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will not be retried. @@ -372,15 +373,16 @@ def create_uptime_check_config( >>> >>> parent = client.project_path('[PROJECT]') >>> - >>> # TODO: Initialize ``uptime_check_config``: + >>> # TODO: Initialize `uptime_check_config`: >>> uptime_check_config = {} >>> >>> response = client.create_uptime_check_config(parent, uptime_check_config) Args: - parent (str): The project in which to create the uptime check. The format - is ``projects/[PROJECT_ID]``. + parent (str): The project in which to create the uptime check. The format is + ``projects/[PROJECT_ID]``. uptime_check_config (Union[dict, ~google.cloud.monitoring_v3.types.UptimeCheckConfig]): The new uptime check configuration. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.monitoring_v3.types.UptimeCheckConfig` retry (Optional[google.api_core.retry.Retry]): A retry object used @@ -433,38 +435,40 @@ def update_uptime_check_config( metadata=None): """ Updates an uptime check configuration. You can either replace the entire - configuration with a new one or replace only certain fields in the current - configuration by specifying the fields to be updated via ``\"updateMask\"``. - Returns the updated configuration. + configuration with a new one or replace only certain fields in the + current configuration by specifying the fields to be updated via + ``"updateMask"``. Returns the updated configuration. Example: >>> from google.cloud import monitoring_v3 >>> >>> client = monitoring_v3.UptimeCheckServiceClient() >>> - >>> # TODO: Initialize ``uptime_check_config``: + >>> # TODO: Initialize `uptime_check_config`: >>> uptime_check_config = {} >>> >>> response = client.update_uptime_check_config(uptime_check_config) Args: - uptime_check_config (Union[dict, ~google.cloud.monitoring_v3.types.UptimeCheckConfig]): Required. If an ``\"updateMask\"`` has been specified, this field gives - the values for the set of fields mentioned in the ``\"updateMask\"``. If an - ``\"updateMask\"`` has not been given, this uptime check configuration replaces - the current configuration. If a field is mentioned in ``\"updateMask\"`` but - the corresonding field is omitted in this partial uptime check - configuration, it has the effect of deleting/clearing the field from the - configuration on the server. - - The following fields can be updated: ``display_name``, - ``http_check``, ``tcp_check``, ``timeout``, ``content_matchers``, and + uptime_check_config (Union[dict, ~google.cloud.monitoring_v3.types.UptimeCheckConfig]): Required. If an ``"updateMask"`` has been specified, this field gives + the values for the set of fields mentioned in the ``"updateMask"``. If + an ``"updateMask"`` has not been given, this uptime check configuration + replaces the current configuration. If a field is mentioned in + ``"updateMask"`` but the corresonding field is omitted in this partial + uptime check configuration, it has the effect of deleting/clearing the + field from the configuration on the server. + + The following fields can be updated: ``display_name``, ``http_check``, + ``tcp_check``, ``timeout``, ``content_matchers``, and ``selected_regions``. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.monitoring_v3.types.UptimeCheckConfig` update_mask (Union[dict, ~google.cloud.monitoring_v3.types.FieldMask]): Optional. If present, only the listed fields in the current uptime check configuration are updated with values from the new configuration. If this field is empty, then the current configuration is completely replaced with the new configuration. + 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 @@ -529,8 +533,8 @@ def delete_uptime_check_config( >>> client.delete_uptime_check_config(name) Args: - name (str): The uptime check configuration to delete. The format - is ``projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID]``. + name (str): The uptime check configuration to delete. The format is + ``projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID]``. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will not be retried. @@ -589,7 +593,7 @@ def list_uptime_check_ips(self, >>> # Alternatively: >>> >>> # Iterate over results one page at a time - >>> for page in client.list_uptime_check_ips(options=CallOptions(page_token=INITIAL_PAGE)): + >>> for page in client.list_uptime_check_ips().pages: ... for element in page: ... # process element ... pass