Example #1
0
        private string CreateClusterRequest_ToInternalV3(Contracts.May2014.ClusterCreateParameters ccp)
        {
            var ccpAsXmlString = ccp.SerializeAndOptionallyWriteToStream();
            var doc            = new XmlDocument();

            using (var stringReader = new StringReader(ccpAsXmlString))
            {
                using (var reader = XmlReader.Create(stringReader))
                {
                    doc.Load(reader);
                }
            }
            var resource = new RDFEResource {
                SchemaVersion = "3.0", IntrinsicSettings = new XmlNode[] { doc.DocumentElement }
            };

            using (var str = new MemoryStream())
            {
                var serializer = new DataContractSerializer(typeof(RDFEResource));
                serializer.WriteObject(str, resource);

                str.Position = 0;
                using (var reader = new StreamReader(str))
                {
                    return(reader.ReadToEnd());
                }
            }
        }
Example #2
0
 public virtual Task CreateCluster(string subscriptionId, string cloudServiceName, string resourceNamespace, string dnsName, RDFEResource cluster, CancellationToken cancellationToken)
 {
     return((Task)(base.CreateAndInvokeRestRequestForParentMethodAsync(subscriptionId, cloudServiceName, resourceNamespace, dnsName, cluster, cancellationToken)));
 }