Beispiel #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);
        }
Beispiel #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);
            }
        }
Beispiel #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);
            }
        }
 public void Restart(Application app)
 {
     var helper = new AppsHelper(_proxyUser, _credMgr);
     helper.Restart(app);
 }
 public void Restart(string appName)
 {
     var helper = new AppsHelper(_proxyUser, _credMgr);
     helper.Restart(appName);
 }
Beispiel #6
0
        public void Restart(Application app)
        {
            var helper = new AppsHelper(proxyUser, credMgr);

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

            helper.Restart(appName);
        }
Beispiel #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);
        }