Exemplo n.º 1
0
        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());
            }
        }
Exemplo n.º 2
0
        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());
            }
        }
Exemplo n.º 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());
            }
        }
Exemplo n.º 4
0
        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());
            }
        }