Skip to content

Commit 4b22c5a

Browse files
author
Nemanja Mijatovic (E-Search)
committed
Add support for new managed instance create parameter
1 parent 751c9bb commit 4b22c5a

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

src/Sql/Sql/Common/Constants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@ public class Constants
3232
public const string ComputeGenerationGen5 = "Gen5";
3333
public const string CollationSqlLatin1 = "SQL_Latin1_General_CP1_CI_AS";
3434
public const string CollationLatin1 = "Latin1_General_100_CS_AS_SC";
35+
public const string TimeZoneUtc = "UTC";
3536
}
3637
}

src/Sql/Sql/ManagedInstance/Cmdlet/NewAzureSqlManagedInstance.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,20 @@ public class NewAzureSqlManagedInstance : ManagedInstanceCmdletBase
143143
/// Gets or sets the instance collation
144144
/// </summary>
145145
[Parameter(Mandatory = false,
146-
HelpMessage = "The collation of the Azure SQL Managed Instance to use.")]
146+
HelpMessage = "The collation of the instance to use.")]
147147
[ValidateNotNullOrEmpty]
148148
[PSArgumentCompleter(Constants.CollationSqlLatin1, Constants.CollationLatin1)]
149149
public string Collation { get; set; }
150150

151+
/// <summary>
152+
/// Gets or sets the instance time zone
153+
/// </summary>
154+
[Parameter(Mandatory = false,
155+
HelpMessage = "The time zone id for the instance to set.")]
156+
[ValidateNotNullOrEmpty]
157+
[PSArgumentCompleter(Constants.TimeZoneUtc)]
158+
public string TimezoneId { get; set; }
159+
151160
/// <summary>
152161
/// Gets or sets the tags to associate with the instance
153162
/// </summary>

src/Sql/Sql/ManagedInstance/Model/AzureSqlManagedInstanceModel.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,10 @@ public class AzureSqlManagedInstanceModel
9797
/// Gets or sets the Managed Instance collation
9898
/// </summary>
9999
public string Collation { get; set; }
100+
101+
/// <summary>
102+
/// Gets or sets the Managed Instance time zone
103+
/// </summary>
104+
public string TimezoneId { get; set; }
100105
}
101106
}

src/Sql/Sql/ManagedInstance/Services/AzureSqlManagedInstanceAdapter.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ public AzureSqlManagedInstanceModel UpsertManagedInstance(AzureSqlManagedInstanc
107107
SubnetId = model.SubnetId,
108108
VCores = model.VCores,
109109
Identity = model.Identity,
110-
Collation = model.Collation
110+
Collation = model.Collation,
111+
TimezoneId = model.TimezoneId,
111112
});
112113

113114
return CreateManagedInstanceModelFromResponse(resp);
@@ -174,6 +175,7 @@ private static AzureSqlManagedInstanceModel CreateManagedInstanceModelFromRespon
174175
managedInstance.VCores = resp.VCores;
175176
managedInstance.StorageSizeInGB = resp.StorageSizeInGB;
176177
managedInstance.Collation = resp.Collation;
178+
managedInstance.TimezoneId = resp.TimezoneId;
177179

178180
Management.Internal.Resources.Models.Sku sku = new Management.Internal.Resources.Models.Sku();
179181
sku.Name = resp.Sku.Name;

0 commit comments

Comments
 (0)