Skip to content

Commit 973a37c

Browse files
authored
[NetAppFiles] update to 2025-01-01v2 (Azure#27695)
1 parent 8fa959d commit 973a37c

18 files changed

+335
-76
lines changed

src/NetAppFiles/NetAppFiles/Account/NewNetAppFilesAccount.cs

+9-1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,13 @@ public class NewAzureRmNetAppFilesAccount : AzureNetAppFilesCmdletBase
121121
[ValidateNotNullOrEmpty]
122122
public string FederatedClientId { get; set; }
123123

124+
[Parameter(
125+
ParameterSetName = FieldsParameterSet,
126+
Mandatory = false,
127+
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.")]
128+
[ValidateNotNullOrEmpty]
129+
public string NfsV4IdDomain { get; set; }
130+
124131
[Parameter(
125132
Mandatory = false,
126133
HelpMessage = "A hashtable which represents resource tags")]
@@ -172,7 +179,8 @@ public override void ExecuteCmdlet()
172179
Location = Location,
173180
ActiveDirectories = ActiveDirectory?.ConvertFromPs(),
174181
Tags = tagPairs,
175-
Encryption = Encryption?.ConvertFromPs()
182+
Encryption = Encryption?.ConvertFromPs(),
183+
NfsV4IdDomain = NfsV4IdDomain
176184
};
177185
if (IdentityType != null && IdentityType.Contains("UserAssigned"))
178186
{

src/NetAppFiles/NetAppFiles/Account/SetNetAppFilesAccount.cs

+9-1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ public class SetAzureRmNetAppFilesAccount : AzureNetAppFilesCmdletBase
6868
[ValidateNotNullOrEmpty]
6969
public PSNetAppFilesActiveDirectory[] ActiveDirectory { get; set; }
7070

71+
[Parameter(
72+
ParameterSetName = FieldsParameterSet,
73+
Mandatory = false,
74+
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.")]
75+
[ValidateNotNullOrEmpty]
76+
public string NfsV4IdDomain { get; set; }
77+
7178
[Parameter(
7279
Mandatory = false,
7380
HelpMessage = "A hashtable which represents resource tags")]
@@ -107,7 +114,8 @@ public override void ExecuteCmdlet()
107114
{
108115
Location = Location,
109116
ActiveDirectories = (ActiveDirectory != null) ? ActiveDirectory.ConvertFromPs() : new List<Management.NetApp.Models.ActiveDirectory>(),
110-
Tags = tagPairs
117+
Tags = tagPairs,
118+
NfsV4IdDomain = NfsV4IdDomain
111119
};
112120

113121
if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.CreateResourceMessage, ResourceGroupName)))

src/NetAppFiles/NetAppFiles/Account/UpdateNetAppFilesAccount.cs

+9-1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@ public class UpdateAzureRmNetAppFilesAccount : AzureNetAppFilesCmdletBase
130130
[ValidateNotNullOrEmpty]
131131
public string FederatedClientId { get; set; }
132132

133+
[Parameter(
134+
ParameterSetName = FieldsParameterSet,
135+
Mandatory = false,
136+
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.")]
137+
[ValidateNotNullOrEmpty]
138+
public string NfsV4IdDomain { get; set; }
139+
133140
[Parameter(
134141
ParameterSetName = ObjectParameterSet,
135142
Mandatory = true,
@@ -189,7 +196,8 @@ public override void ExecuteCmdlet()
189196
Location = Location,
190197
ActiveDirectories = (ActiveDirectory != null) ? ActiveDirectory.ConvertFromPs() : null,
191198
Tags = tagPairs,
192-
Encryption = Encryption?.ConvertFromPs()
199+
Encryption = Encryption?.ConvertFromPs(),
200+
NfsV4IdDomain = NfsV4IdDomain
193201
};
194202
if (IdentityType != null && IdentityType.Contains("UserAssigned"))
195203
{

src/NetAppFiles/NetAppFiles/ChangeLog.md

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Added `NfsV4IdDomain` to `New-AzNetAppFilesAccount` and `Update-AzNetAppFilesAccount`
2122

2223
## Version 0.22.0
2324
* Added `FederatedClientId` to `New-AzNetAppFilesAccount` and `Update-AzNetAppFilesAccount`

src/NetAppFiles/NetAppFiles/Helpers/BackupExtensions.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ public static PSNetAppFilesBackup ConvertToPs(this Management.NetApp.Models.Back
3737
VolumeResourceId = backup.VolumeResourceId,
3838
UseExistingSnapshot = backup.UseExistingSnapshot,
3939
SnapshotName = backup.SnapshotName,
40-
CreationDate = backup.CreationDate
40+
CreationDate = backup.CreationDate,
41+
IsLargeVolume = backup.IsLargeVolume,
4142
};
4243
return psBackup;
4344
}

src/NetAppFiles/NetAppFiles/Helpers/ModelExtensions.cs

+6-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static class ModelExtensions
4646
Administrators = psActiveDirectory.Administrators,
4747
EncryptDcConnections = psActiveDirectory.EncryptDCConnections,
4848
PreferredServersForLdapClient = psActiveDirectory.PreferredServersForLdapClient is null ? null: string.Join(",", psActiveDirectory.PreferredServersForLdapClient),
49-
LdapSearchScope = psActiveDirectory.LdapSearchScope?.ConvertFromPs()
49+
LdapSearchScope = psActiveDirectory.LdapSearchScope?.ConvertFromPs()
5050
}).ToList();
5151
}
5252

@@ -103,7 +103,9 @@ public static PSNetAppFilesAccount ToPsNetAppFilesAccount(this NetAppAccount net
103103
ActiveDirectories = (netAppAccount.ActiveDirectories != null) ? netAppAccount.ActiveDirectories.ConvertToPs(resourceGroupName, netAppAccount.Name) : null,
104104
ProvisioningState = netAppAccount.ProvisioningState,
105105
Identity = netAppAccount.Identity.ConvertToPs(),
106-
SystemData = netAppAccount.SystemData?.ToPsSystemData()
106+
SystemData = netAppAccount.SystemData?.ToPsSystemData(),
107+
MultiAdStatus = netAppAccount.MultiAdStatus,
108+
NfsV4IdDomain= netAppAccount.NfsV4IdDomain
107109
};
108110
}
109111

@@ -233,6 +235,7 @@ public static PSNetAppFilesVolumeDataProtection ConvertDataProtectionToPs(Volume
233235
replication.RemoteVolumeResourceId = DataProtection.Replication.RemoteVolumeResourceId;
234236
replication.RemoteVolumeRegion = DataProtection.Replication.RemoteVolumeRegion;
235237
replication.RemotePath = DataProtection.Replication?.RemotePath?.ConvertToPs();
238+
replication.DestinationReplications = DataProtection.Replication?.DestinationReplications?.ConvertToPs();
236239
psDataProtection.Replication = replication;
237240
}
238241
if (DataProtection.Snapshot != null)
@@ -294,7 +297,7 @@ public static VolumePropertiesDataProtection ConvertDataProtectionFromPs(PSNetAp
294297
replication.ReplicationSchedule = psDataProtection.Replication.ReplicationSchedule;
295298
replication.RemoteVolumeResourceId = psDataProtection.Replication.RemoteVolumeResourceId;
296299
replication.RemoteVolumeRegion = psDataProtection.Replication.RemoteVolumeRegion;
297-
replication.RemotePath = psDataProtection.Replication.RemotePath?.ConvertFromPs();
300+
replication.RemotePath = psDataProtection.Replication.RemotePath?.ConvertFromPs();
298301
dataProtection.Replication = replication;
299302
}
300303

src/NetAppFiles/NetAppFiles/Helpers/NetAppAccountExtensions.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public static PSNetAppFilesAccount ConvertToPs(this NetAppAccount netAppAccount)
4141
Identity = netAppAccount.Identity?.ConvertToPs(),
4242
DisableShowmount = netAppAccount.DisableShowmount,
4343
Encryption = netAppAccount.Encryption?.ConvertToPs(),
44-
SystemData = netAppAccount.SystemData?.ToPsSystemData()
44+
SystemData = netAppAccount.SystemData?.ToPsSystemData(),
45+
MultiAdStatus = netAppAccount.MultiAdStatus
4546
};
4647
}
4748

src/NetAppFiles/NetAppFiles/Helpers/ReplicationExtensions.cs

+18-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
using Microsoft.Azure.Commands.NetAppFiles.Models;
1818
using System.Collections.Generic;
1919
using System.Linq;
20+
using Microsoft.Azure.PowerShell.Cmdlets.NetAppFiles.Models;
2021

2122
namespace Microsoft.Azure.Commands.NetAppFiles.Helpers
2223
{
@@ -29,7 +30,7 @@ public static PSNetAppFilesReplication ConvertToPs(this Management.NetApp.Models
2930
ReplicationId = replication.ReplicationId,
3031
EndpointType = replication.EndpointType,
3132
RemoteVolumeRegion = replication.RemoteVolumeRegion,
32-
RemoteVolumeResourceId = replication.RemoteVolumeResourceId,
33+
RemoteVolumeResourceId = replication.RemoteVolumeResourceId
3334
};
3435
return psReplicaitonObject;
3536
}
@@ -49,5 +50,21 @@ public static PSSvmPeerCommandResponse ConvertToPs(this Management.NetApp.Models
4950
return psSvmPeerCommandResponse;
5051
}
5152

53+
public static PSNetAppFilesDestinationReplication ConvertToPs(this Management.NetApp.Models.DestinationReplication destinationReplication)
54+
{
55+
PSNetAppFilesDestinationReplication pSNetAppFilesDestinationReplication = new PSNetAppFilesDestinationReplication
56+
{
57+
Region = destinationReplication.Region,
58+
ReplicationType = destinationReplication.ReplicationType,
59+
ResourceId = destinationReplication.ResourceId,
60+
Zone = destinationReplication.Zone
61+
};
62+
return pSNetAppFilesDestinationReplication;
63+
}
64+
65+
public static List<PSNetAppFilesDestinationReplication> ConvertToPs(this IEnumerable<Management.NetApp.Models.DestinationReplication> destinationReplications)
66+
{
67+
return destinationReplications.Select(e => e.ConvertToPs()).ToList();
68+
}
5269
}
5370
}

src/NetAppFiles/NetAppFiles/Models/PSNetAppFilesAccount.cs

+12
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,17 @@ public class PSNetAppFilesAccount
8787
/// for all volumes under the subscription, null equals false
8888
/// </summary>
8989
public bool? DisableShowmount {get; set;}
90+
91+
/// <summary>
92+
/// Gets or sets NfsV4IdDomain
93+
/// Shows the status of NfsV4IdDomain
94+
/// </summary>
95+
public string NfsV4IdDomain { get; set; }
96+
97+
/// <summary>
98+
/// Gets or sets MultiAdStatus
99+
/// Shows the status of MultiAdStatus
100+
/// </summary>
101+
public string MultiAdStatus { get; set; }
90102
}
91103
}

src/NetAppFiles/NetAppFiles/Models/PSNetAppFilesBackup.cs

+9-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class PSNetAppFilesBackup
3030
/// Gets or sets Resource location
3131
/// </summary>
3232
public string Location { get; set; }
33-
33+
3434
/// <summary>
3535
/// Gets resource Id
3636
/// </summary>
@@ -113,5 +113,13 @@ public class PSNetAppFilesBackup
113113
/// The name of the snapshot
114114
/// </remarks>
115115
public string SnapshotName { get; set; }
116+
117+
/// <summary>
118+
/// Gets IsLargeVolume
119+
/// </summary>
120+
/// <remarks>
121+
/// Specifies if the backup is for a large volume
122+
/// </remarks>
123+
public bool? IsLargeVolume { get; set; }
116124
}
117125
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
5+
6+
using System;
7+
using System.Collections.Generic;
8+
using System.Text;
9+
10+
namespace Microsoft.Azure.PowerShell.Cmdlets.NetAppFiles.Models
11+
{
12+
public class PSNetAppFilesDestinationReplication
13+
{
14+
/// <summary>
15+
/// Gets or sets the resource ID of the remote volume
16+
/// </summary>
17+
public string ResourceId { get; set; }
18+
19+
/// <summary>
20+
/// Gets or sets indicates whether the replication is cross zone or cross
21+
/// region. Possible values include: &#39;CrossRegionReplication&#39;, &#39;CrossZoneReplication&#39;
22+
/// </summary>
23+
public string ReplicationType { get; set; }
24+
25+
/// <summary>
26+
/// Gets or sets the remote region for the destination volume.
27+
/// </summary>
28+
public string Region { get; set; }
29+
30+
/// <summary>
31+
/// Gets or sets the remote zone for the destination volume.
32+
/// </summary>
33+
public string Zone { get; set; }
34+
}
35+
}

src/NetAppFiles/NetAppFiles/Models/PSNetAppFilesReplicationObject.cs

+7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using Microsoft.Azure.Management.NetApp.Models;
16+
using Microsoft.Azure.PowerShell.Cmdlets.NetAppFiles.Models;
17+
using System.Collections.Generic;
1618

1719
namespace Microsoft.Azure.Commands.NetAppFiles.Models
1820
{
@@ -49,5 +51,10 @@ public class PSNetAppFilesReplicationObject
4951
/// Gets or sets the full path to a volume that is to be migrated into ANF.
5052
/// </summary>
5153
public PSRemotePath RemotePath { get; set; }
54+
55+
/// <summary>
56+
/// Gets a list of destination replications
57+
/// </summary>
58+
public IList<PSNetAppFilesDestinationReplication> DestinationReplications { get; set; }
5259
}
5360
}

src/NetAppFiles/NetAppFiles/Models/PSNetAppFilesVolumeDataProtection.cs

+9
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using Microsoft.Azure.Management.NetApp.Models;
16+
using Microsoft.Azure.PowerShell.Cmdlets.NetAppFiles.Models;
17+
using System.Collections.Generic;
18+
1519
namespace Microsoft.Azure.Commands.NetAppFiles.Models
1620
{
1721
public class PSNetAppFilesVolumeDataProtection
@@ -48,5 +52,10 @@ public class PSNetAppFilesVolumeDataProtection
4852
/// Volume Backup properties
4953
/// </remark>
5054
public PSNetAppFilesVolumeRelocationProperties VolumeRelocation { get; set; }
55+
56+
/// <summary>
57+
/// Gets a list of destination replications
58+
/// </summary>
59+
public IList<PSNetAppFilesDestinationReplication> DestinationReplications { get; set; }
5160
}
5261
}

src/NetAppFiles/NetAppFiles/VolumeGroup/NewNetAppFilesVolumeGroup.cs

+17-6
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public class NewAzureRmNetAppFilesVolumeGroup : AzureNetAppFilesCmdletBase
112112
Mandatory = false,
113113
HelpMessage = "Application Type, default "+ DefaultApplicationType)]
114114
[ValidateNotNullOrEmpty]
115-
[PSArgumentCompleter("SAP-HANA")]
115+
[PSArgumentCompleter("SAP-HANA", "ORACLE")]
116116
[PSDefaultValue(Help = "Default \"SAP-HANA\"", Value = DefaultApplicationType)]
117117
public string ApplicationType { get; set; } = DefaultApplicationType;
118118

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

274+
[Parameter(
275+
Mandatory = false,
276+
HelpMessage = "Basic network, or Standard features available to the volume (Basic, Standard).")]
277+
[PSArgumentCompleter("Basic", "Standard")]
278+
public string NetworkFeature { get; set; }
279+
274280
[Parameter(
275281
Mandatory = false,
276282
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'")]
@@ -450,7 +456,8 @@ private VolumeGroupDetails CreateHostVolumeGroup(string name, string sid, string
450456
ExportPolicy = volumeExportPolicy,
451457
Zones = zoneList,
452458
KeyVaultPrivateEndpointResourceId = this.KeyVaultPrivateEndpointResourceId,
453-
EncryptionKeySource = this.EncryptionKeySource
459+
EncryptionKeySource = this.EncryptionKeySource,
460+
NetworkFeatures = this.NetworkFeature
454461
};
455462

456463
volumesInGroup.Add(dataVolume);
@@ -468,7 +475,8 @@ private VolumeGroupDetails CreateHostVolumeGroup(string name, string sid, string
468475
ExportPolicy = volumeExportPolicy,
469476
Zones = zoneList,
470477
KeyVaultPrivateEndpointResourceId = this.KeyVaultPrivateEndpointResourceId,
471-
EncryptionKeySource = this.EncryptionKeySource
478+
EncryptionKeySource = this.EncryptionKeySource,
479+
NetworkFeatures = this.NetworkFeature
472480
};
473481
volumesInGroup.Add(logVolume);
474482
//Shared, Log backup and Data backup only created for HostID==1.
@@ -489,7 +497,8 @@ private VolumeGroupDetails CreateHostVolumeGroup(string name, string sid, string
489497
ExportPolicy = volumeExportPolicy,
490498
Zones = zoneList,
491499
KeyVaultPrivateEndpointResourceId = this.KeyVaultPrivateEndpointResourceId,
492-
EncryptionKeySource = this.EncryptionKeySource
500+
EncryptionKeySource = this.EncryptionKeySource,
501+
NetworkFeatures = this.NetworkFeature
493502
};
494503
if (this.Zone != null)
495504
{
@@ -511,7 +520,8 @@ private VolumeGroupDetails CreateHostVolumeGroup(string name, string sid, string
511520
ExportPolicy = volumeExportPolicy,
512521
Zones = zoneList,
513522
KeyVaultPrivateEndpointResourceId = this.KeyVaultPrivateEndpointResourceId,
514-
EncryptionKeySource = this.EncryptionKeySource
523+
EncryptionKeySource = this.EncryptionKeySource,
524+
NetworkFeatures = this.NetworkFeature
515525
};
516526
if (this.Zone != null)
517527
{
@@ -533,7 +543,8 @@ private VolumeGroupDetails CreateHostVolumeGroup(string name, string sid, string
533543
ExportPolicy = volumeExportPolicy,
534544
Zones = zoneList,
535545
KeyVaultPrivateEndpointResourceId = this.KeyVaultPrivateEndpointResourceId,
536-
EncryptionKeySource = this.EncryptionKeySource
546+
EncryptionKeySource = this.EncryptionKeySource,
547+
NetworkFeatures = this.NetworkFeature
537548
};
538549
if (this.Zone != null)
539550
{

0 commit comments

Comments
 (0)