diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring/_dataframe.py b/packages/google-cloud-monitoring/google/cloud/monitoring/_dataframe.py index bdd1f90f46f2..5c0d89bb6ddb 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring/_dataframe.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring/_dataframe.py @@ -34,7 +34,7 @@ def _build_dataframe(time_series_iterable, :param time_series_iterable: An iterable (e.g., a query object) yielding time series. - :type label: string or None + :type label: str or None :param label: The label name to use for the dataframe header. This can be the name of a resource label or metric label (e.g., ``"instance_name"``), or diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring/client.py b/packages/google-cloud-monitoring/google/cloud/monitoring/client.py index 5aefce1972d1..1d986fa26e89 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring/client.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring/client.py @@ -50,7 +50,7 @@ class Client(JSONClient): """Client to bundle configuration needed for API requests. - :type project: string + :type project: str :param project: The target project. If not passed, falls back to the default inferred from the environment. @@ -80,7 +80,7 @@ def query(self, >>> query = client.query(minutes=5) >>> print(query.as_dataframe()) # Requires pandas. - :type metric_type: string + :type metric_type: str :param metric_type: The metric type name. The default value is :data:`Query.DEFAULT_METRIC_TYPE `, @@ -158,19 +158,19 @@ def metric_descriptor(self, type_, ... description='Cumulative count of HTTP responses.') >>> descriptor.create() - :type type_: string + :type type_: str :param type_: The metric type including a DNS name prefix. For example: ``"custom.googleapis.com/my_metric"`` - :type metric_kind: string + :type metric_kind: str :param metric_kind: The kind of measurement. It must be one of :data:`MetricKind.GAUGE`, :data:`MetricKind.DELTA`, or :data:`MetricKind.CUMULATIVE`. See :class:`~google.cloud.monitoring.metric.MetricKind`. - :type value_type: string + :type value_type: str :param value_type: The value type of the metric. It must be one of :data:`ValueType.BOOL`, :data:`ValueType.INT64`, @@ -184,13 +184,13 @@ def metric_descriptor(self, type_, A sequence of zero or more label descriptors specifying the labels used to identify a specific instance of this metric. - :type unit: string + :type unit: str :param unit: An optional unit in which the metric value is reported. - :type description: string + :type description: str :param description: An optional detailed description of the metric. - :type display_name: string + :type display_name: str :param display_name: An optional concise name for the metric. :rtype: :class:`MetricDescriptor` @@ -221,7 +221,7 @@ def metric(type_, labels): ... 'status': 'successful', ... }) - :type type_: string + :type type_: str :param type_: The metric type name. :type labels: dict @@ -248,7 +248,7 @@ def resource(type_, labels): https://cloud.google.com/monitoring/api/resources - :type type_: string + :type type_: str :param type_: The monitored resource type name. :type labels: dict @@ -339,7 +339,7 @@ def fetch_metric_descriptor(self, metric_type): >>> METRIC = 'compute.googleapis.com/instance/cpu/utilization' >>> print(client.fetch_metric_descriptor(METRIC)) - :type metric_type: string + :type metric_type: str :param metric_type: The metric type name. :rtype: :class:`~google.cloud.monitoring.metric.MetricDescriptor` @@ -362,12 +362,12 @@ def list_metric_descriptors(self, filter_string=None, type_prefix=None): ... type_prefix='custom.'): ... print(descriptor.type) - :type filter_string: string or None + :type filter_string: str or None :param filter_string: An optional filter expression describing the metric descriptors to be returned. See the `filter documentation`_. - :type type_prefix: string or None + :type type_prefix: str or None :param type_prefix: An optional prefix constraining the selected metric types. This adds ``metric.type = starts_with("")`` to the filter. @@ -389,7 +389,7 @@ def fetch_resource_descriptor(self, resource_type): >>> print(client.fetch_resource_descriptor('gce_instance')) - :type resource_type: string + :type resource_type: str :param resource_type: The resource type name. :rtype: :class:`~google.cloud.monitoring.resource.ResourceDescriptor` @@ -408,7 +408,7 @@ def list_resource_descriptors(self, filter_string=None): >>> for descriptor in client.list_resource_descriptors(): ... print(descriptor.type) - :type filter_string: string or None + :type filter_string: str or None :param filter_string: An optional filter expression describing the resource descriptors to be returned. See the `filter documentation`_. @@ -430,24 +430,24 @@ def group(self, group_id=None, display_name=None, parent_id=None, This will not make an HTTP request; it simply instantiates a group object owned by this client. - :type group_id: string or None + :type group_id: str or None :param group_id: The ID of the group. - :type display_name: string or None + :type display_name: str or None :param display_name: A user-assigned name for this group, used only for display purposes. - :type parent_id: string or None + :type parent_id: str or None :param parent_id: The ID of the group's parent, if it has one. - :type filter_string: string or None + :type filter_string: str or None :param filter_string: The filter string used to determine which monitored resources belong to this group. - :type is_cluster: boolean + :type is_cluster: bool :param is_cluster: If true, the members of this group are considered to be a cluster. The system can perform additional analysis on groups that are @@ -478,7 +478,7 @@ def fetch_group(self, group_id): >>> except google.cloud.exceptions.NotFound: >>> print('That group does not exist!') - :type group_id: string + :type group_id: str :param group_id: The ID of the group. :rtype: :class:`~google.cloud.monitoring.group.Group` diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring/connection.py b/packages/google-cloud-monitoring/google/cloud/monitoring/connection.py index aa00e004f05c..8b7200391161 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring/connection.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring/connection.py @@ -27,7 +27,7 @@ class Connection(base_connection.JSONConnection): :type http: :class:`httplib2.Http` or class that defines ``request()`` :param http: (Optional) HTTP object to make requests. - :type api_base_url: string + :type api_base_url: str :param api_base_url: The base of the API call URL. Defaults to the value :attr:`Connection.API_BASE_URL`. """ diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring/group.py b/packages/google-cloud-monitoring/google/cloud/monitoring/group.py index a708a579ba52..7779585301fa 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring/group.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring/group.py @@ -38,14 +38,14 @@ def _group_id_from_name(path, project=None): """Validate a group URI path and get the group ID. - :type path: string + :type path: str :param path: URI path for a group API request. - :type project: string or None + :type project: str or None :param project: The project associated with the request. It is included for validation purposes. - :rtype: string + :rtype: str :returns: Group ID parsed from ``path``. :raises: :class:`ValueError` if the ``path`` is ill-formed or if the project from the ``path`` does not agree with the @@ -57,13 +57,13 @@ def _group_id_from_name(path, project=None): def _group_name_from_id(project, group_id): """Build the group name given the project and group ID. - :type project: string + :type project: str :param project: The project associated with the group. - :type group_id: string + :type group_id: str :param group_id: The group ID. - :rtype: string + :rtype: str :returns: The fully qualified name of the group. """ return 'projects/{project}/groups/{group_id}'.format( @@ -76,23 +76,23 @@ class Group(object): :type client: :class:`google.cloud.monitoring.client.Client` :param client: A client for operating on the metric descriptor. - :type group_id: string or None + :type group_id: str or None :param group_id: The ID of the group. - :type display_name: string or None + :type display_name: str or None :param display_name: A user-assigned name for this group, used only for display purposes. - :type parent_id: string or None + :type parent_id: str or None :param parent_id: The ID of the group's parent, if it has one. - :type filter_string: string or None + :type filter_string: str or None :param filter_string: The filter string used to determine which monitored resources belong to this group. - :type is_cluster: boolean + :type is_cluster: bool :param is_cluster: If true, the members of this group are considered to be a cluster. The system can perform additional analysis on groups that are clusters. @@ -296,7 +296,7 @@ def list_members(self, filter_string=None, end_time=None, start_time=None): ... print(member) - :type filter_string: string or None + :type filter_string: str or None :param filter_string: An optional list filter describing the members to be returned. The filter may reference the type, labels, and metadata of monitored @@ -365,7 +365,7 @@ def _fetch(cls, client, group_id): :type client: :class:`google.cloud.monitoring.client.Client` :param client: The client to use. - :type group_id: string + :type group_id: str :param group_id: The group ID. :rtype: :class:`Group` @@ -386,17 +386,17 @@ def _list(cls, client, children_of_group=None, ancestors_of_group=None, :type client: :class:`google.cloud.monitoring.client.Client` :param client: The client to use. - :type children_of_group: string or None + :type children_of_group: str or None :param children_of_group: Returns groups whose parent_name field contains the group name. If no groups have this parent, the results are empty. - :type ancestors_of_group: string or None + :type ancestors_of_group: str or None :param ancestors_of_group: Returns groups that are ancestors of the specified group. If the specified group has no immediate parent, the results are empty. - :type descendants_of_group: string or None + :type descendants_of_group: str or None :param descendants_of_group: Returns the descendants of the specified group. This is a superset of the results returned by the children_of_group filter, and diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring/label.py b/packages/google-cloud-monitoring/google/cloud/monitoring/label.py index 1bc465238c6b..602a2eb99aa5 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring/label.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring/label.py @@ -35,16 +35,16 @@ class LabelValueType(object): class LabelDescriptor(object): """Schema specification and documentation for a single label. - :type key: string + :type key: str :param key: The name of the label. - :type value_type: string + :type value_type: str :param value_type: The type of the label. It must be one of :data:`LabelValueType.STRING`, :data:`LabelValueType.BOOL`, or :data:`LabelValueType.INT64`. See :class:`LabelValueType`. - :type description: string + :type description: str :param description: A human-readable description for the label. """ diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring/metric.py b/packages/google-cloud-monitoring/google/cloud/monitoring/metric.py index 69551c656ac2..f2cb5c7522d0 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring/metric.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring/metric.py @@ -68,18 +68,18 @@ class MetricDescriptor(object): :type client: :class:`google.cloud.monitoring.client.Client` :param client: A client for operating on the metric descriptor. - :type type_: string + :type type_: str :param type_: The metric type including a DNS name prefix. For example: ``"compute.googleapis.com/instance/cpu/utilization"`` - :type metric_kind: string + :type metric_kind: str :param metric_kind: The kind of measurement. It must be one of :data:`MetricKind.GAUGE`, :data:`MetricKind.DELTA`, or :data:`MetricKind.CUMULATIVE`. See :class:`MetricKind`. - :type value_type: string + :type value_type: str :param value_type: The value type of the metric. It must be one of :data:`ValueType.BOOL`, :data:`ValueType.INT64`, @@ -93,16 +93,16 @@ class MetricDescriptor(object): A sequence of zero or more label descriptors specifying the labels used to identify a specific instance of this metric. - :type unit: string + :type unit: str :param unit: An optional unit in which the metric value is reported. - :type description: string + :type description: str :param description: An optional detailed description of the metric. - :type display_name: string + :type display_name: str :param display_name: An optional concise name for the metric. - :type name: string or None + :type name: str or None :param name: The "resource name" of the metric descriptor. For example: ``"projects//metricDescriptors/"``. As @@ -176,7 +176,7 @@ def _fetch(cls, client, metric_type): :type client: :class:`google.cloud.monitoring.client.Client` :param client: The client to use. - :type metric_type: string + :type metric_type: str :param metric_type: The metric type name. :rtype: :class:`MetricDescriptor` @@ -198,12 +198,12 @@ def _list(cls, client, filter_string=None, type_prefix=None): :type client: :class:`google.cloud.monitoring.client.Client` :param client: The client to use. - :type filter_string: string or None + :type filter_string: str or None :param filter_string: An optional filter expression describing the metric descriptors to be returned. See the `filter documentation`_. - :type type_prefix: string or None + :type type_prefix: str or None :param type_prefix: An optional prefix constraining the selected metric types. This adds ``metric.type = starts_with("")`` to the filter. @@ -324,7 +324,7 @@ class Metric(collections.namedtuple('Metric', 'type labels')): :meth:`~google.cloud.monitoring.client.Client.metric` factory method of the :class:`~google.cloud.monitoring.client.Client` class. - :type type: string + :type type: str :param type: The metric type name. :type labels: dict diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring/query.py b/packages/google-cloud-monitoring/google/cloud/monitoring/query.py index 685b21e5f1a9..e51f1d0cbc72 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring/query.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring/query.py @@ -78,7 +78,7 @@ class Query(object): :type client: :class:`google.cloud.monitoring.client.Client` :param client: The client to use. - :type metric_type: string + :type metric_type: str :param metric_type: The metric type name. The default value is :data:`Query.DEFAULT_METRIC_TYPE `, @@ -199,7 +199,7 @@ def select_group(self, group_id): query = query.select_group('1234567') - :type group_id: string + :type group_id: str :param group_id: The ID of a group to filter by. :rtype: :class:`Query` @@ -362,7 +362,7 @@ def align(self, per_series_aligner, seconds=0, minutes=0, hours=0): query = query.align('ALIGN_MEAN', minutes=5) - :type per_series_aligner: string + :type per_series_aligner: str :param per_series_aligner: The approach to be used to align individual time series. For example: :data:`Aligner.ALIGN_MEAN`. See :class:`Aligner` and the descriptions of the `supported @@ -402,13 +402,13 @@ def reduce(self, cross_series_reducer, *group_by_fields): query = query.reduce(Reducer.REDUCE_MEAN, 'resource.project_id', 'resource.zone') - :type cross_series_reducer: string + :type cross_series_reducer: str :param cross_series_reducer: The approach to be used to combine time series. For example: :data:`Reducer.REDUCE_MEAN`. See :class:`Reducer` and the descriptions of the `supported reducers`_. - :type group_by_fields: strings + :type group_by_fields: strs :param group_by_fields: Fields to be preserved by the reduction. For example, specifying just ``"resource.zone"`` will result in one time series per zone. @@ -442,7 +442,7 @@ def iter(self, headers_only=False, page_size=None): for timeseries in query.iter(): ... - :type headers_only: boolean + :type headers_only: bool :param headers_only: Whether to omit the point data from the time series objects. @@ -505,7 +505,7 @@ def _build_query_params(self, headers_only=False, We use a series of key-value pairs (suitable for passing to ``urlencode``) instead of a ``dict`` to allow for repeated fields. - :type headers_only: boolean + :type headers_only: bool :param headers_only: Whether to omit the point data from the :class:`~google.cloud.monitoring.timeseries.TimeSeries` objects. @@ -513,7 +513,7 @@ def _build_query_params(self, headers_only=False, :type page_size: integer or None :param page_size: A limit on the number of points to return per page. - :type page_token: string or None + :type page_token: str or None :param page_token: A token to continue the retrieval. """ yield 'filter', self.filter @@ -575,7 +575,7 @@ def as_dataframe(self, label=None, labels=None): dataframe = query.as_dataframe( labels=['resource_type', 'instance_id']) - :type label: string or None + :type label: str or None :param label: The label name to use for the dataframe header. This can be the name of a resource label or metric label (e.g., ``"instance_name"``), or the string ``"resource_type"``. diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring/resource.py b/packages/google-cloud-monitoring/google/cloud/monitoring/resource.py index 736ce52ff6ec..e951006c1cf5 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring/resource.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring/resource.py @@ -28,20 +28,20 @@ class ResourceDescriptor(object): """Specification of a monitored resource type and its schema. - :type name: string + :type name: str :param name: The "resource name" of the monitored resource descriptor: ``"projects//monitoredResourceDescriptors/"`` - :type type_: string + :type type_: str :param type_: The monitored resource type. For example: ``"gce_instance"`` - :type display_name: string + :type display_name: str :param display_name: A concise name that might be displayed in user interfaces. - :type description: string + :type description: str :param description: A detailed description that might be used in documentation. @@ -66,7 +66,7 @@ def _fetch(cls, client, resource_type): :type client: :class:`google.cloud.monitoring.client.Client` :param client: The client to use. - :type resource_type: string + :type resource_type: str :param resource_type: The resource type name. :rtype: :class:`ResourceDescriptor` @@ -88,7 +88,7 @@ def _list(cls, client, filter_string=None): :type client: :class:`google.cloud.monitoring.client.Client` :param client: The client to use. - :type filter_string: string or None + :type filter_string: str or None :param filter_string: An optional filter expression describing the resource descriptors to be returned. See the `filter documentation`_. @@ -163,7 +163,7 @@ class Resource(collections.namedtuple('Resource', 'type labels')): :meth:`~google.cloud.monitoring.client.Client.resource` factory method of the :class:`~google.cloud.monitoring.client.Client` class. - :type type: string + :type type: str :param type: The resource type name. :type labels: dict diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring/timeseries.py b/packages/google-cloud-monitoring/google/cloud/monitoring/timeseries.py index 68dcfbcc9ad0..b46e5d830265 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring/timeseries.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring/timeseries.py @@ -44,13 +44,13 @@ class TimeSeries(collections.namedtuple( :type resource: :class:`~google.cloud.monitoring.resource.Resource` :param resource: A resource object. - :type metric_kind: string + :type metric_kind: str :param metric_kind: The kind of measurement: :data:`MetricKind.GAUGE`, :data:`MetricKind.DELTA`, or :data:`MetricKind.CUMULATIVE`. See :class:`~google.cloud.monitoring.metric.MetricKind`. - :type value_type: string + :type value_type: str :param value_type: The value type of the metric: :data:`ValueType.BOOL`, :data:`ValueType.INT64`, :data:`ValueType.DOUBLE`, @@ -176,10 +176,10 @@ def _make_typed_value(value): class Point(collections.namedtuple('Point', 'end_time start_time value')): """A single point in a time series. - :type end_time: string + :type end_time: str :param end_time: The end time in RFC3339 UTC "Zulu" format. - :type start_time: string or None + :type start_time: str or None :param start_time: An optional start time in RFC3339 UTC "Zulu" format. :type value: object