Skip to content

Commit c7c69eb

Browse files
authored
NFSAAS-2898 update to R4.5 RP standard (AzureRT#26)
* NFSAAS-2898 update to R4.5 RP standard * NFSAAS-2898 update to R4.5 RP standard * NFSAAS-2898 update to R4.5 RP standard
1 parent 41c5cee commit c7c69eb

File tree

3 files changed

+22
-28
lines changed

3 files changed

+22
-28
lines changed

src/NetAppFiles/NetAppFiles.Test/ScenarioTests/VolumeTests.ps1

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function Test-VolumeCrud
104104
# create first volume and check
105105
$newTagName = "tag1"
106106
$newTagValue = "tagValue1"
107-
$retrievedVolume = New-AzNetAppFilesVolume -ResourceGroupName $resourceGroup -Location $resourceLocation -AccountName $accName -PoolName $poolName -VolumeName $volName1 -CreationToken $volName1 -UsageThreshold $usageThreshold -ServiceLevel $serviceLevel -SubnetId $subnetId -Tag @{$newTagName = $newTagValue} -ExportPolicy $exportPolicy -ProtocolTypes $protocolTypes
107+
$retrievedVolume = New-AzNetAppFilesVolume -ResourceGroupName $resourceGroup -Location $resourceLocation -AccountName $accName -PoolName $poolName -VolumeName $volName1 -CreationToken $volName1 -UsageThreshold $usageThreshold -ServiceLevel $serviceLevel -SubnetId $subnetId -Tag @{$newTagName = $newTagValue} -ExportPolicy $exportPolicy -ProtocolType $protocolTypes
108108
Assert-AreEqual "$accName/$poolName/$volName1" $retrievedVolume.Name
109109
Assert-AreEqual $serviceLevel $retrievedVolume.ServiceLevel
110110
Assert-AreEqual True $retrievedVolume.Tags.ContainsKey($newTagName)
@@ -151,21 +151,21 @@ function Test-VolumeCrud
151151
Assert-AreEqual $retrievedVolume.ExportPolicy.Rules[0].AllowedClients '0.0.0.0/0'
152152
Assert-AreEqual $retrievedVolume.ExportPolicy.Rules[1].AllowedClients '1.2.3.0/24'
153153

154-
$rule3 = @{
155-
RuleIndex = 3
156-
UnixReadOnly = 'false'
157-
UnixReadWrite = 'true'
158-
Cifs = 'false'
159-
Nfsv3 = 'true'
160-
Nfsv4 = 'false'
161-
AllowedClients = '1.2.3.0/24'
162-
}
163-
164-
$exportPolicyUpdate = @{
165-
Rules = (
166-
$rule2, $rule3
167-
)
168-
}
154+
$rule4 = @{
155+
RuleIndex = 3
156+
UnixReadOnly = 'false'
157+
UnixReadWrite = 'true'
158+
Cifs = 'false'
159+
Nfsv3 = 'true'
160+
Nfsv4 = 'false'
161+
AllowedClients = '1.2.3.0/24'
162+
}
163+
164+
$exportPolicyUpdate = @{
165+
Rules = (
166+
$rule2, $rule4
167+
)
168+
}
169169

170170
# now patch the policy
171171
$retrievedVolume = Update-AzNetAppFilesVolume -ResourceGroupName $resourceGroup -Location $resourceLocation -AccountName $accName -PoolName $poolName -VolumeName $volName1 -ExportPolicy $exportPolicyUpdate
@@ -190,7 +190,7 @@ function Test-VolumeCrud
190190
# create the volume and check
191191
$newTagName = "tag1"
192192
$newTagValue = "tagValue1"
193-
$retrievedVolume = New-AzNetAppFilesVolume -ResourceGroupName $resourceGroup -Location $resourceLocation -AccountName $accName -PoolName $poolName2 -VolumeName $volName4 -CreationToken $volName4 -UsageThreshold $doubleUsage -ServiceLevel "Standard" -SubnetId $subnetId -Tag @{$newTagName = $newTagValue} -ExportPolicy $exportPolicy -ProtocolTypes $protocolTypes
193+
$retrievedVolume = New-AzNetAppFilesVolume -ResourceGroupName $resourceGroup -Location $resourceLocation -AccountName $accName -PoolName $poolName2 -VolumeName $volName4 -CreationToken $volName4 -UsageThreshold $doubleUsage -ServiceLevel "Standard" -SubnetId $subnetId -Tag @{$newTagName = $newTagValue} -ExportPolicy $exportPolicy -ProtocolType $protocolTypes
194194
Assert-AreEqual "$accName/$poolName2/$volName4" $retrievedVolume.Name
195195
Assert-AreEqual "Standard" $retrievedVolume.ServiceLevel
196196
Assert-AreEqual True $retrievedVolume.Tags.ContainsKey($newTagName)

src/NetAppFiles/NetAppFiles/Volume/NewNetAppFilesVolume.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,7 @@ public class NewAzureRmNetAppFilesVolume : AzureNetAppFilesCmdletBase
120120
Mandatory = false,
121121
HelpMessage = "A hashtable array which represents the protocol types")]
122122
[ValidateNotNullOrEmpty]
123-
public List<string> ProtocolTypes { get; set; }
124-
125-
[Parameter(
126-
Mandatory = false,
127-
HelpMessage = "A hashtable which represents mount targets of the volume")]
128-
[ValidateNotNullOrEmpty]
129-
public Hashtable MountTargets { get; }
123+
public List<string> ProtocolType { get; set; }
130124

131125
[Parameter(
132126
Mandatory = false,
@@ -162,7 +156,7 @@ public override void ExecuteCmdlet()
162156
SubnetId = SubnetId,
163157
Location = Location,
164158
ExportPolicy = (ExportPolicy != null) ? ModelExtensions.ConvertExportPolicyFromPs(ExportPolicy) : null,
165-
ProtocolTypes = ProtocolTypes,
159+
ProtocolTypes = ProtocolType,
166160
Tags = Tag
167161
};
168162

src/NetAppFiles/NetAppFiles/help/New-AzNetAppFilesVolume.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ Creates a new Azure NetApp Files (ANF) volume.
1717
New-AzNetAppFilesVolume -ResourceGroupName <String> -Location <String> -AccountName <String> -PoolName <String>
1818
-Name <String> -UsageThreshold <Int64> -SubnetId <String> -CreationToken <String> -ServiceLevel <String>
1919
[-ExportPolicy <PSNetAppFilesVolumeExportPolicy>]
20-
[-ProtocolTypes <List[String]>] [-MountTargets <Hashtable>]
20+
[-ProtocolType <List[String]>]
2121
[-Tag <Hashtable>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
2222
```
2323

2424
### ByParentObjectParameterSet
2525
```
2626
New-AzNetAppFilesVolume -Name <String> -UsageThreshold <Int64> -SubnetId <String> -CreationToken <String>
2727
-ServiceLevel <String> [-ExportPolicy <PSNetAppFilesVolumeExportPolicy>]
28-
[-ProtocolTypes <List[String]>] [-MountTargets <Hashtable>]
28+
[-ProtocolType <List[String]>]
2929
[-Tag <Hashtable>] -PoolObject <PSNetAppFilesPool> [-DefaultProfile <IAzureContextContainer>] [-WhatIf]
3030
[-Confirm] [<CommonParameters>]
3131
```
@@ -193,7 +193,7 @@ Accept pipeline input: True (ByValue)
193193
Accept wildcard characters: False
194194
```
195195
196-
### -ProtocolTypes
196+
### -ProtocolType
197197
A hashtable array which represents the export policy
198198
199199
```yaml

0 commit comments

Comments
 (0)