Skip to content

Commit 67fc517

Browse files
authored
Merge branch 'time-zone-parameter' into master
2 parents 6a95380 + dfb3d95 commit 67fc517

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
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: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public class NewAzureSqlManagedInstance : ManagedInstanceCmdletBase
145145
/// Gets or sets the instance collation
146146
/// </summary>
147147
[Parameter(Mandatory = false,
148-
HelpMessage = "The collation of the Azure SQL Managed Instance to use.")]
148+
HelpMessage = "The collation of the instance to use.")]
149149
[ValidateNotNullOrEmpty]
150150
[PSArgumentCompleter(Constants.CollationSqlLatin1, Constants.CollationLatin1)]
151151
public string Collation { get; set; }
@@ -166,6 +166,15 @@ public class NewAzureSqlManagedInstance : ManagedInstanceCmdletBase
166166
[ValidateNotNullOrEmpty]
167167
[PSArgumentCompleter(ManagedInstanceProxyOverride.Proxy, ManagedInstanceProxyOverride.Redirect, ManagedInstanceProxyOverride.Default)]
168168
public string ProxyOverride { get; set; }
169+
170+
/// <summary>
171+
/// Gets or sets the instance time zone
172+
/// </summary>
173+
[Parameter(Mandatory = false,
174+
HelpMessage = "The time zone id for the instance to set.")]
175+
[ValidateNotNullOrEmpty]
176+
[PSArgumentCompleter(Constants.TimeZoneUtc)]
177+
public string TimezoneId { get; set; }
169178

170179
/// <summary>
171180
/// Gets or sets the tags to associate with the instance
@@ -260,7 +269,8 @@ public override void ExecuteCmdlet()
260269
Sku = Sku,
261270
Collation = this.Collation,
262271
PublicDataEndpointEnabled = this.PublicDataEndpointEnabled,
263-
ProxyOverride = this.ProxyOverride
272+
ProxyOverride = this.ProxyOverride,
273+
TimezoneId = this.TimezoneId,
264274
});
265275
return newEntity;
266276
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,11 @@ public class AzureSqlManagedInstanceModel
108108
/// Possible values include: 'Proxy', 'Redirect', 'Default'
109109
/// </summary>
110110
public string ProxyOverride { get; set; }
111+
112+
/// <summary>
113+
/// Gets or sets the Managed Instance time zone
114+
/// </summary>
115+
public string TimezoneId { get; set; }
116+
111117
}
112118
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ public AzureSqlManagedInstanceModel UpsertManagedInstance(AzureSqlManagedInstanc
110110
Identity = model.Identity,
111111
Collation = model.Collation,
112112
PublicDataEndpointEnabled = model.PublicDataEndpointEnabled,
113-
ProxyOverride = model.ProxyOverride
113+
ProxyOverride = model.ProxyOverride,
114+
TimezoneId = model.TimezoneId,
114115
});
115116

116117
return CreateManagedInstanceModelFromResponse(resp);
@@ -181,6 +182,7 @@ private static AzureSqlManagedInstanceModel CreateManagedInstanceModelFromRespon
181182
managedInstance.Collation = resp.Collation;
182183
managedInstance.PublicDataEndpointEnabled = resp.PublicDataEndpointEnabled;
183184
managedInstance.ProxyOverride = resp.ProxyOverride;
185+
managedInstance.TimezoneId = resp.TimezoneId;
184186

185187
Management.Internal.Resources.Models.Sku sku = new Management.Internal.Resources.Models.Sku();
186188
sku.Name = resp.Sku.Name;

0 commit comments

Comments
 (0)