Elastacloud.AzureManagement.Fluent.Types.VirtualMachines.Deployment.GetXmlTree C# (CSharp) Method

GetXmlTree() public method

Gets the Xml tree for the custom serialiser
public GetXmlTree ( ) : System.Xml.Linq.XElement
return System.Xml.Linq.XElement
        public XElement GetXmlTree()
        {
            return new XElement(Namespaces.NsWindowsAzure + "Deployment",
                                new XElement(Namespaces.NsWindowsAzure + "Name", Name),
                                new XElement(Namespaces.NsWindowsAzure + "DeploymentSlot", "Production"),
                                new XElement(Namespaces.NsWindowsAzure + "Label", Label), RoleList.GetXmlTree(),
                                new XElement(Namespaces.NsWindowsAzure + "VirtualNetworkName", VirtualNetworkName));
        }

Usage Example

Example #1
0
        /// <summary>
        /// Creates a deployment payload for a predefined template
        /// </summary>
        /// <returns>A string xml representation</returns>
        protected override string CreateXmlPayload()
        {
            Deployment deployment = null;

            switch (VirtualMachineType)
            {
            case VirtualMachineTemplates.SqlServer2012:
                deployment = Deployment.GetDefaultSqlServer2012Deployment(CloudServiceName, VhdStorageAccount);
                break;
            }
            var document = new XDocument(deployment.GetXmlTree());

            return(document.ToStringFullXmlDeclarationWithReplace());
        }