Changeset 7386 for branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Azure
- Timestamp:
- 01/20/12 16:52:52 (13 years ago)
- Location:
- branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Azure
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Azure/AzureProvider.cs
r7374 r7386 36 36 } 37 37 return ServiceManagementOperation.GetSubscriptionInfo(subscriptionId, thumbprint); 38 } 39 40 public HostedService GetHostedService(Subscription subscription, string serviceName) { 41 if (subscription == null) { 42 throw new ArgumentNullException("Subscription must not be null.", "subscription"); 43 } 44 if (serviceName.Length == 0) { 45 throw new ArgumentException("Servicename is not valid.", "serviceName"); 46 } 47 return ServiceManagementOperation.GetHostedServiceDetailed(subscription.SubscriptionID, subscription.CertificateThumbprint, serviceName); 38 48 } 39 49 … … 119 129 120 130 } 131 132 public string DeleteHostedService(Subscription subscription, string serviceName) { 133 if (subscription == null) { 134 throw new ArgumentNullException("Subscription must not be null.", "subscription"); 135 } 136 if (serviceName.Length == 0) { 137 throw new ArgumentException("Servicename is not valid.", "serviceName"); 138 } 139 140 return ServiceManagementOperation.DeleteHostedService(subscription.SubscriptionID, subscription.CertificateThumbprint, serviceName); 141 } 142 143 public List<HostedService> DiscoverSlaveService(Subscription subscription) { 144 if (subscription == null) { 145 throw new ArgumentNullException("Subscription must not be null.", "subscription"); 146 } 147 return ServiceManagementOperation.DiscoverSlaveService(subscription.SubscriptionID, subscription.CertificateThumbprint); 148 } 121 149 } 122 150 } -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Azure/IAzureProvider.cs
r7374 r7386 26 26 public interface IAzureProvider { 27 27 Subscription GetSubscriptionInfo(string subscriptionId, string thumbprint); 28 HostedService GetHostedService(Subscription subscription, string serviceName); 28 29 List<string> ListLocations(Subscription subscription); 29 30 List<HostedService> ListHostedServices(Subscription subscription); … … 34 35 string CreateDeployment(Subscription subscription, string serviceName, string deploymentName, string deploymentSlot, string packageUrl, string configurationUrl, string label); 35 36 string CreateDeployment(Subscription subscription, string serviceName, string deploymentName, string deploymentSlot, string packageUrl, string configurationUrl, string label, int instanceCount); 37 string DeleteHostedService(Subscription subscription, string serviceName); 38 39 List<HostedService> DiscoverSlaveService(Subscription subscription); 36 40 } 37 41 } -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Azure/ServiceManagementOperation.cs
r7374 r7386 117 117 service.ServiceName = response.Descendants(wa + "ServiceName").Single().Value; 118 118 service.Url = response.Descendants(wa + "Url").Single().Value; 119 service.SubscriptionId = subscriptionId; 119 120 return service; 120 121 } … … 127 128 service.ServiceName = response.Descendants(wa + "ServiceName").Single().Value; 128 129 service.Url = response.Descendants(wa + "Url").First().Value; 130 service.SubscriptionId = subscriptionId; 129 131 if (response.Root.Elements(wa + "HostedServiceProperties").Any()) { 130 132 XElement xHostedServiceProperties = response.Descendants(wa + "HostedServiceProperties").Single(); … … 210 212 } 211 213 214 public static List<HostedService> DiscoverSlaveService(string subscriptionId, string thumbprint) { 215 List<HostedService> hostedServices = new List<HostedService>(); 216 foreach (HostedService hostedService in ListHostedServices(subscriptionId, thumbprint)) { 217 HostedService hs = GetHostedServiceDetailed(subscriptionId, thumbprint, hostedService.ServiceName); 218 foreach (Deployment deployment in hs.Deployments) { 219 if (ContainsRoleNameInConfiguration(XDocument.Parse(deployment.Configuration), Constants.HLSlaveRoleName)) { 220 if (!hostedServices.Contains(hs)) { 221 hostedServices.Add(hs); 222 } 223 } 224 } 225 } 226 return hostedServices; 227 } 228 229 public static string DeleteHostedService(string subscriptionId, string thumbprint, string serviceName) { 230 string uri = String.Format(Constants.URISpecificHostedServiceFormat, subscriptionId, serviceName); 231 ServiceWebRequest operation = new ServiceWebRequest(thumbprint); 232 string requestId = operation.Invoke(uri, Constants.HttpMethodDELETE); 233 return requestId; 234 } 235 212 236 #endregion 213 237
Note: See TracChangeset
for help on using the changeset viewer.