예제 #1
0
        public async Task InitializeChildren()
        {
            this._TargetAvailabilitySet = _AzureContext.AzureRetriever.GetAzureARMAvailabilitySet(this);


            if (this.VirtualNetworkName != String.Empty)
            {
                _SourceVirtualNetwork = await _AzureContext.AzureRetriever.GetAzureAsmVirtualNetwork(this.VirtualNetworkName);

                if (_SourceVirtualNetwork != null)
                {
                    foreach (AsmSubnet asmSubnet in _SourceVirtualNetwork.Subnets)
                    {
                        if (asmSubnet.Name == this.SubnetName)
                        {
                            _SourceSubnet = asmSubnet;
                            break;
                        }
                    }
                }
            }

            await _OSVirtualHardDisk.InitializeChildren();

            foreach (AsmDisk asmDisk in this.DataDisks)
            {
                await asmDisk.InitializeChildren();
            }

            if (this.NetworkSecurityGroupName != String.Empty)
            {
                _AsmNetworkSecurityGroup = await _AzureContext.AzureRetriever.GetAzureAsmNetworkSecurityGroup(this.NetworkSecurityGroupName);
            }
        }
예제 #2
0
        public async Task InitializeChildrenAsync()
        {
            if (_XmlNode.SelectSingleNode("AffinityGroup") != null)
            {
                _AsmAffinityGroup = await _AzureContext.AzureRetriever.GetAzureAsmAffinityGroup(_XmlNode.SelectSingleNode("AffinityGroup").InnerText);
            }

            _AsmSubnets = new List <ISubnet>();
            foreach (XmlNode subnetNode in _XmlNode.SelectNodes("Subnets/Subnet"))
            {
                AsmSubnet asmSubnet = new AsmSubnet(_AzureContext, this, subnetNode);
                await asmSubnet.InitializeChildrenAsync();

                _AsmSubnets.Add(asmSubnet);
            }

            _AsmVirtualNetworkGateway = await _AzureContext.AzureRetriever.GetAzureAsmVirtualNetworkGateway(this);

            _AsmLocalNetworkSites = new List <AsmLocalNetworkSite>();
            foreach (XmlNode localNetworkSiteXml in _XmlNode.SelectNodes("Gateway/Sites/LocalNetworkSite"))
            {
                AsmLocalNetworkSite asmLocalNetworkSite = new AsmLocalNetworkSite(_AzureContext, this, localNetworkSiteXml);
                await asmLocalNetworkSite.InitializeChildrenAsync();

                _AsmLocalNetworkSites.Add(asmLocalNetworkSite);
            }

            _AsmClientRootCertificates = await _AzureContext.AzureRetriever.GetAzureAsmClientRootCertificates(this);
        }
예제 #3
0
        public AsmLoadBalancer(AzureContext azureContext, AsmVirtualNetwork asmVirtualNetwork, XmlNode loadBalancerXml)
        {
            this._AzureContext      = azureContext;
            this._AsmVirtualNetwork = asmVirtualNetwork;
            this._XmlNode           = loadBalancerXml;

            this.TargetName = this.SubnetName;

            foreach (AsmSubnet subnet in _AsmVirtualNetwork.Subnets)
            {
                if (subnet.Name == this.SubnetName)
                {
                    _AsmSubnet = subnet;
                    break;
                }
            }
        }