From 55e8e56b4bfa756b5a394f1714f3908c8b618a37 Mon Sep 17 00:00:00 2001 From: m-nash <64171366+m-nash@users.noreply.github.com> Date: Thu, 28 Oct 2021 16:51:45 -0700 Subject: [PATCH] prepare release network (#25001) * prepare release network * remove unused field --- .../CHANGELOG.md | 55 ++++++++-------- .../Azure.ResourceManager.Network/README.md | 2 +- .../tests/Samples/Changelog.cs | 63 +++++++++++++++++++ 3 files changed, 92 insertions(+), 28 deletions(-) create mode 100644 sdk/network/Azure.ResourceManager.Network/tests/Samples/Changelog.cs diff --git a/sdk/network/Azure.ResourceManager.Network/CHANGELOG.md b/sdk/network/Azure.ResourceManager.Network/CHANGELOG.md index 015f508bdf9a..26d688a55358 100644 --- a/sdk/network/Azure.ResourceManager.Network/CHANGELOG.md +++ b/sdk/network/Azure.ResourceManager.Network/CHANGELOG.md @@ -1,14 +1,10 @@ # Release History -## 1.0.0-beta.3 (Unreleased) - -### Features Added +## 1.0.0-beta.3 (2021-10-28) ### Breaking Changes -### Bugs Fixed - -### Other Changes +- Renamed [Resource]Container to [Resource]Collection and added the IEnumerable and IAsyncEnumerable interfaces to them making it easier to iterate over the list in the simple case. ## 1.0.0-beta.2 (2021-09-14) @@ -42,7 +38,7 @@ Example: Create a VNet: Before upgrade: -```csharp +```C# using Microsoft.Azure.Management.Network; using Microsoft.Azure.Management.Network.Models; using Microsoft.Rest; @@ -72,27 +68,32 @@ vnet = await networkClient.VirtualNetworks After upgrade: -```csharp -using Azure.Core; +```C# Snippet:Changelog_NewCode +using System; using Azure.Identity; -using Azure.ResourceManager.Network; +using Azure.ResourceManager.Network.Models; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.Resources.Models; -var armClient = new ArmClient(new DefaultAzureCredential()); -var resourceGroup = (await armClient.DefaultSubscription.GetResourceGroups().GetAsync("abc")).Value; -var virtualNetworkContainer = resourceGroup.GetVirtualNetworks(); +ArmClient armClient = new ArmClient(new DefaultAzureCredential()); +Subscription subscription = await armClient.GetDefaultSubscriptionAsync(); +ResourceGroup resourceGroup = await subscription.GetResourceGroups().GetAsync("abc"); +VirtualNetworkCollection virtualNetworkContainer = resourceGroup.GetVirtualNetworks(); // Create VNet -var vnet = new VirtualNetworkData() +VirtualNetworkData vnet = new VirtualNetworkData() { Location = "westus", }; vnet.AddressSpace.AddressPrefixes.Add("10.0.0.0/16"); -vnet.Subnets.Add(new SubnetData { +vnet.Subnets.Add(new SubnetData +{ Name = "mySubnet", AddressPrefix = "10.0.0.0/24", }); -var virtualNetwork = (await virtualNetworkContainer.CreateOrUpdateAsync("_vent", vnet)).Value; +VirtualNetworkCreateOrUpdateOperation vnetOperation = await virtualNetworkContainer.CreateOrUpdateAsync("_vent", vnet); +VirtualNetwork virtualNetwork = vnetOperation.Value; ``` #### Object Model Changes @@ -101,7 +102,7 @@ Example: Create a IpsecPolicy Model Before upgrade: -```csharp +```C# var policy = new IpsecPolicy() { SaLifeTimeSeconds = 300, @@ -117,14 +118,14 @@ var policy = new IpsecPolicy() After upgrade: -```csharp -var policy = new IpsecPolicy( - 300, - 1024, - IpsecEncryption.AES128, - IpsecIntegrity.SHA256, - IkeEncryption.AES192, - IkeIntegrity.SHA1, - DhGroup.DHGroup2, - PfsGroup.PFS1) +```C# Snippet:Changelog_CreateModel +IpsecPolicy policy = new IpsecPolicy( + 300, + 1024, + IpsecEncryption.AES128, + IpsecIntegrity.SHA256, + IkeEncryption.AES192, + IkeIntegrity.SHA1, + DhGroup.DHGroup2, + PfsGroup.PFS1); ``` diff --git a/sdk/network/Azure.ResourceManager.Network/README.md b/sdk/network/Azure.ResourceManager.Network/README.md index 69f16ca0f3cb..ef981de5ced3 100644 --- a/sdk/network/Azure.ResourceManager.Network/README.md +++ b/sdk/network/Azure.ResourceManager.Network/README.md @@ -14,7 +14,7 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur Install the Azure Network management library for .NET with [NuGet](https://www.nuget.org/): ```PowerShell -Install-Package Azure.ResourceManager.Network -Version 1.0.0-beta.1 +Install-Package Azure.ResourceManager.Network -Version 1.0.0-beta.3 ``` ### Prerequisites diff --git a/sdk/network/Azure.ResourceManager.Network/tests/Samples/Changelog.cs b/sdk/network/Azure.ResourceManager.Network/tests/Samples/Changelog.cs new file mode 100644 index 000000000000..5706c63c4bc2 --- /dev/null +++ b/sdk/network/Azure.ResourceManager.Network/tests/Samples/Changelog.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#region Snippet:Changelog_NewCode + using System; + using Azure.Identity; + using Azure.ResourceManager.Network.Models; + using Azure.ResourceManager.Resources; + using Azure.ResourceManager.Resources.Models; + +#if !SNIPPET +using System.Threading.Tasks; +using NUnit.Framework; + +namespace Azure.ResourceManager.Network.Tests.Samples +{ + public class Changelog + { + [Test] + [Ignore("Only verifying that the sample builds")] + public async Task NewCode() + { +#endif + ArmClient armClient = new ArmClient(new DefaultAzureCredential()); + Subscription subscription = await armClient.GetDefaultSubscriptionAsync(); + ResourceGroup resourceGroup = await subscription.GetResourceGroups().GetAsync("abc"); + VirtualNetworkCollection virtualNetworkContainer = resourceGroup.GetVirtualNetworks(); + + // Create VNet + VirtualNetworkData vnet = new VirtualNetworkData() + { + Location = "westus", + }; + vnet.AddressSpace.AddressPrefixes.Add("10.0.0.0/16"); + vnet.Subnets.Add(new SubnetData + { + Name = "mySubnet", + AddressPrefix = "10.0.0.0/24", + }); + + VirtualNetworkCreateOrUpdateOperation vnetOperation = await virtualNetworkContainer.CreateOrUpdateAsync("_vent", vnet); + VirtualNetwork virtualNetwork = vnetOperation.Value; + #endregion + } + + [Test] + [Ignore("Only verifying that the sample builds")] + public void CreateModel() + { + #region Snippet:Changelog_CreateModel + IpsecPolicy policy = new IpsecPolicy( + 300, + 1024, + IpsecEncryption.AES128, + IpsecIntegrity.SHA256, + IkeEncryption.AES192, + IkeIntegrity.SHA1, + DhGroup.DHGroup2, + PfsGroup.PFS1); + #endregion + } + } +}