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)); }
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); }
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); }
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); }
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")); }
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); }
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); }
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()); }
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 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()); }
public IEnumerable<Crash> GetAppCrash(Application app) { var helper = new AppsHelper(proxyUser, credMgr); return helper.GetAppCrash(app); }
public void Restart(Application app) { var helper = new AppsHelper(proxyUser, credMgr); helper.Restart(app); }
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; }
public void Delete(string appName) { var helper = new AppsHelper(proxyUser, credMgr); helper.Delete(appName); }
public byte[] FilesSimple(string appName, string path, ushort instance) { var helper = new AppsHelper(proxyUser, credMgr); return helper.Files(appName, path, instance); }
public void UpdateApplication(Application app) { var helper = new AppsHelper(proxyUser, credMgr); helper.UpdateApplication(app); }
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; }
public VcapClientResult Update(string name, DirectoryInfo path) { CheckLoginStatus(); var hlpr = new AppsHelper(proxyUser, credMgr); return hlpr.Update(name, path); }
public VcapClientResult Stop(string appName) { CheckLoginStatus(); var hlpr = new AppsHelper(proxyUser, credMgr); return hlpr.Stop(appName); }
public void Update(string name, DirectoryInfo path) { var helper = new AppsHelper(proxyUser, credMgr); helper.Update(name, path); }
public void Stop(Application app) { var helper = new AppsHelper(proxyUser, credMgr); helper.Stop(app); }
public void Stop(string appName) { var helper = new AppsHelper(proxyUser, credMgr); helper.Stop(appName); }
public byte[] FilesSimple(string appName, string path, ushort instance) { var helper = new AppsHelper(proxyUser, credMgr); return(helper.Files(appName, path, instance)); }
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); }
public IEnumerable<Crash> GetAppCrash(Application app) { CheckLoginStatus(); var hlpr = new AppsHelper(proxyUser, credMgr); return hlpr.GetAppCrash(app); }
public IEnumerable <Crash> GetAppCrash(Application app) { var helper = new AppsHelper(proxyUser, credMgr); return(helper.GetAppCrash(app)); }
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; }
public void Delete(Application app) { var helper = new AppsHelper(proxyUser, credMgr); helper.Delete(app); }
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; }
public void Restart(string appName) { var helper = new AppsHelper(proxyUser, credMgr); helper.Restart(appName); }
public byte[] FilesSimple(string appName, string path, ushort instance) { CheckLoginStatus(); var hlpr = new AppsHelper(proxyUser, credMgr); return hlpr.Files(appName, path, instance); }
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; }
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); }
public VcapClientResult Stop(Application app) { CheckLoginStatus(); var hlpr = new AppsHelper(proxyUser, credMgr); return hlpr.Stop(app); }
public VcapResponse UpdateApplication(Application app) { CheckLoginStatus(); var hlpr = new AppsHelper(proxyUser, credMgr); return hlpr.UpdateApplication(app); }