Esempio n. 1
0
        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.AppsResource, appName);

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

            apps = new AppsHelper(ProxyUser, CredentialManager);
            apps.Restart(appName);
        }
Esempio n. 2
0
        public void BindService(string provisionedServiceName, string appName)
        {
            var apps = new AppsHelper(ProxyUser, CredentialManager);

            Application app = apps.GetApplication(appName);
            app.AddService(provisionedServiceName);

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

            // Ruby code re-gets info
            app = apps.GetApplication(appName);
            if (app.IsStarted)
            {
                apps.Restart(app);
            }
        }
Esempio n. 3
0
        public void BindService(string provisionedServiceName, string appName)
        {
            var apps = new AppsHelper(ProxyUser, CredentialManager);

            Application app = apps.GetApplication(appName);

            app.AddService(provisionedServiceName);

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

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

            // Ruby code re-gets info
            app = apps.GetApplication(appName);
            if (app.IsStarted)
            {
                apps.Restart(app);
            }
        }
Esempio n. 4
0
 public void Restart(Application app)
 {
     var helper = new AppsHelper(_proxyUser, _credMgr);
     helper.Restart(app);
 }
Esempio n. 5
0
 public void Restart(string appName)
 {
     var helper = new AppsHelper(_proxyUser, _credMgr);
     helper.Restart(appName);
 }
Esempio n. 6
0
        public void Restart(Application app)
        {
            var helper = new AppsHelper(proxyUser, credMgr);

            helper.Restart(app);
        }
Esempio n. 7
0
        public void Restart(string appName)
        {
            var helper = new AppsHelper(proxyUser, credMgr);

            helper.Restart(appName);
        }
Esempio n. 8
0
        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.AppsResource, appName);
            r.AddBody(appParsed);
            r.Execute();

            apps = new AppsHelper(ProxyUser, CredentialManager);
            apps.Restart(appName);
        }