Exemplo n.º 1
0
 public static string GetInstanceCount(Application application)
 {
     var instanceCount = "0";
     if (application.RunningInstances != null)
     {
         instanceCount = application.RunningInstances.ToString();
     }
     return instanceCount;
 }
        public void with_a_standard_default_application()
        {
            cloudActive = new VcapClient(TestAccountInformation.GoodUri.ToString());
            cloudActive.Login(
                TestAccountInformation.Username,
                TestAccountInformation.Password);

            var currentDirectory = Directory.GetCurrentDirectory();
            var pathToTestApp = new DirectoryInfo(currentDirectory + TestAccountInformation.TestAppToPush);

            cloudActive.Push(TestAccountInformation.TestApplicationName, TestAccountInformation.HttpIntegrationTestApiIronfoundryMe, 1,
                pathToTestApp, 64, null);
            testApplication = cloudActive.GetApplication(TestAccountInformation.TestApplicationName);
        }
Exemplo n.º 3
0
        public static FoundryApplication FoundryApplicationMap(FoundryTarget target,
                                                              Application cloudApplication)
        {
            var foundryApplication =
                new FoundryApplication { Name = cloudApplication.Name, Target = target };
            
            var rootUri = cloudApplication.Uris[0];
            if (!string.IsNullOrWhiteSpace(rootUri))
            {
                if (!rootUri.StartsWith("http://"))
                {
                    rootUri = "http://" + rootUri;
                    foundryApplication.Path = new Uri(rootUri);
                }
            }

            return foundryApplication;
        }
Exemplo n.º 4
0
        public void UpdateApplication(Application application)
        {
            VcapJsonRequest r = BuildVcapJsonRequest(Method.PUT, Constants.AppsResource, application.Name);
            r.AddBody(application);
            var response = r.Execute<VcapResponse>();

            if (response != null && !string.IsNullOrEmpty(response.Description))
            {
                throw new VcapException(response.Description);
            }
        }
Exemplo n.º 5
0
 public void Stop(Application application)
 {
     application.Stop();
     UpdateApplication(application);
 }
Exemplo n.º 6
0
 public void Start(Application application)
 {
     application.Start();
     UpdateApplication(application);
     if (!IsStarted(application.Name))
     {
         throw new VcapException("Failed to start application.");
     }
 }
Exemplo n.º 7
0
 public void Restart(Application applicationName)
 {
     Stop(applicationName);
     Start(applicationName);
 }
Exemplo n.º 8
0
 public void UpdateApplication(Application app)
 {
     var helper = new AppsHelper(_proxyUser, _credMgr);
     helper.UpdateApplication(app);
 }
Exemplo n.º 9
0
 public void Stop(Application app)
 {
     var helper = new AppsHelper(_proxyUser, _credMgr);
     helper.Stop(app);
 }
Exemplo n.º 10
0
 public void Start(Application app)
 {
     var helper = new AppsHelper(proxyUser, credMgr);
     helper.Start(app);
 }
Exemplo n.º 11
0
 public IEnumerable<StatInfo> GetStats(Application app)
 {
     var info = new InfoHelper(_proxyUser, _credMgr);
     return info.GetStats(app);
 }
Exemplo n.º 12
0
 public string GetLogs(Application app, ushort instanceNumber)
 {
     var info = new InfoHelper(_proxyUser, _credMgr);
     return info.GetLogs(app, instanceNumber);
 }
Exemplo n.º 13
0
 public IEnumerable<ExternalInstance> GetInstances(Application app)
 {
     var info = new InfoHelper(_proxyUser, _credMgr);
     return info.GetInstances(app);
 }
Exemplo n.º 14
0
 public IEnumerable<Crash> GetAppCrash(Application app)
 {
     var helper = new AppsHelper(_proxyUser, _credMgr);
     return helper.GetAppCrash(app);
 }
Exemplo n.º 15
0
 public void Delete(Application app)
 {
     var helper = new AppsHelper(_proxyUser, _credMgr);
     helper.Delete(app);
 }
Exemplo n.º 16
0
 public void Delete(Application application)
 {
     VcapJsonRequest r = BuildVcapJsonRequest(Method.DELETE, Constants.AppsResource, application.Name);
     r.Execute();
 }
Exemplo n.º 17
0
 public IEnumerable<Crash> GetAppCrash(Application app)
 {
     VcapRequest r = base.BuildVcapRequest(Constants.AppsResource, app.Name, "crashes");
     return r.Execute<Crash[]>();
 }
Exemplo n.º 18
0
 public void Restart(Application app)
 {
     var helper = new AppsHelper(_proxyUser, _credMgr);
     helper.Restart(app);
 }