forked from Azure/azure-powershell
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
76129f3
commit ccb9d0e
Showing
11 changed files
with
58 additions
and
114 deletions.
There are no files selected for viewing
8 changes: 2 additions & 6 deletions
8
experiments/Azure.Experiments/Azure.Experiments/Compute/ComputePolicy.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 6 additions & 10 deletions
16
experiments/Azure.Experiments/Azure.Experiments/Compute/VirtualMachinePolicy.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 8 additions & 12 deletions
20
experiments/Azure.Experiments/Azure.Experiments/Network/NetworkInterfacePolicy.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 5 additions & 8 deletions
13
experiments/Azure.Experiments/Azure.Experiments/Network/NetworkSecurityGroupPolicy.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,19 @@ | ||
using Microsoft.Azure.Experiments.ResourceManager; | ||
using Microsoft.Azure.Management.Network; | ||
using Microsoft.Azure.Management.Network; | ||
using Microsoft.Azure.Management.Network.Models; | ||
using Microsoft.Azure.Management.ResourceManager.Models; | ||
|
||
namespace Microsoft.Azure.Experiments.Network | ||
{ | ||
public static class NetworkSecurityGroupPolicy | ||
{ | ||
public static ResourcePolicy<ResourceName, NetworkSecurityGroup> Policy { get; } | ||
public static ResourcePolicy<NetworkSecurityGroup> Policy { get; } | ||
= NetworkPolicy.Create( | ||
client => client.NetworkSecurityGroups, | ||
(operations, name) => operations.GetAsync(name.ResourceGroupName, name.Name), | ||
(operations, name, info) | ||
=> operations.CreateOrUpdateAsync(name.ResourceGroupName, name.Name, info)); | ||
|
||
public static ResourceConfig<ResourceName, NetworkSecurityGroup> CreateNetworkSecurityGroupConfig( | ||
this ResourceConfig<string, ResourceGroup> resourceGroup, | ||
string name) | ||
=> resourceGroup.CreateResourceConfig(Policy, name, _ => new NetworkSecurityGroup()); | ||
public static ResourceConfig<NetworkSecurityGroup> CreateNetworkSecurityGroupConfig( | ||
this ResourceName name) | ||
=> Policy.CreateResourceConfig(name, _ => new NetworkSecurityGroup()); | ||
} | ||
} |
13 changes: 5 additions & 8 deletions
13
experiments/Azure.Experiments/Azure.Experiments/Network/PublicIPAddressPolicy.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,19 @@ | ||
using Microsoft.Azure.Experiments.ResourceManager; | ||
using Microsoft.Azure.Management.Network; | ||
using Microsoft.Azure.Management.Network; | ||
using Microsoft.Azure.Management.Network.Models; | ||
using Microsoft.Azure.Management.ResourceManager.Models; | ||
|
||
namespace Microsoft.Azure.Experiments.Network | ||
{ | ||
public static class PublicIPAddressPolicy | ||
{ | ||
public static ResourcePolicy<ResourceName, PublicIPAddress> Policy { get; } | ||
public static ResourcePolicy<PublicIPAddress> Policy { get; } | ||
= NetworkPolicy.Create( | ||
client => client.PublicIPAddresses, | ||
(operations, name) => operations.GetAsync(name.ResourceGroupName, name.Name), | ||
(operations, name, info) | ||
=> operations.CreateOrUpdateAsync(name.ResourceGroupName, name.Name, info)); | ||
|
||
public static ResourceConfig<ResourceName, PublicIPAddress> CreatePublicIPAddressConfig( | ||
this ResourceConfig<string, ResourceGroup> resourceGroup, | ||
string name) | ||
=> resourceGroup.CreateResourceConfig(Policy, name, _ => new PublicIPAddress()); | ||
public static ResourceConfig<PublicIPAddress> CreatePublicIPAddressConfig( | ||
this ResourceName name) | ||
=> Policy.CreateResourceConfig(name, _ => new PublicIPAddress()); | ||
} | ||
} |
14 changes: 5 additions & 9 deletions
14
experiments/Azure.Experiments/Azure.Experiments/Network/VirtualNetworkPolicy.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,19 @@ | ||
using Microsoft.Azure.Experiments.ResourceManager; | ||
using Microsoft.Azure.Management.Network; | ||
using Microsoft.Azure.Management.Network; | ||
using Microsoft.Azure.Management.Network.Models; | ||
using Microsoft.Azure.Management.ResourceManager.Models; | ||
|
||
namespace Microsoft.Azure.Experiments.Network | ||
{ | ||
public static class VirtualNetworkPolicy | ||
{ | ||
public static ResourcePolicy<ResourceName, VirtualNetwork> Policy { get; } | ||
public static ResourcePolicy<VirtualNetwork> Policy { get; } | ||
= NetworkPolicy.Create( | ||
client => client.VirtualNetworks, | ||
(operations, name) => operations.GetAsync(name.ResourceGroupName, name.Name), | ||
(operations, name, info) | ||
=> operations.CreateOrUpdateAsync(name.ResourceGroupName, name.Name, info)); | ||
|
||
public static ResourceConfig<ResourceName, VirtualNetwork> CreateVirtualNetworkConfig( | ||
this ResourceConfig<string, ResourceGroup> resourceGroup, | ||
string name) | ||
=> resourceGroup.CreateResourceConfig( | ||
Policy, name, _ => new VirtualNetwork()); | ||
public static ResourceConfig<VirtualNetwork> CreateVirtualNetworkConfig( | ||
this ResourceName name) | ||
=> Policy.CreateResourceConfig(name, _ => new VirtualNetwork()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 0 additions & 34 deletions
34
experiments/Azure.Experiments/Azure.Experiments/ResourceManager/ResourceGroupPolicy.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters