Skip to content

[NetAppFiles] update to 2025-01-01v2 #27695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/NetAppFiles/NetAppFiles/Account/NewNetAppFilesAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ public class NewAzureRmNetAppFilesAccount : AzureNetAppFilesCmdletBase
[ValidateNotNullOrEmpty]
public string FederatedClientId { get; set; }

[Parameter(
ParameterSetName = FieldsParameterSet,
Mandatory = false,
HelpMessage = "Domain for NFSv4 user ID mapping. This property will be set for all NetApp accounts in the subscription and region and only affect non ldap NFSv4 volumes.")]
[ValidateNotNullOrEmpty]
public string NfsV4IdDomain { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "A hashtable which represents resource tags")]
Expand Down Expand Up @@ -172,7 +179,8 @@ public override void ExecuteCmdlet()
Location = Location,
ActiveDirectories = ActiveDirectory?.ConvertFromPs(),
Tags = tagPairs,
Encryption = Encryption?.ConvertFromPs()
Encryption = Encryption?.ConvertFromPs(),
NfsV4IdDomain = NfsV4IdDomain
};
if (IdentityType != null && IdentityType.Contains("UserAssigned"))
{
Expand Down
10 changes: 9 additions & 1 deletion src/NetAppFiles/NetAppFiles/Account/SetNetAppFilesAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ public class SetAzureRmNetAppFilesAccount : AzureNetAppFilesCmdletBase
[ValidateNotNullOrEmpty]
public PSNetAppFilesActiveDirectory[] ActiveDirectory { get; set; }

[Parameter(
ParameterSetName = FieldsParameterSet,
Mandatory = false,
HelpMessage = "Domain for NFSv4 user ID mapping. This property will be set for all NetApp accounts in the subscription and region and only affect non ldap NFSv4 volumes.")]
[ValidateNotNullOrEmpty]
public string NfsV4IdDomain { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "A hashtable which represents resource tags")]
Expand Down Expand Up @@ -107,7 +114,8 @@ public override void ExecuteCmdlet()
{
Location = Location,
ActiveDirectories = (ActiveDirectory != null) ? ActiveDirectory.ConvertFromPs() : new List<Management.NetApp.Models.ActiveDirectory>(),
Tags = tagPairs
Tags = tagPairs,
NfsV4IdDomain = NfsV4IdDomain
};

if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.CreateResourceMessage, ResourceGroupName)))
Expand Down
10 changes: 9 additions & 1 deletion src/NetAppFiles/NetAppFiles/Account/UpdateNetAppFilesAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@ public class UpdateAzureRmNetAppFilesAccount : AzureNetAppFilesCmdletBase
[ValidateNotNullOrEmpty]
public string FederatedClientId { get; set; }

[Parameter(
ParameterSetName = FieldsParameterSet,
Mandatory = false,
HelpMessage = "Domain for NFSv4 user ID mapping. This property will be set for all NetApp accounts in the subscription and region and only affect non ldap NFSv4 volumes.")]
[ValidateNotNullOrEmpty]
public string NfsV4IdDomain { get; set; }

[Parameter(
ParameterSetName = ObjectParameterSet,
Mandatory = true,
Expand Down Expand Up @@ -189,7 +196,8 @@ public override void ExecuteCmdlet()
Location = Location,
ActiveDirectories = (ActiveDirectory != null) ? ActiveDirectory.ConvertFromPs() : null,
Tags = tagPairs,
Encryption = Encryption?.ConvertFromPs()
Encryption = Encryption?.ConvertFromPs(),
NfsV4IdDomain = NfsV4IdDomain
};
if (IdentityType != null && IdentityType.Contains("UserAssigned"))
{
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
* Added `NfsV4IdDomain` to `New-AzNetAppFilesAccount` and `Update-AzNetAppFilesAccount`

## Version 0.22.0
* Added `FederatedClientId` to `New-AzNetAppFilesAccount` and `Update-AzNetAppFilesAccount`
Expand Down
3 changes: 2 additions & 1 deletion src/NetAppFiles/NetAppFiles/Helpers/BackupExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public static PSNetAppFilesBackup ConvertToPs(this Management.NetApp.Models.Back
VolumeResourceId = backup.VolumeResourceId,
UseExistingSnapshot = backup.UseExistingSnapshot,
SnapshotName = backup.SnapshotName,
CreationDate = backup.CreationDate
CreationDate = backup.CreationDate,
IsLargeVolume = backup.IsLargeVolume,
};
return psBackup;
}
Expand Down
9 changes: 6 additions & 3 deletions src/NetAppFiles/NetAppFiles/Helpers/ModelExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static class ModelExtensions
Administrators = psActiveDirectory.Administrators,
EncryptDcConnections = psActiveDirectory.EncryptDCConnections,
PreferredServersForLdapClient = psActiveDirectory.PreferredServersForLdapClient is null ? null: string.Join(",", psActiveDirectory.PreferredServersForLdapClient),
LdapSearchScope = psActiveDirectory.LdapSearchScope?.ConvertFromPs()
LdapSearchScope = psActiveDirectory.LdapSearchScope?.ConvertFromPs()
}).ToList();
}

Expand Down Expand Up @@ -103,7 +103,9 @@ public static PSNetAppFilesAccount ToPsNetAppFilesAccount(this NetAppAccount net
ActiveDirectories = (netAppAccount.ActiveDirectories != null) ? netAppAccount.ActiveDirectories.ConvertToPs(resourceGroupName, netAppAccount.Name) : null,
ProvisioningState = netAppAccount.ProvisioningState,
Identity = netAppAccount.Identity.ConvertToPs(),
SystemData = netAppAccount.SystemData?.ToPsSystemData()
SystemData = netAppAccount.SystemData?.ToPsSystemData(),
MultiAdStatus = netAppAccount.MultiAdStatus,
NfsV4IdDomain= netAppAccount.NfsV4IdDomain
};
}

Expand Down Expand Up @@ -233,6 +235,7 @@ public static PSNetAppFilesVolumeDataProtection ConvertDataProtectionToPs(Volume
replication.RemoteVolumeResourceId = DataProtection.Replication.RemoteVolumeResourceId;
replication.RemoteVolumeRegion = DataProtection.Replication.RemoteVolumeRegion;
replication.RemotePath = DataProtection.Replication?.RemotePath?.ConvertToPs();
replication.DestinationReplications = DataProtection.Replication?.DestinationReplications?.ConvertToPs();
psDataProtection.Replication = replication;
}
if (DataProtection.Snapshot != null)
Expand Down Expand Up @@ -294,7 +297,7 @@ public static VolumePropertiesDataProtection ConvertDataProtectionFromPs(PSNetAp
replication.ReplicationSchedule = psDataProtection.Replication.ReplicationSchedule;
replication.RemoteVolumeResourceId = psDataProtection.Replication.RemoteVolumeResourceId;
replication.RemoteVolumeRegion = psDataProtection.Replication.RemoteVolumeRegion;
replication.RemotePath = psDataProtection.Replication.RemotePath?.ConvertFromPs();
replication.RemotePath = psDataProtection.Replication.RemotePath?.ConvertFromPs();
dataProtection.Replication = replication;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public static PSNetAppFilesAccount ConvertToPs(this NetAppAccount netAppAccount)
Identity = netAppAccount.Identity?.ConvertToPs(),
DisableShowmount = netAppAccount.DisableShowmount,
Encryption = netAppAccount.Encryption?.ConvertToPs(),
SystemData = netAppAccount.SystemData?.ToPsSystemData()
SystemData = netAppAccount.SystemData?.ToPsSystemData(),
MultiAdStatus = netAppAccount.MultiAdStatus
};
}

Expand Down
19 changes: 18 additions & 1 deletion src/NetAppFiles/NetAppFiles/Helpers/ReplicationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using Microsoft.Azure.Commands.NetAppFiles.Models;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Azure.PowerShell.Cmdlets.NetAppFiles.Models;

namespace Microsoft.Azure.Commands.NetAppFiles.Helpers
{
Expand All @@ -29,7 +30,7 @@ public static PSNetAppFilesReplication ConvertToPs(this Management.NetApp.Models
ReplicationId = replication.ReplicationId,
EndpointType = replication.EndpointType,
RemoteVolumeRegion = replication.RemoteVolumeRegion,
RemoteVolumeResourceId = replication.RemoteVolumeResourceId,
RemoteVolumeResourceId = replication.RemoteVolumeResourceId
};
return psReplicaitonObject;
}
Expand All @@ -49,5 +50,21 @@ public static PSSvmPeerCommandResponse ConvertToPs(this Management.NetApp.Models
return psSvmPeerCommandResponse;
}

public static PSNetAppFilesDestinationReplication ConvertToPs(this Management.NetApp.Models.DestinationReplication destinationReplication)
{
PSNetAppFilesDestinationReplication pSNetAppFilesDestinationReplication = new PSNetAppFilesDestinationReplication
{
Region = destinationReplication.Region,
ReplicationType = destinationReplication.ReplicationType,
ResourceId = destinationReplication.ResourceId,
Zone = destinationReplication.Zone
};
return pSNetAppFilesDestinationReplication;
}

public static List<PSNetAppFilesDestinationReplication> ConvertToPs(this IEnumerable<Management.NetApp.Models.DestinationReplication> destinationReplications)
{
return destinationReplications.Select(e => e.ConvertToPs()).ToList();
}
}
}
12 changes: 12 additions & 0 deletions src/NetAppFiles/NetAppFiles/Models/PSNetAppFilesAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,17 @@ public class PSNetAppFilesAccount
/// for all volumes under the subscription, null equals false
/// </summary>
public bool? DisableShowmount {get; set;}

/// <summary>
/// Gets or sets NfsV4IdDomain
/// Shows the status of NfsV4IdDomain
/// </summary>
public string NfsV4IdDomain { get; set; }

/// <summary>
/// Gets or sets MultiAdStatus
/// Shows the status of MultiAdStatus
/// </summary>
public string MultiAdStatus { get; set; }
}
}
10 changes: 9 additions & 1 deletion src/NetAppFiles/NetAppFiles/Models/PSNetAppFilesBackup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class PSNetAppFilesBackup
/// Gets or sets Resource location
/// </summary>
public string Location { get; set; }

/// <summary>
/// Gets resource Id
/// </summary>
Expand Down Expand Up @@ -113,5 +113,13 @@ public class PSNetAppFilesBackup
/// The name of the snapshot
/// </remarks>
public string SnapshotName { get; set; }

/// <summary>
/// Gets IsLargeVolume
/// </summary>
/// <remarks>
/// Specifies if the backup is for a large volume
/// </remarks>
public bool? IsLargeVolume { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

using System;
using System.Collections.Generic;
using System.Text;

namespace Microsoft.Azure.PowerShell.Cmdlets.NetAppFiles.Models
{
public class PSNetAppFilesDestinationReplication
{
/// <summary>
/// Gets or sets the resource ID of the remote volume
/// </summary>
public string ResourceId { get; set; }

/// <summary>
/// Gets or sets indicates whether the replication is cross zone or cross
/// region. Possible values include: &#39;CrossRegionReplication&#39;, &#39;CrossZoneReplication&#39;
/// </summary>
public string ReplicationType { get; set; }

/// <summary>
/// Gets or sets the remote region for the destination volume.
/// </summary>
public string Region { get; set; }

/// <summary>
/// Gets or sets the remote zone for the destination volume.
/// </summary>
public string Zone { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Management.NetApp.Models;
using Microsoft.Azure.PowerShell.Cmdlets.NetAppFiles.Models;
using System.Collections.Generic;

namespace Microsoft.Azure.Commands.NetAppFiles.Models
{
Expand Down Expand Up @@ -49,5 +51,10 @@ public class PSNetAppFilesReplicationObject
/// Gets or sets the full path to a volume that is to be migrated into ANF.
/// </summary>
public PSRemotePath RemotePath { get; set; }

/// <summary>
/// Gets a list of destination replications
/// </summary>
public IList<PSNetAppFilesDestinationReplication> DestinationReplications { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Management.NetApp.Models;
using Microsoft.Azure.PowerShell.Cmdlets.NetAppFiles.Models;
using System.Collections.Generic;

namespace Microsoft.Azure.Commands.NetAppFiles.Models
{
public class PSNetAppFilesVolumeDataProtection
Expand Down Expand Up @@ -48,5 +52,10 @@ public class PSNetAppFilesVolumeDataProtection
/// Volume Backup properties
/// </remark>
public PSNetAppFilesVolumeRelocationProperties VolumeRelocation { get; set; }

/// <summary>
/// Gets a list of destination replications
/// </summary>
public IList<PSNetAppFilesDestinationReplication> DestinationReplications { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public class NewAzureRmNetAppFilesVolumeGroup : AzureNetAppFilesCmdletBase
Mandatory = false,
HelpMessage = "Application Type, default "+ DefaultApplicationType)]
[ValidateNotNullOrEmpty]
[PSArgumentCompleter("SAP-HANA")]
[PSArgumentCompleter("SAP-HANA", "ORACLE")]
[PSDefaultValue(Help = "Default \"SAP-HANA\"", Value = DefaultApplicationType)]
public string ApplicationType { get; set; } = DefaultApplicationType;

Expand Down Expand Up @@ -271,6 +271,12 @@ public class NewAzureRmNetAppFilesVolumeGroup : AzureNetAppFilesCmdletBase
[PSArgumentCompleter("Microsoft.NetApp", "Microsoft.KeyVault")]
public string EncryptionKeySource { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "Basic network, or Standard features available to the volume (Basic, Standard).")]
[PSArgumentCompleter("Basic", "Standard")]
public string NetworkFeature { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "The resource ID of private endpoint for KeyVault. It must reside in the same VNET as the volume. Only applicable if encryptionKeySource = 'Microsoft.KeyVault'")]
Expand Down Expand Up @@ -450,7 +456,8 @@ private VolumeGroupDetails CreateHostVolumeGroup(string name, string sid, string
ExportPolicy = volumeExportPolicy,
Zones = zoneList,
KeyVaultPrivateEndpointResourceId = this.KeyVaultPrivateEndpointResourceId,
EncryptionKeySource = this.EncryptionKeySource
EncryptionKeySource = this.EncryptionKeySource,
NetworkFeatures = this.NetworkFeature
};

volumesInGroup.Add(dataVolume);
Expand All @@ -468,7 +475,8 @@ private VolumeGroupDetails CreateHostVolumeGroup(string name, string sid, string
ExportPolicy = volumeExportPolicy,
Zones = zoneList,
KeyVaultPrivateEndpointResourceId = this.KeyVaultPrivateEndpointResourceId,
EncryptionKeySource = this.EncryptionKeySource
EncryptionKeySource = this.EncryptionKeySource,
NetworkFeatures = this.NetworkFeature
};
volumesInGroup.Add(logVolume);
//Shared, Log backup and Data backup only created for HostID==1.
Expand All @@ -489,7 +497,8 @@ private VolumeGroupDetails CreateHostVolumeGroup(string name, string sid, string
ExportPolicy = volumeExportPolicy,
Zones = zoneList,
KeyVaultPrivateEndpointResourceId = this.KeyVaultPrivateEndpointResourceId,
EncryptionKeySource = this.EncryptionKeySource
EncryptionKeySource = this.EncryptionKeySource,
NetworkFeatures = this.NetworkFeature
};
if (this.Zone != null)
{
Expand All @@ -511,7 +520,8 @@ private VolumeGroupDetails CreateHostVolumeGroup(string name, string sid, string
ExportPolicy = volumeExportPolicy,
Zones = zoneList,
KeyVaultPrivateEndpointResourceId = this.KeyVaultPrivateEndpointResourceId,
EncryptionKeySource = this.EncryptionKeySource
EncryptionKeySource = this.EncryptionKeySource,
NetworkFeatures = this.NetworkFeature
};
if (this.Zone != null)
{
Expand All @@ -533,7 +543,8 @@ private VolumeGroupDetails CreateHostVolumeGroup(string name, string sid, string
ExportPolicy = volumeExportPolicy,
Zones = zoneList,
KeyVaultPrivateEndpointResourceId = this.KeyVaultPrivateEndpointResourceId,
EncryptionKeySource = this.EncryptionKeySource
EncryptionKeySource = this.EncryptionKeySource,
NetworkFeatures = this.NetworkFeature
};
if (this.Zone != null)
{
Expand Down
Loading