public IEnumerable <Crash> GetAppCrash(Application app)
        {
            checkLoginStatus();
            var hlpr = new AppsHelper(credMgr);

            return(hlpr.GetAppCrash(app));
        }
        public VcapResponse UpdateApplication(Application app)
        {
            checkLoginStatus();
            var hlpr = new AppsHelper(credMgr);

            return(hlpr.UpdateApplication(app));
        }
        public void Restart(Application app)
        {
            checkLoginStatus();
            var hlpr = new AppsHelper(credMgr);

            hlpr.Restart(app);
        }
        public void Stop(Application app)
        {
            checkLoginStatus();
            var hlpr = new AppsHelper(credMgr);

            hlpr.Stop(app);
        }
        public byte[] FilesSimple(string appName, string path, ushort instance)
        {
            checkLoginStatus();
            var hlpr = new AppsHelper(credMgr);

            return(hlpr.Files(appName, path, instance));
        }
        public void Delete(string name)
        {
            checkLoginStatus();
            var hlpr = new AppsHelper(credMgr);

            hlpr.Delete(name);
        }
        public VcapClientResult Update(string name, DirectoryInfo path)
        {
            checkLoginStatus();
            var hlpr = new AppsHelper(credMgr);

            return(hlpr.Update(name, path));
        }
Exemple #8
0
        public void Push(string name, string deployFQDN, ushort instances,
                         DirectoryInfo path, uint memoryMB, string[] provisionedServiceNames)
        {
            var helper = new AppsHelper(proxyUser, credMgr);

            helper.Push(name, deployFQDN, instances, path, memoryMB, provisionedServiceNames);
        }
Exemple #9
0
        public Application GetApplication(string name)
        {
            var         helper = new AppsHelper(proxyUser, credMgr);
            Application rv     = helper.GetApplication(name);

            rv.Parent = cloud; // TODO not thrilled about this
            return(rv);
        }
Exemple #10
0
        public Application GetApplication(string name)
        {
            checkLoginStatus();
            var         hlpr = new AppsHelper(credMgr);
            Application rv   = hlpr.GetApplication(name);

            rv.Parent = cloud; // TODO not thrilled about this
            return(rv);
        }
Exemple #11
0
        public VcapClientResult Push(
            string name, string deployFQDN, ushort instances,
            DirectoryInfo path, uint memoryMB, string[] provisionedServiceNames)
        {
            checkLoginStatus();
            var hlpr = new AppsHelper(credMgr);

            return(hlpr.Push(name, deployFQDN, instances, path, memoryMB,
                             provisionedServiceNames, "aspdotnet", "aspdotnet40"));
        }
Exemple #12
0
        public IEnumerable <Application> GetApplications()
        {
            checkLoginStatus();
            var hlpr = new AppsHelper(credMgr);
            IEnumerable <Application> apps = hlpr.GetApplications();

            foreach (var a in apps)
            {
                a.Parent = cloud;
            }                                             // TODO not thrilled about this
            return(apps);
        }
Exemple #13
0
        public IEnumerable <Application> GetApplications()
        {
            var helper = new AppsHelper(proxyUser, credMgr);
            IEnumerable <Application> apps = helper.GetApplications();

            foreach (var app in apps) // TODO not thrilled about this
            {
                app.Parent = cloud;
                app.User   = proxyUser;
            }
            return(apps);
        }
        public void UnbindService(string provisionedServiceName, string appName)
        {
            var    apps      = new AppsHelper(ProxyUser, CredentialManager);
            string appJson   = apps.GetApplicationJson(appName);
            var    appParsed = JObject.Parse(appJson);
            var    services  = (JArray)appParsed["services"];

            appParsed["services"] = new JArray(services.Where(s => ((string)s) != provisionedServiceName));

            var r = BuildVcapJsonRequest(Method.PUT, Constants.APPS_PATH, appName);

            r.AddBody(appParsed);
            r.Execute();

            apps = new AppsHelper(ProxyUser, CredentialManager);
            apps.Restart(appName);
        }
Exemple #15
0
        public VcapClientResult DeleteUser(string email)
        {
            var appsHelper = new AppsHelper(proxyUser, credMgr);
            foreach (Application a in appsHelper.GetApplications(email))
            {
                appsHelper.Delete(a.Name);
            }

            var servicesHelper = new ServicesHelper(proxyUser, credMgr);
            foreach (ProvisionedService ps in servicesHelper.GetProvisionedServices(email))
            {
                servicesHelper.DeleteService(ps.Name);
            }

            VcapJsonRequest r = base.BuildVcapJsonRequest(Method.DELETE, Constants.USERS_PATH, email);
            IRestResponse response = r.Execute();
            return new VcapClientResult();
        }
        public void BindService(string provisionedServiceName, string appName)
        {
            var apps = new AppsHelper(ProxyUser, CredentialManager);

            Application app = apps.GetApplication(appName);
            app.Services.Add(provisionedServiceName);

            var request = BuildVcapJsonRequest(Method.PUT, Constants.APPS_PATH, app.Name);
            request.AddBody(app);
            request.Execute();

            // Ruby code re-gets info
            app = apps.GetApplication(appName);
            if (app.IsStarted)
            {
                apps.Restart(app);
            }
        }
        public VcapClientResult BindService(string argProvisionedServiceName, string argAppName)
        {
            var apps = new AppsHelper(credMgr);

            Application app = apps.GetApplication(argAppName);
            app.Services.Add(argProvisionedServiceName);

            var request = new VcapJsonRequest(credMgr, Method.PUT, Constants.APPS_PATH, app.Name);
            request.AddBody(app);
            RestResponse response = request.Execute();

            // Ruby code re-gets info
            app = apps.GetApplication(argAppName);
            if (app.IsStarted)
            {
                apps.Restart(app);
            }
            return new VcapClientResult();
        }
        public VcapClientResult UnbindService(string argProvisionedServiceName, string argAppName)
        {
            var    apps      = new AppsHelper(credMgr);
            string appJson   = apps.GetApplicationJson(argAppName);
            var    appParsed = JObject.Parse(appJson);
            var    services  = (JArray)appParsed["services"];

            appParsed["services"] = new JArray(services.Where(s => ((string)s) != argProvisionedServiceName));

            var r = new VcapJsonRequest(credMgr, Method.PUT, Constants.APPS_PATH, argAppName);

            r.AddBody(appParsed);
            RestResponse response = r.Execute();

            apps = new AppsHelper(credMgr);
            apps.Restart(argAppName);

            return(new VcapClientResult());
        }
Exemple #19
0
        public void DeleteUser(string email)
        {
            // TODO: doing this causes a "not logged in" failure when the user
            // doesn't exist, which is kind of misleading.

            var appsHelper = new AppsHelper(proxyUser, credMgr);
            foreach (Application a in appsHelper.GetApplications(email))
            {
                appsHelper.Delete(a.Name);
            }

            var servicesHelper = new ServicesHelper(proxyUser, credMgr);
            foreach (ProvisionedService ps in servicesHelper.GetProvisionedServices())
            {
                servicesHelper.DeleteService(ps.Name);
            }

            VcapJsonRequest r = BuildVcapJsonRequest(Method.DELETE, Constants.USERS_PATH, email);
            r.Execute();
        }
        public void BindService(string provisionedServiceName, string appName)
        {
            var apps = new AppsHelper(ProxyUser, CredentialManager);

            Application app = apps.GetApplication(appName);

            app.Services.Add(provisionedServiceName);

            var request = BuildVcapJsonRequest(Method.PUT, Constants.APPS_PATH, app.Name);

            request.AddBody(app);
            request.Execute();

            // Ruby code re-gets info
            app = apps.GetApplication(appName);
            if (app.IsStarted)
            {
                apps.Restart(app);
            }
        }
Exemple #21
0
        public VcapClientResult DeleteUser(string email)
        {
            var appsHelper = new AppsHelper(credMgr);

            foreach (Application a in appsHelper.GetApplications(email))
            {
                appsHelper.Delete(a.Name);
            }

            var servicesHelper = new ServicesHelper(credMgr);

            foreach (ProvisionedService ps in servicesHelper.GetProvisionedServices(email))
            {
                servicesHelper.DeleteService(ps.Name);
            }

            var          r        = new VcapJsonRequest(credMgr, Method.DELETE, Constants.USERS_PATH, email);
            RestResponse response = r.Execute();

            return(new VcapClientResult());
        }
        public VcapClientResult BindService(string argProvisionedServiceName, string argAppName)
        {
            var apps = new AppsHelper(credMgr);

            Application app = apps.GetApplication(argAppName);

            app.Services.Add(argProvisionedServiceName);

            var request = new VcapJsonRequest(credMgr, Method.PUT, Constants.APPS_PATH, app.Name);

            request.AddBody(app);
            RestResponse response = request.Execute();

            // Ruby code re-gets info
            app = apps.GetApplication(argAppName);
            if (app.IsStarted)
            {
                apps.Restart(app);
            }
            return(new VcapClientResult());
        }
Exemple #23
0
        public void DeleteUser(string email)
        {
            // TODO: doing this causes a "not logged in" failure when the user
            // doesn't exist, which is kind of misleading.

            var appsHelper = new AppsHelper(proxyUser, credMgr);

            foreach (Application a in appsHelper.GetApplications(email))
            {
                appsHelper.Delete(a.Name);
            }

            var servicesHelper = new ServicesHelper(proxyUser, credMgr);

            foreach (ProvisionedService ps in servicesHelper.GetProvisionedServices())
            {
                servicesHelper.DeleteService(ps.Name);
            }

            VcapJsonRequest r = BuildVcapJsonRequest(Method.DELETE, Constants.USERS_PATH, email);

            r.Execute();
        }
Exemple #24
0
 public IEnumerable<Crash> GetAppCrash(Application app)
 {
     var helper = new AppsHelper(proxyUser, credMgr);
     return helper.GetAppCrash(app);
 }
Exemple #25
0
 public void Restart(Application app)
 {
     var helper = new AppsHelper(proxyUser, credMgr);
     helper.Restart(app);
 }
Exemple #26
0
 public void Stop(Application app)
 {
     checkLoginStatus();
     var hlpr = new AppsHelper(credMgr);
     hlpr.Stop(app);
 }
Exemple #27
0
 public IEnumerable<Application> GetApplications()
 {
     checkLoginStatus();
     var hlpr = new AppsHelper(credMgr);
     IEnumerable<Application> apps = hlpr.GetApplications();
     foreach (var a in apps) { a.Parent = cloud; } // TODO not thrilled about this
     return apps;
 }
Exemple #28
0
 public void Delete(string appName)
 {
     var helper = new AppsHelper(proxyUser, credMgr);
     helper.Delete(appName);
 }
Exemple #29
0
 public byte[] FilesSimple(string appName, string path, ushort instance)
 {
     var helper = new AppsHelper(proxyUser, credMgr);
     return helper.Files(appName, path, instance);
 }
Exemple #30
0
        public void UpdateApplication(Application app)
        {
            var helper = new AppsHelper(proxyUser, credMgr);

            helper.UpdateApplication(app);
        }
Exemple #31
0
        public VcapFilesResult Files(string appName, string path, ushort instance)
        {
            CheckLoginStatus();

            VcapFilesResult rv;

            var hlpr = new AppsHelper(proxyUser, credMgr);
            byte[] content = hlpr.Files(appName, path, instance);
            if (null == content)
            {
                rv = new VcapFilesResult(false);
            }
            else if (content.Length == 0)
            {
                rv = new VcapFilesResult(content);
            }
            else
            {
                int i = 0;
                for (i = 0; i < content.Length; ++i)
                {
                    if (content[i] == '\n')
                    {
                        break;
                    }
                }
                string firstLine = Encoding.ASCII.GetString(content, 0, i);
                if (file_re.IsMatch(firstLine) || dir_re.IsMatch(firstLine))
                {
                    // Probably looking at a listing, not a file
                    string contentAscii = Encoding.ASCII.GetString(content);
                    string[] contentAry = contentAscii.Split(new[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);
                    rv = new VcapFilesResult();
                    foreach (string item in contentAry)
                    {
                        Match fileMatch = file_re.Match(item);
                        if (null != fileMatch && fileMatch.Success)
                        {
                            string fileName = fileMatch.Groups[1].Value; // NB: 0 is the entire matched string
                            string fileSize = fileMatch.Groups[2].Value;
                            rv.AddFile(fileName, fileSize);
                            continue;
                        }

                        Match dirMatch = dir_re.Match(item);
                        if (null != dirMatch && dirMatch.Success)
                        {
                            string dirName = dirMatch.Groups[1].Value;
                            rv.AddDirectory(dirName);
                            continue;
                        }

                        throw new InvalidOperationException("Match failed.");
                    }
                }
                else
                {
                    rv = new VcapFilesResult(content);
                }
            }

            return rv;
        }
Exemple #32
0
 public VcapClientResult Update(string name, DirectoryInfo path)
 {
     CheckLoginStatus();
     var hlpr = new AppsHelper(proxyUser, credMgr);
     return hlpr.Update(name, path);
 }
Exemple #33
0
 public VcapClientResult Stop(string appName)
 {
     CheckLoginStatus();
     var hlpr = new AppsHelper(proxyUser, credMgr);
     return hlpr.Stop(appName);
 }
Exemple #34
0
 public void UpdateApplication(Application app)
 {
     var helper = new AppsHelper(proxyUser, credMgr);
     helper.UpdateApplication(app);
 }
Exemple #35
0
 public void Update(string name, DirectoryInfo path)
 {
     var helper = new AppsHelper(proxyUser, credMgr);
     helper.Update(name, path);
 }
Exemple #36
0
 public void Stop(Application app)
 {
     var helper = new AppsHelper(proxyUser, credMgr);
     helper.Stop(app);
 }
Exemple #37
0
 public void Stop(string appName)
 {
     var helper = new AppsHelper(proxyUser, credMgr);
     helper.Stop(appName);
 }
Exemple #38
0
        public byte[] FilesSimple(string appName, string path, ushort instance)
        {
            var helper = new AppsHelper(proxyUser, credMgr);

            return(helper.Files(appName, path, instance));
        }
Exemple #39
0
        public VcapFilesResult Files(string appName, string path, ushort instance)
        {
            VcapFilesResult rv;

            var helper = new AppsHelper(proxyUser, credMgr);

            byte[] content = helper.Files(appName, path, instance);
            if (null == content)
            {
                rv = new VcapFilesResult(false);
            }
            else if (content.Length == 0)
            {
                rv = new VcapFilesResult(content);
            }
            else
            {
                int i = 0;
                for (i = 0; i < content.Length; ++i)
                {
                    if (content[i] == '\n')
                    {
                        break;
                    }
                }
                string firstLine = Encoding.ASCII.GetString(content, 0, i);
                if (file_re.IsMatch(firstLine) || dir_re.IsMatch(firstLine))
                {
                    // Probably looking at a listing, not a file
                    string   contentAscii = Encoding.ASCII.GetString(content);
                    string[] contentAry   = contentAscii.Split(new[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);
                    rv = new VcapFilesResult();
                    foreach (string item in contentAry)
                    {
                        Match fileMatch = file_re.Match(item);
                        if (null != fileMatch && fileMatch.Success)
                        {
                            string fileName = fileMatch.Groups[1].Value; // NB: 0 is the entire matched string
                            string fileSize = fileMatch.Groups[2].Value;
                            rv.AddFile(fileName, fileSize);
                            continue;
                        }

                        Match dirMatch = dir_re.Match(item);
                        if (null != dirMatch && dirMatch.Success)
                        {
                            string dirName = dirMatch.Groups[1].Value;
                            rv.AddDirectory(dirName);
                            continue;
                        }

                        throw new InvalidOperationException("Match failed.");
                    }
                }
                else
                {
                    rv = new VcapFilesResult(content);
                }
            }

            return(rv);
        }
Exemple #40
0
 public IEnumerable<Crash> GetAppCrash(Application app)
 {
     CheckLoginStatus();
     var hlpr = new AppsHelper(proxyUser, credMgr);
     return hlpr.GetAppCrash(app);
 }
Exemple #41
0
        public IEnumerable <Crash> GetAppCrash(Application app)
        {
            var helper = new AppsHelper(proxyUser, credMgr);

            return(helper.GetAppCrash(app));
        }
Exemple #42
0
 public IEnumerable<Application> GetApplications()
 {
     CheckLoginStatus();
     var hlpr = new AppsHelper(proxyUser, credMgr);
     IEnumerable<Application> apps = hlpr.GetApplications();
     foreach (var app in apps) // TODO not thrilled about this
     {
         app.Parent = cloud;
         app.User = proxyUser;
     }
     return apps;
 }
Exemple #43
0
 public void Delete(Application app)
 {
     var helper = new AppsHelper(proxyUser, credMgr);
     helper.Delete(app);
 }
Exemple #44
0
 public void Push(string name, string deployFQDN, ushort instances,
     DirectoryInfo path, uint memoryMB, string[] provisionedServiceNames)
 {
     var helper = new AppsHelper(proxyUser, credMgr);
     helper.Push(name, deployFQDN, instances, path, memoryMB, provisionedServiceNames);
 }
Exemple #45
0
        public void Delete(string appName)
        {
            var helper = new AppsHelper(proxyUser, credMgr);

            helper.Delete(appName);
        }
Exemple #46
0
        public void Delete(Application app)
        {
            var helper = new AppsHelper(proxyUser, credMgr);

            helper.Delete(app);
        }
Exemple #47
0
 public void Restart(Application app)
 {
     checkLoginStatus();
     var hlpr = new AppsHelper(credMgr);
     hlpr.Restart(app);
 }
Exemple #48
0
 public Application GetApplication(string name)
 {
     var helper = new AppsHelper(proxyUser, credMgr);
     Application rv =  helper.GetApplication(name);
     rv.Parent = cloud; // TODO not thrilled about this
     return rv;
 }
Exemple #49
0
 public void Delete(string name)
 {
     checkLoginStatus();
     var hlpr = new AppsHelper(credMgr);
     hlpr.Delete(name);
 }
Exemple #50
0
 public void Restart(string appName)
 {
     var helper = new AppsHelper(proxyUser, credMgr);
     helper.Restart(appName);
 }
Exemple #51
0
 public byte[] FilesSimple(string appName, string path, ushort instance)
 {
     CheckLoginStatus();
     var hlpr = new AppsHelper(proxyUser, credMgr);
     return hlpr.Files(appName, path, instance);
 }
Exemple #52
0
        public void Stop(Application app)
        {
            var helper = new AppsHelper(proxyUser, credMgr);

            helper.Stop(app);
        }
Exemple #53
0
 public Application GetApplication(string name)
 {
     CheckLoginStatus();
     var hlpr = new AppsHelper(proxyUser, credMgr);
     Application rv =  hlpr.GetApplication(name);
     rv.Parent = cloud; // TODO not thrilled about this
     return rv;
 }
Exemple #54
0
        public void Restart(string appName)
        {
            var helper = new AppsHelper(proxyUser, credMgr);

            helper.Restart(appName);
        }
Exemple #55
0
 public VcapClientResult Push(
     string name, string deployFQDN, ushort instances,
     DirectoryInfo path, uint memoryMB, string[] provisionedServiceNames)
 {
     CheckLoginStatus();
     var hlpr = new AppsHelper(proxyUser, credMgr);
     return hlpr.Push(name, deployFQDN, instances, path, memoryMB, provisionedServiceNames);
 }
Exemple #56
0
        public void Restart(Application app)
        {
            var helper = new AppsHelper(proxyUser, credMgr);

            helper.Restart(app);
        }
Exemple #57
0
 public VcapClientResult Stop(Application app)
 {
     CheckLoginStatus();
     var hlpr = new AppsHelper(proxyUser, credMgr);
     return hlpr.Stop(app);
 }
Exemple #58
0
        public void Update(string name, DirectoryInfo path)
        {
            var helper = new AppsHelper(proxyUser, credMgr);

            helper.Update(name, path);
        }
Exemple #59
0
 public VcapResponse UpdateApplication(Application app)
 {
     CheckLoginStatus();
     var hlpr = new AppsHelper(proxyUser, credMgr);
     return hlpr.UpdateApplication(app);
 }
Exemple #60
0
        public void Stop(string appName)
        {
            var helper = new AppsHelper(proxyUser, credMgr);

            helper.Stop(appName);
        }