From ee50c3b3cfc38a716c3f69ef05c4faa9e20566ac Mon Sep 17 00:00:00 2001 From: The Magician Date: Mon, 11 Nov 2019 11:08:19 -0800 Subject: [PATCH] Bug fixes for GCP modules (#64587) --- .../cloud/google/gcp_logging_metric.py | 19 +++++++++++++++++++ .../cloud/google/gcp_logging_metric_info.py | 8 ++++++++ 2 files changed, 27 insertions(+) diff --git a/lib/ansible/modules/cloud/google/gcp_logging_metric.py b/lib/ansible/modules/cloud/google/gcp_logging_metric.py index 0435d16e6bb..6e998ce5760 100644 --- a/lib/ansible/modules/cloud/google/gcp_logging_metric.py +++ b/lib/ansible/modules/cloud/google/gcp_logging_metric.py @@ -130,6 +130,14 @@ options: required: false default: STRING type: str + display_name: + description: + - A concise name for the metric, which can be displayed in user interfaces. + Use sentence case without an ending period, for example "Request count". + This field is optional but it is recommended to be set for any metrics associated + with user-visible concepts, such as Quota. + required: false + type: str label_extractors: description: - A map from a label key string to an extractor expression which is used to extract @@ -371,6 +379,14 @@ metricDescriptor: - The type of data that can be assigned to the label. returned: success type: str + displayName: + description: + - A concise name for the metric, which can be displayed in user interfaces. + Use sentence case without an ending period, for example "Request count". This + field is optional but it is recommended to be set for any metrics associated + with user-visible concepts, such as Quota. + returned: success + type: str labelExtractors: description: - A map from a label key string to an extractor expression which is used to extract @@ -492,6 +508,7 @@ def main(): elements='dict', options=dict(key=dict(required=True, type='str'), description=dict(type='str'), value_type=dict(default='STRING', type='str')), ), + display_name=dict(type='str'), ), ), label_extractors=dict(type='dict'), @@ -653,6 +670,7 @@ class MetricMetricdescriptor(object): u'valueType': self.request.get('value_type'), u'metricKind': self.request.get('metric_kind'), u'labels': MetricLabelsArray(self.request.get('labels', []), self.module).to_request(), + u'displayName': self.request.get('display_name'), } ) @@ -663,6 +681,7 @@ class MetricMetricdescriptor(object): u'valueType': self.request.get(u'valueType'), u'metricKind': self.request.get(u'metricKind'), u'labels': MetricLabelsArray(self.request.get(u'labels', []), self.module).from_response(), + u'displayName': self.request.get(u'displayName'), } ) diff --git a/lib/ansible/modules/cloud/google/gcp_logging_metric_info.py b/lib/ansible/modules/cloud/google/gcp_logging_metric_info.py index bb18e7e0b3e..f5d1f6cdfa8 100644 --- a/lib/ansible/modules/cloud/google/gcp_logging_metric_info.py +++ b/lib/ansible/modules/cloud/google/gcp_logging_metric_info.py @@ -178,6 +178,14 @@ resources: - The type of data that can be assigned to the label. returned: success type: str + displayName: + description: + - A concise name for the metric, which can be displayed in user interfaces. + Use sentence case without an ending period, for example "Request count". + This field is optional but it is recommended to be set for any metrics + associated with user-visible concepts, such as Quota. + returned: success + type: str labelExtractors: description: - A map from a label key string to an extractor expression which is used to