示例#1
0
 public AsmLocalNetworkSite(AzureContext azureContext, AsmVirtualNetwork parent, XmlNode xmlNode)
 {
     _AzureContext   = azureContext;
     _Parent         = parent;
     _XmlNode        = xmlNode;
     this.TargetName = this.Name;
 }
示例#2
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);
            }
        }
示例#3
0
        internal AsmSubnet(AzureContext azureContext, AsmVirtualNetwork parent, XmlNode xmlNode)
        {
            _AzureContext = azureContext;
            _Parent       = parent;
            _XmlNode      = xmlNode;

            this.TargetName = this.Name;
        }
示例#4
0
        public async Task LoadChildrenAsync()
        {
            if (this.VirtualNetworkName != String.Empty)
            {
                _AsmVirtualNetwork = await this._AzureContext.AzureRetriever.GetAzureAsmVirtualNetwork(this.VirtualNetworkName);
            }

            if (this.AffinityGroupName == String.Empty)
            {
                _AsmAffinityGroup = null;
            }
            else
            {
                _AsmAffinityGroup = await this._AzureContext.AzureRetriever.GetAzureAsmAffinityGroup(this.AffinityGroupName);
            }

            _VirtualMachines = new List <AsmVirtualMachine>();
            if (_XmlNode.SelectNodes("//Deployments/Deployment").Count > 0)
            {
                if (_XmlNode.SelectNodes("//Deployments/Deployment")[0].SelectNodes("RoleList/Role")[0].SelectNodes("RoleType").Count > 0)
                {
                    if (_XmlNode.SelectNodes("//Deployments/Deployment")[0].SelectNodes("RoleList/Role")[0].SelectSingleNode("RoleType").InnerText == "PersistentVMRole")
                    {
                        XmlNodeList roles = _XmlNode.SelectNodes("//Deployments/Deployment")[0].SelectNodes("RoleList/Role");

                        foreach (XmlNode role in roles)
                        {
                            string virtualmachinename = role.SelectSingleNode("RoleName").InnerText;

                            AsmVirtualMachine asmVirtualMachine = await _AzureContext.AzureRetriever.GetAzureAsmVirtualMachine(this, virtualmachinename);

                            _VirtualMachines.Add(asmVirtualMachine);
                        }
                    }
                }
            }

            List <AsmReservedIP> asmReservedIPs = await _AzureContext.AzureRetriever.GetAzureAsmReservedIPs();

            foreach (AsmReservedIP asmReservedIP in asmReservedIPs)
            {
                if (asmReservedIP.ServiceName == this.ServiceName)
                {
                    _AsmReservedIP = asmReservedIP;
                }
            }

            XmlNodeList loadBalancersXml = _XmlNode.SelectNodes("//Deployments/Deployment/LoadBalancers/LoadBalancer");

            foreach (XmlNode loadBalancerXml in loadBalancersXml)
            {
                AsmLoadBalancer asmLoadBalancer = new AsmLoadBalancer(_AzureContext, _AsmVirtualNetwork, loadBalancerXml);
                _LoadBalancers.Add(asmLoadBalancer);
            }
        }
示例#5
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;
                }
            }
        }
示例#6
0
 public AsmVirtualNetworkGateway(AzureContext azureContext, AsmVirtualNetwork parentNetwork, XmlNode gatewayXml)
 {
     this._AzureContext      = azureContext;
     this._AsmVirtualNetwork = parentNetwork;
     this._GatewayXml        = gatewayXml;
 }
 public AsmClientRootCertificate(AzureContext azureContext, AsmVirtualNetwork asmVirtualNetwork, XmlNode clientRootCertificateXml)
 {
     this._AzureContext             = azureContext;
     this._AsmVirtualNetwork        = asmVirtualNetwork;
     this._ClientRootCertificateXml = clientRootCertificateXml;
 }