From 4ffabaec783665ab0a058056123905e56af2b95d Mon Sep 17 00:00:00 2001 From: The Magician Date: Fri, 24 Apr 2020 19:16:12 -0400 Subject: [PATCH] Sql user label (#3422) (#389) * Add user labels kv map to sql instance * Add userLabels to sql instance Signed-off-by: Modular Magician --- docs/resources/google_sql_database_instance.md | 2 ++ libraries/google/sql/property/databaseinstance_settings.rb | 3 +++ 2 files changed, 5 insertions(+) diff --git a/docs/resources/google_sql_database_instance.md b/docs/resources/google_sql_database_instance.md index c55bad9e0..bce517215 100644 --- a/docs/resources/google_sql_database_instance.md +++ b/docs/resources/google_sql_database_instance.md @@ -169,6 +169,8 @@ Properties that can be accessed from the `google_sql_database_instance` resource * `settings_version`: The version of instance settings. This is a required field for update method to make sure concurrent updates are handled properly. During update, use the most recent settingsVersion value for this instance and do not try to update this value. + * `user_labels`: User-provided labels, represented as a dictionary where each label is a single key value pair. + * `gce_zone`: The Compute Engine zone that the instance is currently serving from. This value could be different from the zone that was specified when the instance was created if the instance has failed over to its secondary zone. * `state`: The current serving state of the database instance. diff --git a/libraries/google/sql/property/databaseinstance_settings.rb b/libraries/google/sql/property/databaseinstance_settings.rb index c5be8856e..87282776f 100644 --- a/libraries/google/sql/property/databaseinstance_settings.rb +++ b/libraries/google/sql/property/databaseinstance_settings.rb @@ -33,6 +33,8 @@ class DatabaseInstanceSettings attr_reader :settings_version + attr_reader :user_labels + def initialize(args = nil, parent_identifier = nil) return if args.nil? @parent_identifier = parent_identifier @@ -42,6 +44,7 @@ def initialize(args = nil, parent_identifier = nil) @availability_type = args['availabilityType'] @backup_configuration = GoogleInSpec::SQL::Property::DatabaseInstanceSettingsBackupConfiguration.new(args['backupConfiguration'], to_s) @settings_version = args['settingsVersion'] + @user_labels = args['userLabels'] end def to_s