Skip to content

Commit

Permalink
[NetAppFiles] Remove deprected properties from backups (Azure#26564)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
audunn and vidai-msft authored Nov 4, 2024
1 parent 5821b60 commit 7469113
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 557 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function Test-BackupCrud
Start-TestSleep -Seconds 30

# 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'
Assert-ThrowsContains{New-AzNetAppFilesBackup -ResourceGroupName $resourceGroup -Location $backupLocation -AccountName $accName1 -BackupVaultName $backupVaultName -Name $backupName1 -Label $label -VolumeResourceId "bogus Id" } 'is an invalid resource Id'
Assert-ThrowsContains{New-AzNetAppFilesBackup -ResourceGroupName $resourceGroup -AccountName $accName1 -BackupVaultName $backupVaultName -Name $backupName1 -Label $label -VolumeResourceId "bogus Id" } 'is an invalid resource Id'

# create and check Backup
$retrievedBackup = New-AzNetAppFilesBackup -ResourceGroupName $resourceGroup -AccountName $accName1 -BackupVaultName $backupVaultName -Name $backupName1 -Label $label -VolumeResourceId $retrievedVolume.Id
Expand Down
55 changes: 1 addition & 54 deletions src/NetAppFiles/NetAppFiles/Backups/GetNetAppFilesBackup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,32 +65,6 @@ public class GetAzureRmNetAppFilesBackup: AzureNetAppFilesCmdletBase
nameof(ResourceGroupName))]
public string AccountName { get; set; }

public const String ChangeDesc = "Parameter is being deprecated without being replaced";
[CmdletParameterBreakingChangeWithVersion("PoolName", "12", "0.16", ChangeDescription = ChangeDesc)]
[Parameter(
Mandatory = false,
ParameterSetName = FieldsParameterSet,
HelpMessage = "The name of the ANF pool")]
[ValidateNotNullOrEmpty]
[ResourceNameCompleter(
"Microsoft.NetApp/netAppAccounts/capacityPools",
nameof(ResourceGroupName),
nameof(AccountName))]
public string PoolName { get; set; }

[CmdletParameterBreakingChangeWithVersion("VolumeName", "12", "0.16", ChangeDescription = ChangeDesc)]
[Parameter(
Mandatory = false,
ParameterSetName = FieldsParameterSet,
HelpMessage = "The name of the ANF volume")]
[ValidateNotNullOrEmpty]
[ResourceNameCompleter(
"Microsoft.NetApp/netAppAccounts/capacityPools/volumes",
nameof(ResourceGroupName),
nameof(AccountName),
nameof(PoolName))]
public string VolumeName { get; set; }

[Parameter(
Mandatory = false,
ParameterSetName = FieldsParameterSet,
Expand All @@ -115,9 +89,7 @@ public class GetAzureRmNetAppFilesBackup: AzureNetAppFilesCmdletBase
[ResourceNameCompleter(
"Microsoft.NetApp/netAppAccounts/backups",
nameof(ResourceGroupName),
nameof(AccountName),
nameof(PoolName),
nameof(VolumeName))]
nameof(AccountName))]
public string Name { get; set; }

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

[CmdletParameterBreakingChangeWithVersion("AccountBackupName", "12", "0.16", ChangeDescription = ChangeDesc)]
[Parameter(
Mandatory = false,
HelpMessage = "The name of the ANF backup",
ParameterSetName = AccountBackupFieldsParameterSet)]
[Parameter(
Mandatory = false,
HelpMessage = "The name of the ANF backup",
ParameterSetName = ParentObjectParameterSet)]
[ValidateNotNullOrEmpty]
[ResourceNameCompleter(
"Microsoft.NetApp/netAppAccounts/backups",
nameof(ResourceGroupName),
nameof(AccountName))]
public string AccountBackupName { get; set; }

[Parameter(
Mandatory = true,
ValueFromPipelineByPropertyName = true,
Expand All @@ -150,15 +106,6 @@ public class GetAzureRmNetAppFilesBackup: AzureNetAppFilesCmdletBase
[ValidateNotNullOrEmpty]
public string ResourceId { get; set; }

[CmdletParameterBreakingChangeWithVersion("VolumeObject", "12", "0.16", ChangeDescription = ChangeDesc)]
[Parameter(
ParameterSetName = ParentObjectParameterSet,
Mandatory = false,
ValueFromPipeline = true,
HelpMessage = "The Volume object containing the backup to return")]
[ValidateNotNullOrEmpty]
public PSNetAppFilesVolume VolumeObject { get; set; }

[Parameter(
ParameterSetName = ParentObjectParameterSet,
Mandatory = true,
Expand Down
45 changes: 0 additions & 45 deletions src/NetAppFiles/NetAppFiles/Backups/NewNetAppFilesBackup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,6 @@ public class NewAzureRmNetAppFilesBackup : AzureNetAppFilesCmdletBase
[ResourceGroupCompleter()]
public string ResourceGroupName { get; set; }

[CmdletParameterBreakingChangeWithVersion("Location", "12", "0.16", ChangeDescription = ChangeDesc)]
[Parameter(
Mandatory = false,
ParameterSetName = FieldsParameterSet,
HelpMessage = "The location of the resource")]
[ValidateNotNullOrEmpty]
[LocationCompleter("Microsoft.NetApp/netAppAccounts/backupvaults/backups")]
public string Location { get; set; }

[Parameter(
Mandatory = true,
ParameterSetName = FieldsParameterSet,
Expand All @@ -63,32 +54,6 @@ public class NewAzureRmNetAppFilesBackup : AzureNetAppFilesCmdletBase
nameof(ResourceGroupName))]
public string AccountName { get; set; }

public const String ChangeDesc = "Parameter is being deprecated without being replaced";
[CmdletParameterBreakingChangeWithVersion("PoolName", "12", "0.16", ChangeDescription = ChangeDesc)]
[Parameter(
Mandatory = false,
ParameterSetName = FieldsParameterSet,
HelpMessage = "The name of the ANF pool")]
[ValidateNotNullOrEmpty]
[ResourceNameCompleter(
"Microsoft.NetApp/netAppAccounts/capacityPools",
nameof(ResourceGroupName),
nameof(AccountName))]
public string PoolName { get; set; }

[CmdletParameterBreakingChangeWithVersion("VolumeName", "12", "0.16", ChangeDescription = ChangeDesc)]
[Parameter(
Mandatory = false,
ParameterSetName = FieldsParameterSet,
HelpMessage = "The name of the ANF volume")]
[ValidateNotNullOrEmpty]
[ResourceNameCompleter(
"Microsoft.NetApp/netAppAccounts/capacityPools/volumes",
nameof(ResourceGroupName),
nameof(AccountName),
nameof(PoolName))]
public string VolumeName { get; set; }

[Parameter(
Mandatory = true,
ParameterSetName = FieldsParameterSet,
Expand Down Expand Up @@ -135,15 +100,6 @@ public class NewAzureRmNetAppFilesBackup : AzureNetAppFilesCmdletBase
[ValidateNotNullOrEmpty]
public string SnapshotName { get; set; }

[CmdletParameterBreakingChangeWithVersion("VolumeObject", "12", "0.16", ChangeDescription = ChangeDesc)]
[Parameter(
ParameterSetName = ParentObjectParameterSet,
Mandatory = false,
ValueFromPipeline = true,
HelpMessage = "The volume for the new backup object")]
[ValidateNotNullOrEmpty]
public PSNetAppFilesVolume VolumeObject { get; set; }

[Parameter(
ParameterSetName = ParentObjectParameterSet,
Mandatory = true,
Expand All @@ -157,7 +113,6 @@ public override void ExecuteCmdlet()
if (ParameterSetName == ParentObjectParameterSet)
{
ResourceGroupName = BackupVaultObject.ResourceGroupName;
Location = BackupVaultObject.Location;
var NameParts = BackupVaultObject.Name.Split('/');
AccountName = NameParts[0];
BackupVaultName = NameParts[1];
Expand Down
47 changes: 0 additions & 47 deletions src/NetAppFiles/NetAppFiles/Backups/RemoveNetAppFilesBackup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,32 +65,6 @@ public class RemoveAzureRmNetAppFilesBackup : AzureNetAppFilesCmdletBase
nameof(ResourceGroupName))]
public string AccountName { get; set; }

public const String ChangeDesc = "Parameter is being deprecated without being replaced";
[CmdletParameterBreakingChangeWithVersion("PoolName", "12", "0.16", ChangeDescription = ChangeDesc)]
[Parameter(
Mandatory = false,
ParameterSetName = FieldsParameterSet,
HelpMessage = "The name of the ANF pool")]
[ValidateNotNullOrEmpty]
[ResourceNameCompleter(
"Microsoft.NetApp/netAppAccounts/capacityPools",
nameof(ResourceGroupName),
nameof(AccountName))]
public string PoolName { get; set; }

[CmdletParameterBreakingChangeWithVersion("VolumeName", "12", "0.16", ChangeDescription = ChangeDesc)]
[Parameter(
Mandatory = false,
ParameterSetName = FieldsParameterSet,
HelpMessage = "The name of the ANF volume")]
[ValidateNotNullOrEmpty]
[ResourceNameCompleter(
"Microsoft.NetApp/netAppAccounts/capacityPools/volumes",
nameof(ResourceGroupName),
nameof(AccountName),
nameof(PoolName))]
public string VolumeName { get; set; }

[Parameter(
Mandatory = true,
ParameterSetName = FieldsParameterSet,
Expand Down Expand Up @@ -119,18 +93,6 @@ public class RemoveAzureRmNetAppFilesBackup : AzureNetAppFilesCmdletBase
nameof(BackupVault))]
public string Name { get; set; }

[CmdletParameterBreakingChangeWithVersion("AccountBackupName", "12", "0.16", ChangeDescription = ChangeDesc)]
[Parameter(
Mandatory = false,
HelpMessage = "The name of the ANF backup",
ParameterSetName = AccountBackupFieldsParameterSet)]
[ValidateNotNullOrEmpty]
[ResourceNameCompleter(
"Microsoft.NetApp/netAppAccounts/backups",
nameof(ResourceGroupName),
nameof(AccountName))]
public string AccountBackupName { get; set; }

[Parameter(
Mandatory = true,
ValueFromPipelineByPropertyName = true,
Expand All @@ -139,15 +101,6 @@ public class RemoveAzureRmNetAppFilesBackup : AzureNetAppFilesCmdletBase
[ValidateNotNullOrEmpty]
public string ResourceId { get; set; }

[CmdletParameterBreakingChangeWithVersion("VolumeObject", "12", "0.16", ChangeDescription = ChangeDesc)]
[Parameter(
ParameterSetName = ParentObjectParameterSet,
Mandatory = false,
ValueFromPipeline = true,
HelpMessage = "The volume object containing the backup to return")]
[ValidateNotNullOrEmpty]
public PSNetAppFilesVolume VolumeObject { get; set; }

[Parameter(
ParameterSetName = ParentObjectParameterSet,
Mandatory = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,32 +68,6 @@ public class RestoreNetAppFilesBackupFiles : AzureNetAppFilesCmdletBase
nameof(AccountName))]
public string Name { get; set; }

public const String ChangeDesc = "Parameter is being deprecated without being replaced";
[CmdletParameterBreakingChangeWithVersion("PoolName", "12", "0.16", ChangeDescription = ChangeDesc)]
[Parameter(
Mandatory = false,
ParameterSetName = FieldsParameterSet,
HelpMessage = "The name of the ANF pool")]
[ValidateNotNullOrEmpty]
[ResourceNameCompleter(
"Microsoft.NetApp/netAppAccounts/capacityPools",
nameof(ResourceGroupName),
nameof(AccountName))]
public string PoolName { get; set; }

[CmdletParameterBreakingChangeWithVersion("VolumeName", "12", "0.16", ChangeDescription = ChangeDesc)]
[Parameter(
Mandatory = false,
ParameterSetName = FieldsParameterSet,
HelpMessage = "The name of the ANF volume")]
[ValidateNotNullOrEmpty]
[ResourceNameCompleter(
"Microsoft.NetApp/netAppAccounts/capacityPools/volumes",
nameof(ResourceGroupName),
nameof(AccountName),
nameof(PoolName))]
public string VolumeName { get; set; }

[Parameter(
Mandatory = true,
ParameterSetName = FieldsParameterSet,
Expand Down Expand Up @@ -132,15 +106,6 @@ public class RestoreNetAppFilesBackupFiles : AzureNetAppFilesCmdletBase
[ValidateNotNullOrEmpty]
public string ResourceId { get; set; }

[CmdletParameterBreakingChangeWithVersion("VolumeObject", "12", "0.16", ChangeDescription = ChangeDesc)]
[Parameter(
ParameterSetName = ParentObjectParameterSet,
Mandatory = false,
ValueFromPipeline = true,
HelpMessage = "The volume object containing the backup to restore files from")]
[ValidateNotNullOrEmpty]
public PSNetAppFilesVolume VolumeObject { get; set; }

[Parameter(
ParameterSetName = ParentObjectParameterSet,
Mandatory = true,
Expand Down
35 changes: 0 additions & 35 deletions src/NetAppFiles/NetAppFiles/Backups/UpdateNetAppFilesBackup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,32 +80,6 @@ public class UpdateAzureRmNetAppFilesBackup : AzureNetAppFilesCmdletBase
nameof(AccountName))]
public string Name { get; set; }

public const String ChangeDesc = "Parameter is being deprecated without being replaced";
[CmdletParameterBreakingChangeWithVersion("PoolName", "12", "0.16", ChangeDescription = ChangeDesc)]
[Parameter(
Mandatory = false,
ParameterSetName = FieldsParameterSet,
HelpMessage = "The name of the ANF pool")]
[ValidateNotNullOrEmpty]
[ResourceNameCompleter(
"Microsoft.NetApp/netAppAccounts/capacityPools",
nameof(ResourceGroupName),
nameof(AccountName))]
public string PoolName { get; set; }

[CmdletParameterBreakingChangeWithVersion("VolumeName", "12", "0.16", ChangeDescription = ChangeDesc)]
[Parameter(
Mandatory = false,
ParameterSetName = FieldsParameterSet,
HelpMessage = "The name of the ANF volume")]
[ValidateNotNullOrEmpty]
[ResourceNameCompleter(
"Microsoft.NetApp/netAppAccounts/capacityPools/volumes",
nameof(ResourceGroupName),
nameof(AccountName),
nameof(PoolName))]
public string VolumeName { get; set; }

[Parameter(
Mandatory = true,
ParameterSetName = FieldsParameterSet,
Expand Down Expand Up @@ -138,15 +112,6 @@ public class UpdateAzureRmNetAppFilesBackup : AzureNetAppFilesCmdletBase
[ValidateNotNullOrEmpty]
public string ResourceId { get; set; }

[CmdletParameterBreakingChangeWithVersion("VolumeObject", "12", "0.16", ChangeDescription = ChangeDesc)]
[Parameter(
ParameterSetName = ParentObjectParameterSet,
Mandatory = false,
ValueFromPipeline = true,
HelpMessage = "The volume object containing the backup to return")]
[ValidateNotNullOrEmpty]
public PSNetAppFilesVolume VolumeObject { get; set; }

[Parameter(
ParameterSetName = ParentObjectParameterSet,
Mandatory = true,
Expand Down
1 change: 1 addition & 0 deletions src/NetAppFiles/NetAppFiles/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Upcoming Release
* Removed parameters `Location`, `PoolName`, `VolumeName` from `Get-AzNetAppFilesBackup`, `New-AzNetAppFilesBackup`, `Update-AzNetAppFilesBackup`, `Remove-AzNetAppFilesBackup` and `Restore-AzNetAppFilesBackupFile`

## Version 0.18.0
* Fixed some minor issues
Expand Down
3 changes: 3 additions & 0 deletions src/NetAppFiles/NetAppFiles/help/Az.NetAppFiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ Gets details of an Azure NetApp Files (ANF) snapshot.
### [Get-AzNetAppFilesSnapshotPolicy](Get-AzNetAppFilesSnapshotPolicy.md)
Gets details of an Azure NetApp Files (ANF) snapshot policy.

### [Get-AzNetAppFilesSnapshotPolicyVolumeList](Get-AzNetAppFilesSnapshotPolicyVolumeList.md)
Get Volumes for Azure NetApp Files (ANF) Snapshot Policy

### [Get-AzNetAppFilesSubvolume](Get-AzNetAppFilesSubvolume.md)
Gets details of an Azure NetApp Files (ANF) subvolume.

Expand Down
Loading

0 comments on commit 7469113

Please sign in to comment.