Skip to content

Commit 7938863

Browse files
committed
comments from adamkr and jamestao
1 parent ed5cbe5 commit 7938863

File tree

4 files changed

+29
-24
lines changed

4 files changed

+29
-24
lines changed

src/ResourceManager/Sql/Commands.Sql/Database Backup/Cmdlet/AzureSqlDatabaseGeoBackupCmdletBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public abstract class AzureSqlDatabaseGeoBackupCmdletBase
3131
[Parameter(Mandatory = true,
3232
ValueFromPipelineByPropertyName = true,
3333
Position = 1,
34-
HelpMessage = "The name of the Azure SQL Database Server the database is in.")]
34+
HelpMessage = "The name of the Azure SQL Server the database is in.")]
3535
[ValidateNotNullOrEmpty]
3636
public string ServerName { get; set; }
3737

@@ -48,7 +48,7 @@ public abstract class AzureSqlDatabaseGeoBackupCmdletBase
4848
/// <summary>
4949
/// Initializes the adapter
5050
/// </summary>
51-
/// <param name="subscription"></param>
51+
/// <param name="subscription">The subscription to operate on</param>
5252
/// <returns></returns>
5353
protected override AzureSqlDatabaseBackupAdapter InitModelAdapter(Azure.Common.Authentication.Models.AzureSubscription subscription)
5454
{

src/ResourceManager/Sql/Commands.Sql/Database Backup/Cmdlet/AzureSqlDatabaseRestorePointCmdletBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public abstract class AzureSqlDatabaseRestorePointCmdletBase
3131
[Parameter(Mandatory = true,
3232
ValueFromPipelineByPropertyName = true,
3333
Position = 1,
34-
HelpMessage = "The name of the Azure SQL Database Server the database is in.")]
34+
HelpMessage = "The name of the Azure SQL Server the database is in.")]
3535
[ValidateNotNullOrEmpty]
3636
public string ServerName { get; set; }
3737

src/ResourceManager/Sql/Commands.Sql/Database Backup/Cmdlet/AzureSqlDeletedDatabaseBackupCmdletBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public abstract class AzureSqlDeletedDatabaseBackupCmdletBase
3232
[Parameter(Mandatory = true,
3333
ValueFromPipelineByPropertyName = true,
3434
Position = 1,
35-
HelpMessage = "The name of the Azure SQL Database Server the database is in.")]
35+
HelpMessage = "The name of the Azure SQL Server the database is in.")]
3636
[ValidateNotNullOrEmpty]
3737
public string ServerName { get; set; }
3838

@@ -59,7 +59,7 @@ public abstract class AzureSqlDeletedDatabaseBackupCmdletBase
5959
/// <summary>
6060
/// Initializes the adapter
6161
/// </summary>
62-
/// <param name="subscription"></param>
62+
/// <param name="subscription">The subscription to operate on</param>
6363
/// <returns></returns>
6464
protected override AzureSqlDatabaseBackupAdapter InitModelAdapter(Azure.Common.Authentication.Models.AzureSubscription subscription)
6565
{

src/ResourceManager/Sql/Commands.Sql/Database Backup/Cmdlet/RestoreAzureRMSqlDatabase.cs

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,34 @@ namespace Microsoft.Azure.Commands.Sql.Backup.Cmdlet
2828
public class RestoreAzureRmSqlDatabase
2929
: AzureSqlCmdletBase<Database.Model.AzureSqlDatabaseModel, AzureSqlDatabaseBackupAdapter>
3030
{
31+
32+
private const string FromPointInTimeBackupSetName = "FromPointInTimeBackup";
33+
private const string FromDeletedDatabaseBackupSetName = "FromDeletedDatabaseBackup";
34+
private const string FromGeoBackupSetName = "FromGeoBackup";
35+
3136
/// <summary>
3237
/// Gets or sets flag indicating a restore from a point-in-time backup.
3338
/// </summary>
3439
[Parameter(
35-
ParameterSetName = "FromPointInTimeBackup",
40+
ParameterSetName = FromPointInTimeBackupSetName,
3641
Mandatory = true,
3742
HelpMessage = "Restore from a point-in-time backup.")]
3843
public SwitchParameter FromPointInTimeBackup { get; set; }
3944

4045
/// <summary>
41-
/// Gets or sets flag indicating a restore of a dropped database.
46+
/// Gets or sets flag indicating a restore of a deleted database.
4247
/// </summary>
4348
[Parameter(
44-
ParameterSetName = "FromDeletedDatabaseBackup",
49+
ParameterSetName = FromDeletedDatabaseBackupSetName,
4550
Mandatory = true,
46-
HelpMessage = "Restore a dropped database.")]
51+
HelpMessage = "Restore a deleted database.")]
4752
public SwitchParameter FromDeletedDatabaseBackup { get; set; }
4853

4954
/// <summary>
5055
/// Gets or sets flag indicating a geo-restore (recover) request
5156
/// </summary>
5257
[Parameter(
53-
ParameterSetName = "FromGeoBackup",
58+
ParameterSetName = FromGeoBackupSetName,
5459
Mandatory = true,
5560
HelpMessage = "Restore from a geo backup.")]
5661
public SwitchParameter FromGeoBackup { get; set; }
@@ -59,27 +64,27 @@ public class RestoreAzureRmSqlDatabase
5964
/// Gets or sets the point in time to restore the database to
6065
/// </summary>
6166
[Parameter(
62-
ParameterSetName = "FromPointInTimeBackup",
67+
ParameterSetName = FromPointInTimeBackupSetName,
6368
Mandatory = true,
6469
HelpMessage = "The point in time to restore the database to.")]
6570
public DateTime PointInTime { get; set; }
6671

6772
/// <summary>
68-
/// Gets or sets the deletion time of the dropped database to restore.
73+
/// Gets or sets the deletion time of the deleted database to restore.
6974
/// </summary>
7075
[Parameter(
71-
ParameterSetName = "FromDeletedDatabaseBackup",
76+
ParameterSetName = FromDeletedDatabaseBackupSetName,
7277
Mandatory = true,
7378
ValueFromPipelineByPropertyName = true,
74-
HelpMessage = "The deletion date of the dropped database to restore.")]
79+
HelpMessage = "The deletion date of the deleted database to restore.")]
7580
public DateTime DeletionDate { get; set; }
7681

7782
/// <summary>
7883
/// Gets or sets the name of the database server to use.
7984
/// </summary>
8085
[Parameter(Mandatory = true,
8186
ValueFromPipelineByPropertyName = true,
82-
HelpMessage = "The name of the Azure SQL Database Server to restore the database to.")]
87+
HelpMessage = "The name of the Azure SQL Server to restore the database to.")]
8388
[ValidateNotNullOrEmpty]
8489
public string ServerName { get; set; }
8590

@@ -91,7 +96,7 @@ public class RestoreAzureRmSqlDatabase
9196
public string TargetDatabaseName { get; set; }
9297

9398
/// <summary>
94-
/// The resource ID of the database to restore (dropped DB, geo backup DB, live DB)
99+
/// The resource ID of the database to restore (deleted DB, geo backup DB, live DB)
95100
/// </summary>
96101
[Parameter(Mandatory = true,
97102
ValueFromPipelineByPropertyName = true,
@@ -103,29 +108,29 @@ public class RestoreAzureRmSqlDatabase
103108
/// </summary>
104109
[Parameter(Mandatory = false,
105110
ValueFromPipelineByPropertyName = true,
106-
HelpMessage = "The edition of the database to restore to.")]
111+
HelpMessage = "The database edition to use for the restored database.")]
107112
public DatabaseEdition Edition { get; set; }
108113

109114
/// <summary>
110115
/// Gets or sets the SLO of the database to restore
111116
/// </summary>
112117
[Parameter(Mandatory = false,
113118
ValueFromPipelineByPropertyName = true,
114-
HelpMessage = "The service level objective of the database to restore to.")]
119+
HelpMessage = "The service level objective to use for the restored database.")]
115120
public string ServiceObjectiveName { get; set; }
116121

117122
/// <summary>
118123
/// Gets or sets the target elastic pool name
119124
/// </summary>
120125
[Parameter(Mandatory = false,
121126
ValueFromPipelineByPropertyName = true,
122-
HelpMessage = "The name of the elastic pool to restore to.")]
127+
HelpMessage = "The name of the elastic pool into which the database should be restored.")]
123128
public string ElasticPoolName { get; set; }
124129

125130
/// <summary>
126131
/// Initializes the adapter
127132
/// </summary>
128-
/// <param name="subscription"></param>
133+
/// <param name="subscription">The subscription ID to operate on</param>
129134
/// <returns></returns>
130135
protected override AzureSqlDatabaseBackupAdapter InitModelAdapter(Azure.Common.Authentication.Models.AzureSubscription subscription)
131136
{
@@ -144,16 +149,16 @@ protected override AzureSqlDatabaseModel GetEntity()
144149
string location = ModelAdapter.GetServerLocation(ResourceGroupName, ServerName);
145150
switch (ParameterSetName)
146151
{
147-
case "FromPointInTimeBackup":
152+
case FromPointInTimeBackupSetName:
148153
createMode = "PointInTimeRestore";
149154
restorePointInTime = PointInTime;
150155
break;
151-
case "FromDeletedDatabaseBackup":
156+
case FromDeletedDatabaseBackupSetName:
152157
createMode = "Restore";
153-
//Use DeletionDate as RestorePointInTime for dropped restore
158+
// Use DeletionDate as RestorePointInTime for restore of deleted DB
154159
restorePointInTime = DeletionDate;
155160
break;
156-
case "FromGeoBackup":
161+
case FromGeoBackupSetName:
157162
createMode = "Recovery";
158163
break;
159164
default:

0 commit comments

Comments
 (0)