Skip to content

Commit

Permalink
ANF-439 update for new API 2019-08-01 (AzureRT#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardbf authored Nov 25, 2019
1 parent 600be09 commit f5cedb0
Show file tree
Hide file tree
Showing 22 changed files with 5,099 additions and 5,136 deletions.
2 changes: 1 addition & 1 deletion src/NetAppFiles/NetAppFiles.Test/NetAppFiles.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.NetApp" Version="1.2.0" />
<PackageReference Include="Microsoft.Azure.Management.NetApp" Version="1.3.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.17.0-preview" />
</ItemGroup>

Expand Down
6 changes: 3 additions & 3 deletions src/NetAppFiles/NetAppFiles.Test/ScenarioTests/Common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ function Get-ProviderLocation($provider)

if ($location -eq $null)
{
return "westcentralus"
return "westus2"
} else
{
return $location.Locations[0]
}
}

return "westcentralus"
return "westus2"
}

return "westcentralus"
return "westus2"
}

<#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ function Test-VolumeCrud
Assert-AreEqual $retrievedVolume.ExportPolicy.Rules[1].AllowedClients '1.2.3.0/24'
Assert-AreEqual $retrievedVolume.ProtocolTypes[0] 'NFSv3'
Assert-NotNull $retrievedVolume.MountTargets
Assert-Null $retrievedVolume.VolumeType
Assert-Null $retrievedVolume.DataProtection

# use the NFSv4.1
$protocolTypesv4 = New-Object string[] 1
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

15 changes: 14 additions & 1 deletion src/NetAppFiles/NetAppFiles/Account/NewNetAppFilesAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using Microsoft.Azure.Management.NetApp;
using Microsoft.Azure.Management.NetApp.Models;
using Microsoft.Azure.Commands.NetAppFiles.Helpers;
using System.Collections.Generic;

namespace Microsoft.Azure.Commands.NetAppFiles.Account
{
Expand Down Expand Up @@ -68,11 +69,23 @@ public class NewAzureRmNetAppFilesAccount : AzureNetAppFilesCmdletBase

public override void ExecuteCmdlet()
{
IDictionary<string, string> tagPairs = null;

if (Tag != null)
{
tagPairs = new Dictionary<string, string>();

foreach (string key in Tag.Keys)
{
tagPairs.Add(key, Tag[key].ToString());
}
}

var netAppAccountBody = new NetAppAccount()
{
Location = Location,
ActiveDirectories = (ActiveDirectory != null) ? ModelExtensions.ConvertActiveDirectoriesFromPs(ActiveDirectory) : null,
Tags = Tag
Tags = tagPairs
};

if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.CreateResourceMessage, ResourceGroupName)))
Expand Down
14 changes: 13 additions & 1 deletion src/NetAppFiles/NetAppFiles/Account/SetNetAppFilesAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,23 @@ public class SetAzureRmNetAppFilesAccount : AzureNetAppFilesCmdletBase

public override void ExecuteCmdlet()
{
IDictionary<string, string> tagPairs = null;

if (Tag != null)
{
tagPairs = new Dictionary<string, string>();

foreach (string key in Tag.Keys)
{
tagPairs.Add(key, Tag[key].ToString());
}
}

var netAppAccountBody = new NetAppAccount()
{
Location = Location,
ActiveDirectories = (ActiveDirectory != null) ? ModelExtensions.ConvertActiveDirectoriesFromPs(ActiveDirectory) : new List<ActiveDirectory>(),
Tags = Tag
Tags = tagPairs
};

if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.CreateResourceMessage, ResourceGroupName)))
Expand Down
15 changes: 14 additions & 1 deletion src/NetAppFiles/NetAppFiles/Account/UpdateNetAppFilesAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using Microsoft.Azure.Management.NetApp.Models;
using Microsoft.Azure.Commands.NetAppFiles.Helpers;
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
using System.Collections.Generic;

namespace Microsoft.Azure.Commands.NetAppFiles.Account
{
Expand Down Expand Up @@ -86,6 +87,18 @@ public class UpdateAzureRmNetAppFilesAccount : AzureNetAppFilesCmdletBase

public override void ExecuteCmdlet()
{
IDictionary<string, string> tagPairs = null;

if (Tag != null)
{
tagPairs = new Dictionary<string, string>();

foreach (string key in Tag.Keys)
{
tagPairs.Add(key, Tag[key].ToString());
}
}

if (ParameterSetName == ResourceIdParameterSet)
{
var resourceIdentifier = new ResourceIdentifier(this.ResourceId);
Expand All @@ -102,7 +115,7 @@ public override void ExecuteCmdlet()
{
Location = Location,
ActiveDirectories = (ActiveDirectory != null) ? ModelExtensions.ConvertActiveDirectoriesFromPs(ActiveDirectory) : null,
Tags = Tag,
Tags =tagPairs,

};

Expand Down
4 changes: 2 additions & 2 deletions src/NetAppFiles/NetAppFiles/Az.NetAppFiles.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# RootModule = ''

# Version number of this module.
ModuleVersion = '0.1.2'
ModuleVersion = '0.1.4'

# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'
Expand Down Expand Up @@ -126,7 +126,7 @@ PrivateData = @{
* Fixed miscellaneous typos across module'

# Prerelease string of this module
# Prerelease = ''
Prerelease = 'preview'

# Flag to indicate whether the module requires explicit user acceptance for install/update/save
# RequireLicenseAcceptance = $false
Expand Down
4 changes: 4 additions & 0 deletions src/NetAppFiles/NetAppFiles/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
-->
## Upcoming Release

* Includes some additional volume properties associated with upcoming replication operations

## Version 0.1.3

* Volume creation --protocol-types accepts now "NFSv4.1" not "NFSv4"
* Volume export policy property now named 'nfsv41' not 'nfsv4'
* Snapshot creation date now named just 'created'
Expand Down
2 changes: 1 addition & 1 deletion src/NetAppFiles/NetAppFiles/NetAppFiles.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Import Project="$(MSBuildThisFileDirectory)..\..\Az.props" />

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.NetApp" Version="1.2.0" />
<PackageReference Include="Microsoft.Azure.Management.NetApp" Version="1.3.0" />
</ItemGroup>

<ItemGroup>
Expand Down
15 changes: 14 additions & 1 deletion src/NetAppFiles/NetAppFiles/Pool/NewNetAppFilesPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// ----------------------------------------------------------------------------------

using System.Collections;
using System.Collections.Generic;
using System.Management.Automation;
using Microsoft.Azure.Commands.NetAppFiles.Common;
using Microsoft.Azure.Commands.NetAppFiles.Models;
Expand Down Expand Up @@ -97,6 +98,18 @@ public class NewAzureRmNetAppFilesPool : AzureNetAppFilesCmdletBase

public override void ExecuteCmdlet()
{
IDictionary<string, string> tagPairs = null;

if (Tag != null)
{
tagPairs = new Dictionary<string, string>();

foreach (string key in Tag.Keys)
{
tagPairs.Add(key, Tag[key].ToString());
}
}

if (ParameterSetName == ParentObjectParameterSet)
{
ResourceGroupName = AccountObject.ResourceGroupName;
Expand All @@ -109,7 +122,7 @@ public override void ExecuteCmdlet()
ServiceLevel = ServiceLevel,
Size = PoolSize,
Location = Location,
Tags = Tag
Tags = tagPairs
};

if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.CreateResourceMessage, ResourceGroupName)))
Expand Down
15 changes: 14 additions & 1 deletion src/NetAppFiles/NetAppFiles/Pool/UpdateNetAppFilesPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using Microsoft.Azure.Management.NetApp.Models;
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
using System.Collections;
using System.Collections.Generic;

namespace Microsoft.Azure.Commands.NetAppFiles.Pool
{
Expand Down Expand Up @@ -118,6 +119,18 @@ public class UpdateAzureRmNetAppFilesPool : AzureNetAppFilesCmdletBase

public override void ExecuteCmdlet()
{
IDictionary<string, string> tagPairs = null;

if (Tag != null)
{
tagPairs = new Dictionary<string, string>();

foreach (string key in Tag.Keys)
{
tagPairs.Add(key, Tag[key].ToString());
}
}

if (ParameterSetName == ResourceIdParameterSet)
{
var resourceIdentifier = new ResourceIdentifier(ResourceId);
Expand Down Expand Up @@ -146,7 +159,7 @@ public override void ExecuteCmdlet()
ServiceLevel = ServiceLevel,
Size = PoolSize,
Location = Location,
Tags = Tag
Tags = tagPairs
};

if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.UpdateResourceMessage, ResourceGroupName)))
Expand Down
14 changes: 13 additions & 1 deletion src/NetAppFiles/NetAppFiles/Volume/NewNetAppFilesVolume.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,18 @@ public class NewAzureRmNetAppFilesVolume : AzureNetAppFilesCmdletBase

public override void ExecuteCmdlet()
{
IDictionary<string, string> tagPairs = null;

if (Tag != null)
{
tagPairs = new Dictionary<string, string>();

foreach (string key in Tag.Keys)
{
tagPairs.Add(key, Tag[key].ToString());
}
}

if (ParameterSetName == ParentObjectParameterSet)
{
ResourceGroupName = PoolObject.ResourceGroupName;
Expand All @@ -158,7 +170,7 @@ public override void ExecuteCmdlet()
Location = Location,
ExportPolicy = (ExportPolicy != null) ? ModelExtensions.ConvertExportPolicyFromPs(ExportPolicy) : null,
ProtocolTypes = ProtocolType,
Tags = Tag
Tags = tagPairs
};

if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.CreateResourceMessage, ResourceGroupName)))
Expand Down
15 changes: 14 additions & 1 deletion src/NetAppFiles/NetAppFiles/Volume/UpdateNetAppFilesVolume.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using Microsoft.Azure.Management.NetApp;
using Microsoft.Azure.Management.NetApp.Models;
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
using System.Collections.Generic;

namespace Microsoft.Azure.Commands.NetAppFiles.Volume
{
Expand Down Expand Up @@ -137,6 +138,18 @@ public class UpdateAzureRmNetAppFilesVolume : AzureNetAppFilesCmdletBase

public override void ExecuteCmdlet()
{
IDictionary<string, string> tagPairs = null;

if (Tag != null)
{
tagPairs = new Dictionary<string, string>();

foreach (string key in Tag.Keys)
{
tagPairs.Add(key, Tag[key].ToString());
}
}

if (ParameterSetName == ResourceIdParameterSet)
{
var resourceIdentifier = new ResourceIdentifier(this.ResourceId);
Expand Down Expand Up @@ -169,7 +182,7 @@ public override void ExecuteCmdlet()
ServiceLevel = ServiceLevel,
UsageThreshold = UsageThreshold,
ExportPolicy = (ExportPolicy != null) ? ModelExtensions.ConvertExportPolicyPatchFromPs(ExportPolicy) : null,
Tags = Tag
Tags = tagPairs
};

if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.UpdateResourceMessage, ResourceGroupName)))
Expand Down

0 comments on commit f5cedb0

Please sign in to comment.