Skip to content

Commit

Permalink
Use new SDK.
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-shandar committed Dec 4, 2017
1 parent 0ce5261 commit 143153b
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public static ResourceStrategy<TModel> Create<TModel, TOperations>(
createOrUpdateAsync,
config => config.Location,
(config, location) => config.Location = location,
createTime);
createTime,
true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

using Microsoft.Azure.Management.Compute;
using Microsoft.Azure.Management.Compute.Models;
using Microsoft.Azure.Management.Internal.Network.Version2017_03_01.Models;
using Microsoft.Azure.Management.Internal.Resources.Models;
using Microsoft.Azure.Commands.Compute.Strategies.ResourceManager;
using Microsoft.Azure.Management.Internal.Network.Version2017_10_01.Models;

namespace Microsoft.Azure.Commands.Common.Strategies.Compute
{
Expand All @@ -42,7 +42,7 @@ public static ResourceConfig<VirtualMachine> CreateVirtualMachineConfig(
string adminPassword,
Image image,
string size)
=> Strategy.CreateConfig(
=> Strategy.CreateResourceConfig(
resourceGroup,
name,
subscription => new VirtualMachine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Management.Internal.Network.Version2017_03_01;
using Microsoft.Azure.Management.Internal.Network.Version2017_03_01.Models;
using Microsoft.Azure.Commands.Compute.Strategies.ResourceManager;
using Microsoft.Azure.Management.Internal.Network.Version2017_10_01;
using Microsoft.Azure.Management.Internal.Network.Version2017_10_01.Models;
using Microsoft.Azure.Management.Internal.Resources.Models;

namespace Microsoft.Azure.Commands.Common.Strategies.Network
Expand All @@ -37,7 +38,7 @@ public static ResourceConfig<NetworkInterface> CreateNetworkInterfaceConfig(
NestedResourceConfig<Subnet, VirtualNetwork> subnet,
ResourceConfig<PublicIPAddress> publicIPAddress,
ResourceConfig<NetworkSecurityGroup> networkSecurityGroup = null)
=> Strategy.CreateConfig(
=> Strategy.CreateResourceConfig(
resourceGroup,
name,
subscription => new NetworkInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Management.Internal.Network.Version2017_03_01.Models;
using Microsoft.Azure.Management.Internal.Resources.Models;
using Microsoft.Azure.Commands.Compute.Strategies.ResourceManager;
using System.Linq;
using Microsoft.Azure.Management.Internal.Network.Version2017_10_01.Models;
using Microsoft.Azure.Management.Internal.Network.Version2017_10_01;

namespace Microsoft.Azure.Commands.Common.Strategies.Network
{
Expand All @@ -34,7 +35,7 @@ public static class NetworkSecurityGroupStrategy

public static ResourceConfig<NetworkSecurityGroup> CreateNetworkSecurityGroupConfig(
this ResourceConfig<ResourceGroup> resourceGroup, string name, int[] openPorts)
=> Strategy.CreateConfig(
=> Strategy.CreateResourceConfig(
resourceGroup,
name,
_ => new NetworkSecurityGroup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Management.Internal.Network.Version2017_03_01;
using Microsoft.Azure.Management.Internal.Network.Version2017_03_01.Models;
using Microsoft.Azure.Management.Internal.Network.Version2017_10_01;
using Microsoft.Azure.Management.Internal.Network.Version2017_10_01.Models;
using System;
using System.Threading.Tasks;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Management.Network;
using Microsoft.Azure.Management.Network.Models;
using Microsoft.Azure.Management.ResourceManager.Models;
using Microsoft.Azure.Commands.Compute.Strategies.ResourceManager;
using Microsoft.Azure.Management.Internal.Network.Version2017_10_01;
using Microsoft.Azure.Management.Internal.Network.Version2017_10_01.Models;
using Microsoft.Azure.Management.Internal.Resources.Models;

namespace Microsoft.Azure.Commands.Common.Strategies.Network
{
Expand All @@ -36,7 +37,7 @@ public static ResourceConfig<PublicIPAddress> CreatePublicIPAddressConfig(
string name,
string domainNameLabel,
string allocationMethod)
=> Strategy.CreateConfig(
=> Strategy.CreateResourceConfig(
resourceGroup,
name,
_ => new PublicIPAddress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Management.Internal.Network.Version2017_03_01.Models;
using Microsoft.Azure.Management.Internal.Network.Version2017_10_01.Models;
using System.Collections.Generic;
using System.Linq;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Management.Network;
using Microsoft.Azure.Management.Network.Models;
using Microsoft.Azure.Management.ResourceManager.Models;
using Microsoft.Azure.Commands.Compute.Strategies.ResourceManager;
using Microsoft.Azure.Management.Internal.Network.Version2017_10_01;
using Microsoft.Azure.Management.Internal.Network.Version2017_10_01.Models;
using Microsoft.Azure.Management.Internal.Resources.Models;

namespace Microsoft.Azure.Commands.Common.Strategies.Network
{
Expand All @@ -35,7 +36,7 @@ public static ResourceConfig<VirtualNetwork> CreateVirtualNetworkConfig(
this ResourceConfig<ResourceGroup> resourceGroup,
string name,
string addressPrefix)
=> Strategy.CreateConfig(
=> Strategy.CreateResourceConfig(
resourceGroup,
name,
_ => new VirtualNetwork
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Microsoft.Azure.Commands.Compute.Strategies.ResourceManager
{
static class ResourceConfigExtensions
{
public static ResourceConfig<TModel> CreateConfig<TModel>(
public static ResourceConfig<TModel> CreateResourceConfig<TModel>(
this ResourceStrategy<TModel> strategy,
ResourceConfig<ResourceGroup> resourceGroup,
string name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public static class ResourceGroupStrategy
(o, p) => o.CreateOrUpdateAsync(p.Name, p.Model, p.CancellationToken),
model => model.Location,
(model, location) => model.Location = location,
_ => 3);
_ => 3,
false);

public static ResourceConfig<ResourceGroup> CreateResourceGroupConfig(string name)
=> Strategy.CreateConfig(name, name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Management.Compute;
using Microsoft.Azure.Management.Compute.Models;
using Microsoft.Azure.Management.Network;
using Microsoft.Azure.Management.ResourceManager;
using Microsoft.Azure.Management.Storage;
using Microsoft.Azure.Management.Storage.Models;
using System;
Expand Down

0 comments on commit 143153b

Please sign in to comment.