Skip to content

Commit 7469113

Browse files
audunnvidai-msft
andauthored
[NetAppFiles] Remove deprected properties from backups (#26564)
* Remove deprected properties from backups * update test * update help * Remove ProgressAction * update help and changelog * update help * update changelog --------- Co-authored-by: Vincent Dai <[email protected]>
1 parent 5821b60 commit 7469113

14 files changed

+58
-557
lines changed

src/NetAppFiles/NetAppFiles.Test/ScenarioTests/BackupTests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ function Test-BackupCrud
166166
Start-TestSleep -Seconds 30
167167

168168
# Assert-ThrowsContains{ Get-AzNetAppFilesVolumeGroupIdListForLDAPUser -ResourceGroupName $resourceGroup -AccountName $accName -PoolName $poolName -VolumeName $volName1 -Username $userName} 'Group Id list can be fetched for LDAP enabled volumes only. Please check that the volume is LDAP enabled'
169-
Assert-ThrowsContains{New-AzNetAppFilesBackup -ResourceGroupName $resourceGroup -Location $backupLocation -AccountName $accName1 -BackupVaultName $backupVaultName -Name $backupName1 -Label $label -VolumeResourceId "bogus Id" } 'is an invalid resource Id'
169+
Assert-ThrowsContains{New-AzNetAppFilesBackup -ResourceGroupName $resourceGroup -AccountName $accName1 -BackupVaultName $backupVaultName -Name $backupName1 -Label $label -VolumeResourceId "bogus Id" } 'is an invalid resource Id'
170170

171171
# create and check Backup
172172
$retrievedBackup = New-AzNetAppFilesBackup -ResourceGroupName $resourceGroup -AccountName $accName1 -BackupVaultName $backupVaultName -Name $backupName1 -Label $label -VolumeResourceId $retrievedVolume.Id

src/NetAppFiles/NetAppFiles/Backups/GetNetAppFilesBackup.cs

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -65,32 +65,6 @@ public class GetAzureRmNetAppFilesBackup: AzureNetAppFilesCmdletBase
6565
nameof(ResourceGroupName))]
6666
public string AccountName { get; set; }
6767

68-
public const String ChangeDesc = "Parameter is being deprecated without being replaced";
69-
[CmdletParameterBreakingChangeWithVersion("PoolName", "12", "0.16", ChangeDescription = ChangeDesc)]
70-
[Parameter(
71-
Mandatory = false,
72-
ParameterSetName = FieldsParameterSet,
73-
HelpMessage = "The name of the ANF pool")]
74-
[ValidateNotNullOrEmpty]
75-
[ResourceNameCompleter(
76-
"Microsoft.NetApp/netAppAccounts/capacityPools",
77-
nameof(ResourceGroupName),
78-
nameof(AccountName))]
79-
public string PoolName { get; set; }
80-
81-
[CmdletParameterBreakingChangeWithVersion("VolumeName", "12", "0.16", ChangeDescription = ChangeDesc)]
82-
[Parameter(
83-
Mandatory = false,
84-
ParameterSetName = FieldsParameterSet,
85-
HelpMessage = "The name of the ANF volume")]
86-
[ValidateNotNullOrEmpty]
87-
[ResourceNameCompleter(
88-
"Microsoft.NetApp/netAppAccounts/capacityPools/volumes",
89-
nameof(ResourceGroupName),
90-
nameof(AccountName),
91-
nameof(PoolName))]
92-
public string VolumeName { get; set; }
93-
9468
[Parameter(
9569
Mandatory = false,
9670
ParameterSetName = FieldsParameterSet,
@@ -115,9 +89,7 @@ public class GetAzureRmNetAppFilesBackup: AzureNetAppFilesCmdletBase
11589
[ResourceNameCompleter(
11690
"Microsoft.NetApp/netAppAccounts/backups",
11791
nameof(ResourceGroupName),
118-
nameof(AccountName),
119-
nameof(PoolName),
120-
nameof(VolumeName))]
92+
nameof(AccountName))]
12193
public string Name { get; set; }
12294

12395
[Parameter(
@@ -126,22 +98,6 @@ public class GetAzureRmNetAppFilesBackup: AzureNetAppFilesCmdletBase
12698
HelpMessage = "Filter list of backups, this filter accepts volumeResourceId")]
12799
public string Filter { get; set; }
128100

129-
[CmdletParameterBreakingChangeWithVersion("AccountBackupName", "12", "0.16", ChangeDescription = ChangeDesc)]
130-
[Parameter(
131-
Mandatory = false,
132-
HelpMessage = "The name of the ANF backup",
133-
ParameterSetName = AccountBackupFieldsParameterSet)]
134-
[Parameter(
135-
Mandatory = false,
136-
HelpMessage = "The name of the ANF backup",
137-
ParameterSetName = ParentObjectParameterSet)]
138-
[ValidateNotNullOrEmpty]
139-
[ResourceNameCompleter(
140-
"Microsoft.NetApp/netAppAccounts/backups",
141-
nameof(ResourceGroupName),
142-
nameof(AccountName))]
143-
public string AccountBackupName { get; set; }
144-
145101
[Parameter(
146102
Mandatory = true,
147103
ValueFromPipelineByPropertyName = true,
@@ -150,15 +106,6 @@ public class GetAzureRmNetAppFilesBackup: AzureNetAppFilesCmdletBase
150106
[ValidateNotNullOrEmpty]
151107
public string ResourceId { get; set; }
152108

153-
[CmdletParameterBreakingChangeWithVersion("VolumeObject", "12", "0.16", ChangeDescription = ChangeDesc)]
154-
[Parameter(
155-
ParameterSetName = ParentObjectParameterSet,
156-
Mandatory = false,
157-
ValueFromPipeline = true,
158-
HelpMessage = "The Volume object containing the backup to return")]
159-
[ValidateNotNullOrEmpty]
160-
public PSNetAppFilesVolume VolumeObject { get; set; }
161-
162109
[Parameter(
163110
ParameterSetName = ParentObjectParameterSet,
164111
Mandatory = true,

src/NetAppFiles/NetAppFiles/Backups/NewNetAppFilesBackup.cs

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,6 @@ public class NewAzureRmNetAppFilesBackup : AzureNetAppFilesCmdletBase
4444
[ResourceGroupCompleter()]
4545
public string ResourceGroupName { get; set; }
4646

47-
[CmdletParameterBreakingChangeWithVersion("Location", "12", "0.16", ChangeDescription = ChangeDesc)]
48-
[Parameter(
49-
Mandatory = false,
50-
ParameterSetName = FieldsParameterSet,
51-
HelpMessage = "The location of the resource")]
52-
[ValidateNotNullOrEmpty]
53-
[LocationCompleter("Microsoft.NetApp/netAppAccounts/backupvaults/backups")]
54-
public string Location { get; set; }
55-
5647
[Parameter(
5748
Mandatory = true,
5849
ParameterSetName = FieldsParameterSet,
@@ -63,32 +54,6 @@ public class NewAzureRmNetAppFilesBackup : AzureNetAppFilesCmdletBase
6354
nameof(ResourceGroupName))]
6455
public string AccountName { get; set; }
6556

66-
public const String ChangeDesc = "Parameter is being deprecated without being replaced";
67-
[CmdletParameterBreakingChangeWithVersion("PoolName", "12", "0.16", ChangeDescription = ChangeDesc)]
68-
[Parameter(
69-
Mandatory = false,
70-
ParameterSetName = FieldsParameterSet,
71-
HelpMessage = "The name of the ANF pool")]
72-
[ValidateNotNullOrEmpty]
73-
[ResourceNameCompleter(
74-
"Microsoft.NetApp/netAppAccounts/capacityPools",
75-
nameof(ResourceGroupName),
76-
nameof(AccountName))]
77-
public string PoolName { get; set; }
78-
79-
[CmdletParameterBreakingChangeWithVersion("VolumeName", "12", "0.16", ChangeDescription = ChangeDesc)]
80-
[Parameter(
81-
Mandatory = false,
82-
ParameterSetName = FieldsParameterSet,
83-
HelpMessage = "The name of the ANF volume")]
84-
[ValidateNotNullOrEmpty]
85-
[ResourceNameCompleter(
86-
"Microsoft.NetApp/netAppAccounts/capacityPools/volumes",
87-
nameof(ResourceGroupName),
88-
nameof(AccountName),
89-
nameof(PoolName))]
90-
public string VolumeName { get; set; }
91-
9257
[Parameter(
9358
Mandatory = true,
9459
ParameterSetName = FieldsParameterSet,
@@ -135,15 +100,6 @@ public class NewAzureRmNetAppFilesBackup : AzureNetAppFilesCmdletBase
135100
[ValidateNotNullOrEmpty]
136101
public string SnapshotName { get; set; }
137102

138-
[CmdletParameterBreakingChangeWithVersion("VolumeObject", "12", "0.16", ChangeDescription = ChangeDesc)]
139-
[Parameter(
140-
ParameterSetName = ParentObjectParameterSet,
141-
Mandatory = false,
142-
ValueFromPipeline = true,
143-
HelpMessage = "The volume for the new backup object")]
144-
[ValidateNotNullOrEmpty]
145-
public PSNetAppFilesVolume VolumeObject { get; set; }
146-
147103
[Parameter(
148104
ParameterSetName = ParentObjectParameterSet,
149105
Mandatory = true,
@@ -157,7 +113,6 @@ public override void ExecuteCmdlet()
157113
if (ParameterSetName == ParentObjectParameterSet)
158114
{
159115
ResourceGroupName = BackupVaultObject.ResourceGroupName;
160-
Location = BackupVaultObject.Location;
161116
var NameParts = BackupVaultObject.Name.Split('/');
162117
AccountName = NameParts[0];
163118
BackupVaultName = NameParts[1];

src/NetAppFiles/NetAppFiles/Backups/RemoveNetAppFilesBackup.cs

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -65,32 +65,6 @@ public class RemoveAzureRmNetAppFilesBackup : AzureNetAppFilesCmdletBase
6565
nameof(ResourceGroupName))]
6666
public string AccountName { get; set; }
6767

68-
public const String ChangeDesc = "Parameter is being deprecated without being replaced";
69-
[CmdletParameterBreakingChangeWithVersion("PoolName", "12", "0.16", ChangeDescription = ChangeDesc)]
70-
[Parameter(
71-
Mandatory = false,
72-
ParameterSetName = FieldsParameterSet,
73-
HelpMessage = "The name of the ANF pool")]
74-
[ValidateNotNullOrEmpty]
75-
[ResourceNameCompleter(
76-
"Microsoft.NetApp/netAppAccounts/capacityPools",
77-
nameof(ResourceGroupName),
78-
nameof(AccountName))]
79-
public string PoolName { get; set; }
80-
81-
[CmdletParameterBreakingChangeWithVersion("VolumeName", "12", "0.16", ChangeDescription = ChangeDesc)]
82-
[Parameter(
83-
Mandatory = false,
84-
ParameterSetName = FieldsParameterSet,
85-
HelpMessage = "The name of the ANF volume")]
86-
[ValidateNotNullOrEmpty]
87-
[ResourceNameCompleter(
88-
"Microsoft.NetApp/netAppAccounts/capacityPools/volumes",
89-
nameof(ResourceGroupName),
90-
nameof(AccountName),
91-
nameof(PoolName))]
92-
public string VolumeName { get; set; }
93-
9468
[Parameter(
9569
Mandatory = true,
9670
ParameterSetName = FieldsParameterSet,
@@ -119,18 +93,6 @@ public class RemoveAzureRmNetAppFilesBackup : AzureNetAppFilesCmdletBase
11993
nameof(BackupVault))]
12094
public string Name { get; set; }
12195

122-
[CmdletParameterBreakingChangeWithVersion("AccountBackupName", "12", "0.16", ChangeDescription = ChangeDesc)]
123-
[Parameter(
124-
Mandatory = false,
125-
HelpMessage = "The name of the ANF backup",
126-
ParameterSetName = AccountBackupFieldsParameterSet)]
127-
[ValidateNotNullOrEmpty]
128-
[ResourceNameCompleter(
129-
"Microsoft.NetApp/netAppAccounts/backups",
130-
nameof(ResourceGroupName),
131-
nameof(AccountName))]
132-
public string AccountBackupName { get; set; }
133-
13496
[Parameter(
13597
Mandatory = true,
13698
ValueFromPipelineByPropertyName = true,
@@ -139,15 +101,6 @@ public class RemoveAzureRmNetAppFilesBackup : AzureNetAppFilesCmdletBase
139101
[ValidateNotNullOrEmpty]
140102
public string ResourceId { get; set; }
141103

142-
[CmdletParameterBreakingChangeWithVersion("VolumeObject", "12", "0.16", ChangeDescription = ChangeDesc)]
143-
[Parameter(
144-
ParameterSetName = ParentObjectParameterSet,
145-
Mandatory = false,
146-
ValueFromPipeline = true,
147-
HelpMessage = "The volume object containing the backup to return")]
148-
[ValidateNotNullOrEmpty]
149-
public PSNetAppFilesVolume VolumeObject { get; set; }
150-
151104
[Parameter(
152105
ParameterSetName = ParentObjectParameterSet,
153106
Mandatory = true,

src/NetAppFiles/NetAppFiles/Backups/RestoreNetAppFilesBackupFiles.cs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -68,32 +68,6 @@ public class RestoreNetAppFilesBackupFiles : AzureNetAppFilesCmdletBase
6868
nameof(AccountName))]
6969
public string Name { get; set; }
7070

71-
public const String ChangeDesc = "Parameter is being deprecated without being replaced";
72-
[CmdletParameterBreakingChangeWithVersion("PoolName", "12", "0.16", ChangeDescription = ChangeDesc)]
73-
[Parameter(
74-
Mandatory = false,
75-
ParameterSetName = FieldsParameterSet,
76-
HelpMessage = "The name of the ANF pool")]
77-
[ValidateNotNullOrEmpty]
78-
[ResourceNameCompleter(
79-
"Microsoft.NetApp/netAppAccounts/capacityPools",
80-
nameof(ResourceGroupName),
81-
nameof(AccountName))]
82-
public string PoolName { get; set; }
83-
84-
[CmdletParameterBreakingChangeWithVersion("VolumeName", "12", "0.16", ChangeDescription = ChangeDesc)]
85-
[Parameter(
86-
Mandatory = false,
87-
ParameterSetName = FieldsParameterSet,
88-
HelpMessage = "The name of the ANF volume")]
89-
[ValidateNotNullOrEmpty]
90-
[ResourceNameCompleter(
91-
"Microsoft.NetApp/netAppAccounts/capacityPools/volumes",
92-
nameof(ResourceGroupName),
93-
nameof(AccountName),
94-
nameof(PoolName))]
95-
public string VolumeName { get; set; }
96-
9771
[Parameter(
9872
Mandatory = true,
9973
ParameterSetName = FieldsParameterSet,
@@ -132,15 +106,6 @@ public class RestoreNetAppFilesBackupFiles : AzureNetAppFilesCmdletBase
132106
[ValidateNotNullOrEmpty]
133107
public string ResourceId { get; set; }
134108

135-
[CmdletParameterBreakingChangeWithVersion("VolumeObject", "12", "0.16", ChangeDescription = ChangeDesc)]
136-
[Parameter(
137-
ParameterSetName = ParentObjectParameterSet,
138-
Mandatory = false,
139-
ValueFromPipeline = true,
140-
HelpMessage = "The volume object containing the backup to restore files from")]
141-
[ValidateNotNullOrEmpty]
142-
public PSNetAppFilesVolume VolumeObject { get; set; }
143-
144109
[Parameter(
145110
ParameterSetName = ParentObjectParameterSet,
146111
Mandatory = true,

src/NetAppFiles/NetAppFiles/Backups/UpdateNetAppFilesBackup.cs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -80,32 +80,6 @@ public class UpdateAzureRmNetAppFilesBackup : AzureNetAppFilesCmdletBase
8080
nameof(AccountName))]
8181
public string Name { get; set; }
8282

83-
public const String ChangeDesc = "Parameter is being deprecated without being replaced";
84-
[CmdletParameterBreakingChangeWithVersion("PoolName", "12", "0.16", ChangeDescription = ChangeDesc)]
85-
[Parameter(
86-
Mandatory = false,
87-
ParameterSetName = FieldsParameterSet,
88-
HelpMessage = "The name of the ANF pool")]
89-
[ValidateNotNullOrEmpty]
90-
[ResourceNameCompleter(
91-
"Microsoft.NetApp/netAppAccounts/capacityPools",
92-
nameof(ResourceGroupName),
93-
nameof(AccountName))]
94-
public string PoolName { get; set; }
95-
96-
[CmdletParameterBreakingChangeWithVersion("VolumeName", "12", "0.16", ChangeDescription = ChangeDesc)]
97-
[Parameter(
98-
Mandatory = false,
99-
ParameterSetName = FieldsParameterSet,
100-
HelpMessage = "The name of the ANF volume")]
101-
[ValidateNotNullOrEmpty]
102-
[ResourceNameCompleter(
103-
"Microsoft.NetApp/netAppAccounts/capacityPools/volumes",
104-
nameof(ResourceGroupName),
105-
nameof(AccountName),
106-
nameof(PoolName))]
107-
public string VolumeName { get; set; }
108-
10983
[Parameter(
11084
Mandatory = true,
11185
ParameterSetName = FieldsParameterSet,
@@ -138,15 +112,6 @@ public class UpdateAzureRmNetAppFilesBackup : AzureNetAppFilesCmdletBase
138112
[ValidateNotNullOrEmpty]
139113
public string ResourceId { get; set; }
140114

141-
[CmdletParameterBreakingChangeWithVersion("VolumeObject", "12", "0.16", ChangeDescription = ChangeDesc)]
142-
[Parameter(
143-
ParameterSetName = ParentObjectParameterSet,
144-
Mandatory = false,
145-
ValueFromPipeline = true,
146-
HelpMessage = "The volume object containing the backup to return")]
147-
[ValidateNotNullOrEmpty]
148-
public PSNetAppFilesVolume VolumeObject { get; set; }
149-
150115
[Parameter(
151116
ParameterSetName = ParentObjectParameterSet,
152117
Mandatory = true,

src/NetAppFiles/NetAppFiles/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Removed parameters `Location`, `PoolName`, `VolumeName` from `Get-AzNetAppFilesBackup`, `New-AzNetAppFilesBackup`, `Update-AzNetAppFilesBackup`, `Remove-AzNetAppFilesBackup` and `Restore-AzNetAppFilesBackupFile`
2122

2223
## Version 0.18.0
2324
* Fixed some minor issues

src/NetAppFiles/NetAppFiles/help/Az.NetAppFiles.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ Gets details of an Azure NetApp Files (ANF) snapshot.
5050
### [Get-AzNetAppFilesSnapshotPolicy](Get-AzNetAppFilesSnapshotPolicy.md)
5151
Gets details of an Azure NetApp Files (ANF) snapshot policy.
5252

53+
### [Get-AzNetAppFilesSnapshotPolicyVolumeList](Get-AzNetAppFilesSnapshotPolicyVolumeList.md)
54+
Get Volumes for Azure NetApp Files (ANF) Snapshot Policy
55+
5356
### [Get-AzNetAppFilesSubvolume](Get-AzNetAppFilesSubvolume.md)
5457
Gets details of an Azure NetApp Files (ANF) subvolume.
5558

0 commit comments

Comments
 (0)