Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/18/12 09:41:57 (13 years ago)
Author:
spimming
Message:

#1680:

  • Methods to create hosted services added
  • Method to add a certificate to a hosted service
  • update bindinglist from worker
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  
    4040    public List<string> ListLocations(Subscription subscription) {
    4141      if (subscription == null) {
    42         throw new ArgumentException("Subscription must not be null.", "subscription");
     42        throw new ArgumentNullException("Subscription must not be null.", "subscription");
    4343      }
    4444      return ServiceManagementOperation.ListLocations(subscription.SubscriptionID, subscription.CertificateThumbprint);
     
    4747    public List<HostedService> ListHostedServices(Subscription subscription) {
    4848      if (subscription == null) {
    49         throw new ArgumentException("Subscription must not be null.", "subscription");
     49        throw new ArgumentNullException("Subscription must not be null.", "subscription");
    5050      }
    5151      return ServiceManagementOperation.ListHostedServices(subscription.SubscriptionID, subscription.CertificateThumbprint);
     
    5454    public List<AffinityGroup> ListAffinityGroups(Subscription subscription) {
    5555      if (subscription == null) {
    56         throw new ArgumentException("Subscription must not be null.", "subscription");
     56        throw new ArgumentNullException("Subscription must not be null.", "subscription");
    5757      }
    5858      return ServiceManagementOperation.ListAffinityGroups(subscription.SubscriptionID, subscription.CertificateThumbprint);
    5959    }
     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
    60105  }
    61106}
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Azure/IAzureProvider.cs

    r7339 r7354  
    2929    List<HostedService> ListHostedServices(Subscription subscription);
    3030    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);
    3234  }
    3335}
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Azure/ServiceManagementOperation.cs

    r7339 r7354  
    169169    }
    170170
     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
    171189    #endregion
    172190
Note: See TracChangeset for help on using the changeset viewer.