Beispiel #1
0
        public VirtualNetwork(Arm.VirtualNetwork virtualNetwork, List <NetworkSecurityGroup> networkSecurityGroups, List <RouteTable> routeTables, TargetSettings targetSettings) : base(ArmConst.MicrosoftNetwork, ArmConst.VirtualNetworks)
        {
            this.SourceVirtualNetwork = virtualNetwork;
            this.SetTargetName(virtualNetwork.Name, targetSettings);

            foreach (Arm.VirtualNetworkGateway virtualNetworkGateway in virtualNetwork.VirtualNetworkGateways)
            {
                TargetVirtualNetworkGateways.Add(new VirtualNetworkGateway(virtualNetworkGateway, targetSettings));
            }

            foreach (Arm.Subnet subnet in virtualNetwork.Subnets)
            {
                this.TargetSubnets.Add(new Subnet(this, subnet, networkSecurityGroups, routeTables, targetSettings));
            }

            foreach (String addressPrefix in virtualNetwork.AddressPrefixes)
            {
                this.AddressPrefixes.Add(addressPrefix);
            }

            foreach (String dnsServer in virtualNetwork.DnsServers)
            {
                this.DnsServers.Add(dnsServer);
            }
        }
        public VirtualNetwork(AzureContext azureContext, Arm.VirtualNetwork virtualNetwork, List <NetworkSecurityGroup> networkSecurityGroups, List <RouteTable> routeTables)
        {
            this._AzureContext        = azureContext;
            this.SourceVirtualNetwork = virtualNetwork;
            this.TargetName           = virtualNetwork.Name;

            foreach (Arm.VirtualNetworkGateway virtualNetworkGateway in virtualNetwork.VirtualNetworkGateways)
            {
                TargetVirtualNetworkGateways.Add(new VirtualNetworkGateway(_AzureContext, virtualNetworkGateway));
            }

            foreach (Arm.Subnet subnet in virtualNetwork.Subnets)
            {
                this.TargetSubnets.Add(new Subnet(azureContext, this, subnet, networkSecurityGroups, routeTables));
            }

            foreach (String addressPrefix in virtualNetwork.AddressPrefixes)
            {
                this.AddressPrefixes.Add(addressPrefix);
            }

            foreach (String dnsServer in virtualNetwork.DnsServers)
            {
                this.DnsServers.Add(dnsServer);
            }
        }