Changeset 7545
- Timestamp:
- 03/05/12 13:38:48 (13 years ago)
- Location:
- branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Azure
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Azure/AzureProvider.cs
r7429 r7545 53 53 } 54 54 55 public StorageServiceKeys GetStorageKeys(Subscription subscription, string serviceName) { 56 if (subscription == null) { 57 throw new ArgumentNullException("Subscription must not be null.", "subscription"); 58 } 59 if (serviceName.Length == 0) { 60 throw new ArgumentException("Servicename is not valid.", "serviceName"); 61 } 62 return ServiceManagementOperation.GetStorageKeys(subscription.SubscriptionID, subscription.CertificateThumbprint, serviceName); 63 } 64 55 65 public List<string> ListLocations(Subscription subscription) { 56 66 if (subscription == null) { … … 81 91 } 82 92 return ServiceManagementOperation.ListAffinityGroups(subscription.SubscriptionID, subscription.CertificateThumbprint); 93 } 94 95 public List<StorageService> ListStorageServices(Subscription subscription) { 96 if (subscription == null) { 97 throw new ArgumentNullException("Subscription must not be null.", "subscription"); 98 } 99 return ServiceManagementOperation.ListStorageServices(subscription.SubscriptionID, subscription.CertificateThumbprint); 83 100 } 84 101 -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Azure/Constants.cs
r7441 r7545 65 65 public const string URIHostedServiceFormat = "https://management.core.windows.net/{0}/services/hostedservices"; 66 66 public const string URISpecificHostedServiceFormat = "https://management.core.windows.net/{0}/services/hostedservices/{1}"; 67 public const string URIStorageServiceFormat = "https://management.core.windows.net/{0}/services/storageservices"; 68 public const string URISpecificStorageServiceFormat = "https://management.core.windows.net/{0}/services/storageservices/{1}"; 69 public const string URIStorageServiceKeys = "https://management.core.windows.net/{0}/services/storageservices/{1}/keys"; 67 70 public const string URILocationsFormat = "https://management.core.windows.net/{0}/locations"; 68 71 public const string URIAffinityGroupFormat = "https://management.core.windows.net/{0}/affinitygroups"; -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Azure/IAzureProvider.cs
r7429 r7545 27 27 Subscription GetSubscriptionInfo(string subscriptionId, string thumbprint); 28 28 HostedService GetHostedService(Subscription subscription, string serviceName); 29 StorageServiceKeys GetStorageKeys(Subscription subscription, string serviceName); 29 30 List<string> ListLocations(Subscription subscription); 30 31 List<HostedService> ListHostedServices(Subscription subscription); 31 32 List<AffinityGroup> ListAffinityGroups(Subscription subscription); 33 List<StorageService> ListStorageServices(Subscription subscription); 32 34 string CreateHostedService(Subscription subscription, string serviceName, string label, string description, AffinityGroup affinityGroup); 33 35 string CreateHostedService(Subscription subscription, string serviceName, string label, string description, string location); -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Azure/ServiceManagementOperation.cs
r7429 r7545 108 108 else 109 109 return new List<HostedService>(); 110 } 111 112 public static List<StorageService> ListStorageServices(string subscriptionId, string thumbprint) { 113 string uri = string.Format(Constants.URIStorageServiceFormat, subscriptionId); 114 ServiceWebRequest operation = new ServiceWebRequest(thumbprint); 115 XDocument response = operation.Invoke(uri); 116 List<StorageService> result = null; 117 if (response.Root.HasElements) { 118 result = (from s in response.Elements() 119 select new StorageService() { 120 Url = s.Descendants(wa + "Url").Single().Value, 121 ServiceName = s.Descendants(wa + "ServiceName").Single().Value 122 }).ToList(); 123 } 124 if (result != null) 125 return result; 126 else 127 return new List<StorageService>(); 110 128 } 111 129 … … 170 188 } 171 189 190 public static StorageServiceKeys GetStorageKeys(string subscriptionId, string thumbprint, string serviceName) { 191 string uri = string.Format(Constants.URIStorageServiceKeys, subscriptionId, serviceName); 192 ServiceWebRequest operation = new ServiceWebRequest(thumbprint); 193 XDocument response = operation.Invoke(uri); 194 StorageServiceKeys keys = new StorageServiceKeys(); 195 keys.Primary = response.Descendants(wa + "Primary").Single().Value; 196 keys.Secondary = response.Descendants(wa + "Secondary").Single().Value; 197 return keys; 198 } 199 172 200 public static string AddCertificate(string subscriptionId, string thumbprint, string serviceName, string certificateFilePath, string password) { 173 201 string uri = String.Format(Constants.URICertificateFormat, subscriptionId, serviceName);
Note: See TracChangeset
for help on using the changeset viewer.