コード例 #1
0
ファイル: NetworkInterface.cs プロジェクト: jasond2014/migAz
        public NetworkInterface(AzureContext azureContext, Arm.NetworkInterface networkInterface, List <VirtualNetwork> virtualNetworks, List <NetworkSecurityGroup> networkSecurityGroups)
        {
            _AzureContext           = azureContext;
            _SourceNetworkInterface = networkInterface;
            this.TargetName         = networkInterface.Name;
            this.IsPrimary          = networkInterface.IsPrimary;

            foreach (Arm.NetworkInterfaceIpConfiguration armNetworkInterfaceIpConfiguration in networkInterface.NetworkInterfaceIpConfigurations)
            {
                MigrationTarget.NetworkInterfaceIpConfiguration targetNetworkInterfaceIpConfiguration = new NetworkInterfaceIpConfiguration(azureContext, armNetworkInterfaceIpConfiguration, virtualNetworks);
                this.TargetNetworkInterfaceIpConfigurations.Add(targetNetworkInterfaceIpConfiguration);
            }

            if (networkInterface.NetworkSecurityGroup != null)
            {
                this.NetworkSecurityGroup = NetworkSecurityGroup.SeekNetworkSecurityGroup(networkSecurityGroups, networkInterface.NetworkSecurityGroup.ToString());
            }
        }
コード例 #2
0
ファイル: NetworkInterface.cs プロジェクト: juliop24/migAz
        public NetworkInterface(Asm.VirtualMachine virtualMachine, Asm.NetworkInterface networkInterface, List <VirtualNetwork> virtualNetworks, List <NetworkSecurityGroup> networkSecurityGroups, TargetSettings targetSettings)
        {
            _SourceNetworkInterface = networkInterface;
            this.SetTargetName(networkInterface.Name, targetSettings);
            this.IsPrimary          = networkInterface.IsPrimary;
            this.EnableIPForwarding = networkInterface.EnableIpForwarding;

            foreach (Asm.NetworkInterfaceIpConfiguration asmNetworkInterfaceIpConfiguration in networkInterface.NetworkInterfaceIpConfigurations)
            {
                NetworkInterfaceIpConfiguration migrationNetworkInterfaceIpConfiguration = new NetworkInterfaceIpConfiguration(asmNetworkInterfaceIpConfiguration, virtualNetworks, targetSettings);
                this.TargetNetworkInterfaceIpConfigurations.Add(migrationNetworkInterfaceIpConfiguration);
            }

            if (virtualMachine.NetworkSecurityGroup != null)
            {
                this.NetworkSecurityGroup = NetworkSecurityGroup.SeekNetworkSecurityGroup(networkSecurityGroups, virtualMachine.NetworkSecurityGroup.ToString());
            }
        }
コード例 #3
0
        public NetworkInterface(Arm.NetworkInterface networkInterface, List <MigrationTarget.VirtualNetwork> armVirtualNetworks, List <MigrationTarget.NetworkSecurityGroup> armNetworkSecurityGroups, TargetSettings targetSettings)
        {
            _SourceNetworkInterface = networkInterface;
            this.SetTargetName(networkInterface.Name, targetSettings);
            this.IsPrimary          = networkInterface.IsPrimary;
            this.EnableIPForwarding = networkInterface.EnableIPForwarding;

            foreach (Arm.NetworkInterfaceIpConfiguration armNetworkInterfaceIpConfiguration in networkInterface.NetworkInterfaceIpConfigurations)
            {
                NetworkInterfaceIpConfiguration targetNetworkInterfaceIpConfiguration = new NetworkInterfaceIpConfiguration(armNetworkInterfaceIpConfiguration, armVirtualNetworks, targetSettings);
                this.TargetNetworkInterfaceIpConfigurations.Add(targetNetworkInterfaceIpConfiguration);
            }

            if (networkInterface.NetworkSecurityGroup != null)
            {
                this.NetworkSecurityGroup = NetworkSecurityGroup.SeekNetworkSecurityGroup(armNetworkSecurityGroups, networkInterface.NetworkSecurityGroup.ToString());
            }
        }
コード例 #4
0
ファイル: NetworkInterface.cs プロジェクト: JF6/migAz
        public NetworkInterface(AzureContext azureContext, Arm.NetworkInterface networkInterface)
        {
            _AzureContext           = azureContext;
            _SourceNetworkInterface = networkInterface;

            this.TargetName         = networkInterface.Name;
            this.IsPrimary          = networkInterface.IsPrimary;
            this.EnableIPForwarding = networkInterface.EnableIPForwarding;

            foreach (Arm.NetworkInterfaceIpConfiguration armNetworkInterfaceIpConfiguration in networkInterface.NetworkInterfaceIpConfigurations)
            {
                MigrationTarget.NetworkInterfaceIpConfiguration targetNetworkInterfaceIpConfiguration = new NetworkInterfaceIpConfiguration(azureContext, armNetworkInterfaceIpConfiguration, azureContext.AzureRetriever.ArmTargetVirtualNetworks);
                this.TargetNetworkInterfaceIpConfigurations.Add(targetNetworkInterfaceIpConfiguration);
            }

            if (networkInterface.NetworkSecurityGroup != null)
            {
                this.NetworkSecurityGroup = NetworkSecurityGroup.SeekNetworkSecurityGroup(azureContext.AzureRetriever.ArmTargetNetworkSecurityGroups, networkInterface.NetworkSecurityGroup.ToString());
            }
        }