Skip to content

NFSAAS-2898 update to R4.5 RP standard #26

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
Aug 3, 2019
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
34 changes: 17 additions & 17 deletions src/NetAppFiles/NetAppFiles.Test/ScenarioTests/VolumeTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function Test-VolumeCrud
# create first volume and check
$newTagName = "tag1"
$newTagValue = "tagValue1"
$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
$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
Assert-AreEqual "$accName/$poolName/$volName1" $retrievedVolume.Name
Assert-AreEqual $serviceLevel $retrievedVolume.ServiceLevel
Assert-AreEqual True $retrievedVolume.Tags.ContainsKey($newTagName)
Expand Down Expand Up @@ -151,21 +151,21 @@ function Test-VolumeCrud
Assert-AreEqual $retrievedVolume.ExportPolicy.Rules[0].AllowedClients '0.0.0.0/0'
Assert-AreEqual $retrievedVolume.ExportPolicy.Rules[1].AllowedClients '1.2.3.0/24'

$rule3 = @{
RuleIndex = 3
UnixReadOnly = 'false'
UnixReadWrite = 'true'
Cifs = 'false'
Nfsv3 = 'true'
Nfsv4 = 'false'
AllowedClients = '1.2.3.0/24'
}

$exportPolicyUpdate = @{
Rules = (
$rule2, $rule3
)
}
$rule4 = @{
RuleIndex = 3
UnixReadOnly = 'false'
UnixReadWrite = 'true'
Cifs = 'false'
Nfsv3 = 'true'
Nfsv4 = 'false'
AllowedClients = '1.2.3.0/24'
}

$exportPolicyUpdate = @{
Rules = (
$rule2, $rule4
)
}

# now patch the policy
$retrievedVolume = Update-AzNetAppFilesVolume -ResourceGroupName $resourceGroup -Location $resourceLocation -AccountName $accName -PoolName $poolName -VolumeName $volName1 -ExportPolicy $exportPolicyUpdate
Expand All @@ -190,7 +190,7 @@ function Test-VolumeCrud
# create the volume and check
$newTagName = "tag1"
$newTagValue = "tagValue1"
$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
$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
Assert-AreEqual "$accName/$poolName2/$volName4" $retrievedVolume.Name
Assert-AreEqual "Standard" $retrievedVolume.ServiceLevel
Assert-AreEqual True $retrievedVolume.Tags.ContainsKey($newTagName)
Expand Down
10 changes: 2 additions & 8 deletions src/NetAppFiles/NetAppFiles/Volume/NewNetAppFilesVolume.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,7 @@ public class NewAzureRmNetAppFilesVolume : AzureNetAppFilesCmdletBase
Mandatory = false,
HelpMessage = "A hashtable array which represents the protocol types")]
[ValidateNotNullOrEmpty]
public List<string> ProtocolTypes { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "A hashtable which represents mount targets of the volume")]
[ValidateNotNullOrEmpty]
public Hashtable MountTargets { get; }
public List<string> ProtocolType { get; set; }

[Parameter(
Mandatory = false,
Expand Down Expand Up @@ -162,7 +156,7 @@ public override void ExecuteCmdlet()
SubnetId = SubnetId,
Location = Location,
ExportPolicy = (ExportPolicy != null) ? ModelExtensions.ConvertExportPolicyFromPs(ExportPolicy) : null,
ProtocolTypes = ProtocolTypes,
ProtocolTypes = ProtocolType,
Tags = Tag
};

Expand Down
6 changes: 3 additions & 3 deletions src/NetAppFiles/NetAppFiles/help/New-AzNetAppFilesVolume.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ Creates a new Azure NetApp Files (ANF) volume.
New-AzNetAppFilesVolume -ResourceGroupName <String> -Location <String> -AccountName <String> -PoolName <String>
-Name <String> -UsageThreshold <Int64> -SubnetId <String> -CreationToken <String> -ServiceLevel <String>
[-ExportPolicy <PSNetAppFilesVolumeExportPolicy>]
[-ProtocolTypes <List[String]>] [-MountTargets <Hashtable>]
[-ProtocolType <List[String]>]
[-Tag <Hashtable>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### ByParentObjectParameterSet
```
New-AzNetAppFilesVolume -Name <String> -UsageThreshold <Int64> -SubnetId <String> -CreationToken <String>
-ServiceLevel <String> [-ExportPolicy <PSNetAppFilesVolumeExportPolicy>]
[-ProtocolTypes <List[String]>] [-MountTargets <Hashtable>]
[-ProtocolType <List[String]>]
[-Tag <Hashtable>] -PoolObject <PSNetAppFilesPool> [-DefaultProfile <IAzureContextContainer>] [-WhatIf]
[-Confirm] [<CommonParameters>]
```
Expand Down Expand Up @@ -193,7 +193,7 @@ Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```

### -ProtocolTypes
### -ProtocolType
A hashtable array which represents the export policy

```yaml
Expand Down