Changeset 7374 for branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Azure/ServiceManagementOperation.cs
- Timestamp:
- 01/19/12 17:45:21 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Azure/ServiceManagementOperation.cs
r7354 r7374 24 24 using System.IO; 25 25 using System.Linq; 26 using System.Net; 26 27 using System.Xml.Linq; 27 28 using HeuristicLab.Clients.Hive.CloudManager.Model; … … 185 186 } 186 187 187 188 public static string CreateDeployment(string subscriptionId, string thumbprint, string serviceName, string deploymentName, string deploymentSlot, string packageUrl, string configuration, string label, int instanceCount) { 189 string uri = String.Format(Constants.URIDeploymentFormat, subscriptionId, serviceName, deploymentSlot); 190 XElement xConfig = XElement.Parse(configuration); 191 SetInstanceCount(xConfig, Constants.HLSlaveRoleName, instanceCount); 192 193 XDocument payload = CreateDeploymentPayload(deploymentName, packageUrl, xConfig, label); 194 ServiceWebRequest operation = new ServiceWebRequest(thumbprint); 195 string requestId = operation.Invoke(uri, payload); 196 return requestId; 197 } 198 199 public static string DownloadBlobAsString(Uri uri) { 200 HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri); 201 request.Headers.Add(Constants.HeaderVersionName, Constants.APIVersion20110818); 202 request.Method = Constants.HttpMethodGET; 203 request.ContentType = Constants.ContentTypeAppXml; 204 string result = string.Empty; 205 WebResponse response = request.GetResponse(); 206 using (StreamReader reader = new StreamReader(response.GetResponseStream())) { 207 result = reader.ReadToEnd(); 208 } 209 return result; 210 } 188 211 189 212 #endregion
Note: See TracChangeset
for help on using the changeset viewer.