Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/20/12 16:52:52 (12 years ago)
Author:
spimming
Message:

#1680:

  • Added property to refer to the corresponding subscription
  • Added new methods to azure management utils
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Azure/ServiceManagementOperation.cs

    r7374 r7386  
    117117      service.ServiceName = response.Descendants(wa + "ServiceName").Single().Value;
    118118      service.Url = response.Descendants(wa + "Url").Single().Value;
     119      service.SubscriptionId = subscriptionId;
    119120      return service;
    120121    }
     
    127128      service.ServiceName = response.Descendants(wa + "ServiceName").Single().Value;
    128129      service.Url = response.Descendants(wa + "Url").First().Value;
     130      service.SubscriptionId = subscriptionId;
    129131      if (response.Root.Elements(wa + "HostedServiceProperties").Any()) {
    130132        XElement xHostedServiceProperties = response.Descendants(wa + "HostedServiceProperties").Single();
     
    210212    }
    211213
     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
    212236    #endregion
    213237
Note: See TracChangeset for help on using the changeset viewer.