Changeset 7354 for branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Azure
- Timestamp:
- 01/18/12 09:41:57 (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
r7339 r7354 40 40 public List<string> ListLocations(Subscription subscription) { 41 41 if (subscription == null) { 42 throw new Argument Exception("Subscription must not be null.", "subscription");42 throw new ArgumentNullException("Subscription must not be null.", "subscription"); 43 43 } 44 44 return ServiceManagementOperation.ListLocations(subscription.SubscriptionID, subscription.CertificateThumbprint); … … 47 47 public List<HostedService> ListHostedServices(Subscription subscription) { 48 48 if (subscription == null) { 49 throw new Argument Exception("Subscription must not be null.", "subscription");49 throw new ArgumentNullException("Subscription must not be null.", "subscription"); 50 50 } 51 51 return ServiceManagementOperation.ListHostedServices(subscription.SubscriptionID, subscription.CertificateThumbprint); … … 54 54 public List<AffinityGroup> ListAffinityGroups(Subscription subscription) { 55 55 if (subscription == null) { 56 throw new Argument Exception("Subscription must not be null.", "subscription");56 throw new ArgumentNullException("Subscription must not be null.", "subscription"); 57 57 } 58 58 return ServiceManagementOperation.ListAffinityGroups(subscription.SubscriptionID, subscription.CertificateThumbprint); 59 59 } 60 61 public string CreateHostedService(Subscription subscription, string serviceName, string label, string description, AffinityGroup affinityGroup) { 62 if (subscription == null) { 63 throw new ArgumentNullException("Subscription must not be null.", "subscription"); 64 } 65 if (serviceName.Length == 0) { 66 throw new ArgumentException("Servicename is not valid.", "serviceName"); 67 } 68 if (label.Length == 0) { 69 throw new ArgumentException("Label is not valid.", "label"); 70 } 71 if (affinityGroup == null) { 72 throw new ArgumentNullException("AffinityGroup must not be null.", "affinityGroup"); 73 } 74 75 return ServiceManagementOperation.CreateHostedServiceWithAffinityGroup(subscription.SubscriptionID, subscription.CertificateThumbprint, serviceName, label, description, affinityGroup.Name); 76 } 77 78 public string CreateHostedService(Subscription subscription, string serviceName, string label, string description, string location) { 79 if (subscription == null) { 80 throw new ArgumentNullException("Subscription must not be null.", "subscription"); 81 } 82 if (serviceName.Length == 0) { 83 throw new ArgumentException("Servicename is not valid.", "serviceName"); 84 } 85 if (label.Length == 0) { 86 throw new ArgumentException("Label is not valid.", "label"); 87 } 88 if (location.Length == 0) { 89 throw new ArgumentException("Location is not valid.", "location"); 90 } 91 92 return ServiceManagementOperation.CreateHostedServiceWithLocation(subscription.SubscriptionID, subscription.CertificateThumbprint, serviceName, label, description, location); 93 } 94 95 public string AddCertificate(Subscription subscription, HostedService service, string certficateFilePath, string certificatePassword) { 96 if (subscription == null) { 97 throw new ArgumentNullException("Subscription must not be null.", "subscription"); 98 } 99 if (service == null) { 100 throw new ArgumentNullException("HostedService must not be null.", "service"); 101 } 102 return ServiceManagementOperation.AddCertificate(subscription.SubscriptionID, subscription.CertificateThumbprint, service.ServiceName, certficateFilePath, certificatePassword); 103 } 104 60 105 } 61 106 } -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Azure/IAzureProvider.cs
r7339 r7354 29 29 List<HostedService> ListHostedServices(Subscription subscription); 30 30 List<AffinityGroup> ListAffinityGroups(Subscription subscription); 31 31 string CreateHostedService(Subscription subscription, string serviceName, string label, string description, AffinityGroup affinityGroup); 32 string CreateHostedService(Subscription subscription, string serviceName, string label, string description, string location); 33 string AddCertificate(Subscription subscription, HostedService service, string certficateFilePath, string certificatePassword); 32 34 } 33 35 } -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Azure/ServiceManagementOperation.cs
r7339 r7354 169 169 } 170 170 171 public static string AddCertificate(string subscriptionId, string thumbprint, string serviceName, string certificateFilePath, string password) { 172 string uri = String.Format(Constants.URICertificateFormat, subscriptionId, serviceName); 173 XDocument payload = CreateAddCertificatePayload(certificateFilePath, password); 174 ServiceWebRequest operation = new ServiceWebRequest(thumbprint); 175 string requestId = operation.Invoke(uri, payload); 176 return requestId; 177 } 178 179 public static string CreateHostedServiceWithLocation(string subscriptionId, string thumbprint, string serviceName, string label, string description, string location) { 180 return CreateHostedService(subscriptionId, thumbprint, serviceName, label, description, location, String.Empty); 181 } 182 183 public static string CreateHostedServiceWithAffinityGroup(string subscriptionId, string thumbprint, string serviceName, string label, string description, string affinityGroup) { 184 return CreateHostedService(subscriptionId, thumbprint, serviceName, label, description, String.Empty, affinityGroup); 185 } 186 187 188 171 189 #endregion 172 190
Note: See TracChangeset
for help on using the changeset viewer.