예제 #1
0
 static bool TestStats(IList<string> unparsed)
 {
     string appname = unparsed[0];
     IVcapClient vc = new VcapClient();
     Application app = vc.GetApplication(appname);
     IEnumerable<StatInfo> result = vc.GetStats(app);
     Console.WriteLine(JsonConvert.SerializeObject(result, Formatting.Indented));
     return true;
 }
예제 #2
0
 public ProviderResponse<Application> GetApplication(Application app, Cloud cloud)
 {
     var response = new ProviderResponse<Application>();
     try
     {
         IVcapClient client = new VcapClient(cloud);
         response.Response = client.GetApplication(app.Name);
         var instancesResponse = this.GetInstances(cloud, app);
         if (instancesResponse.Response != null)
             response.Response.InstanceCollection.Synchronize(new SafeObservableCollection<Instance>(instancesResponse.Response),new InstanceEqualityComparer());
     }
     catch (Exception ex)
     {
         response.Message = ex.Message;
     }
     return response;
 }