From d84fe7ed535836373c2b9c74987a27e13ea3fe50 Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Fri, 24 Apr 2020 23:17:51 +0000 Subject: [PATCH] Sql user label (#3422) * Add user labels kv map to sql instance * Add userLabels to sql instance Signed-off-by: Modular Magician --- plugins/modules/gcp_sql_instance.py | 16 ++++++++++++++++ plugins/modules/gcp_sql_instance_info.py | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/plugins/modules/gcp_sql_instance.py b/plugins/modules/gcp_sql_instance.py index f7a299fd0..24b7bc62f 100644 --- a/plugins/modules/gcp_sql_instance.py +++ b/plugins/modules/gcp_sql_instance.py @@ -325,6 +325,13 @@ - Define the backup start time in UTC (HH:MM) . required: false type: str + user_labels: + description: + - User-provided labels, represented as a dictionary where each label is a + single key value pair. + required: false + type: dict + version_added: '2.10' project: description: - The Google Cloud Platform project to use. @@ -687,6 +694,12 @@ this value. returned: success type: int + userLabels: + description: + - User-provided labels, represented as a dictionary where each label is a single + key value pair. + returned: success + type: dict gceZone: description: - The Compute Engine zone that the instance is currently serving from. This value @@ -779,6 +792,7 @@ def main(): backup_configuration=dict( type='dict', options=dict(enabled=dict(type='bool'), binary_log_enabled=dict(type='bool'), start_time=dict(type='str')) ), + user_labels=dict(type='dict'), ), ), ) @@ -1095,6 +1109,7 @@ def to_request(self): u'tier': self.request.get('tier'), u'availabilityType': self.request.get('availability_type'), u'backupConfiguration': InstanceBackupconfiguration(self.request.get('backup_configuration', {}), self.module).to_request(), + u'userLabels': self.request.get('user_labels'), } ) @@ -1106,6 +1121,7 @@ def from_response(self): u'tier': self.request.get(u'tier'), u'availabilityType': self.request.get(u'availabilityType'), u'backupConfiguration': InstanceBackupconfiguration(self.request.get(u'backupConfiguration', {}), self.module).from_response(), + u'userLabels': self.request.get(u'userLabels'), } ) diff --git a/plugins/modules/gcp_sql_instance_info.py b/plugins/modules/gcp_sql_instance_info.py index bfb6d0beb..586769ee8 100644 --- a/plugins/modules/gcp_sql_instance_info.py +++ b/plugins/modules/gcp_sql_instance_info.py @@ -414,6 +414,12 @@ try to update this value. returned: success type: int + userLabels: + description: + - User-provided labels, represented as a dictionary where each label is + a single key value pair. + returned: success + type: dict gceZone: description: - The Compute Engine zone that the instance is currently serving from. This