Package com.cloudbees.api

Examples of com.cloudbees.api.ApplicationInfo


        if (type != null) {
            parameters.put("app_type", type);
        }

        ApplicationCreateResponse res = client.applicationCreate(getAppId(), parameters, appParameters, appVariables);
        ApplicationInfo applicationInfo = res.getApplicationInfo();
        System.out.println( "Application     : " + applicationInfo.getId());
        System.out.println( "Title           : " + applicationInfo.getTitle());
        System.out.println( "Created         : " + applicationInfo.getCreated());
        System.out.println( "Status          : " + applicationInfo.getStatus());
        System.out.println( "URL             : " + applicationInfo.getUrls()[0]);
        Map<String, String> settings = applicationInfo.getSettings();
        if (settings != null) {
            List<String> list = new ArrayList<String>(settings.size());
            for (Map.Entry<String, String> entry: settings.entrySet()) {
                list.add(Helper.getPaddedString(entry.getKey(), 16) + ": " + entry.getValue());
            }
View Full Code Here


                String param = parameterMap.get("blue-green");
                if (param != null) {
                    ApplicationAlias bgApp = new ApplicationAlias(getAccount(), param);

                    // Get the current alias if any
                    ApplicationInfo applicationInfo = client.applicationInfo(appId);
                    String aliases = applicationInfo.getSettings().get("aliases");
                    ApplicationAlias currentApp = new ApplicationAlias(getAccount(), appId, aliases);

                    // If the current app has the alias already, set the other app alias
                    if (currentApp.containAliases(bgApp.getAliases())) {
                        addApplicationAlias(applicationAliasList, bgApp);

                        // Check to see if the other app has aliases
                        ApplicationInfo applicationInfo2 = client.applicationInfo(bgApp.getAppId());
                        String aliases2 = applicationInfo2.getSettings().get("aliases");
                        // If it has aliases, let swap them to the current app
                        if (aliases2 != null) {
                            addApplicationAlias(applicationAliasList, currentApp.getAppId(), aliases2);
                        }
                    // If the current app does not have the alias, set them
View Full Code Here

                if (param != null) {
                    ApplicationAlias bgApp = new ApplicationAlias(getAccount(), param);

                    // Get the current alias if any
                    ApplicationInfo applicationInfo = client.applicationInfo(appId);
                    String aliases = applicationInfo.getSettings().get("aliases");
                    ApplicationAlias currentApp = new ApplicationAlias(getAccount(), appId, aliases);

                    // If the current app has the alias already, deploy to the other app
                    if (currentApp.containAliases(bgApp.getAliases())) {
                        appId = bgApp.getAppId();
View Full Code Here

        try {
            List<ApplicationAlias> applicationAliasList = new ArrayList<ApplicationAlias>();
            BlueGreenSettings blueGreenSettings = BlueGreenSettings.getInstance(client, getAccount(), name);

            // Get the app1 aliases
            ApplicationInfo applicationInfo = client.applicationInfo(blueGreenSettings.getApplication1());
            String aliases = applicationInfo.getSettings().get("aliases");
            ApplicationAlias application1 = new ApplicationAlias(getAccount(), blueGreenSettings.getApplication1(), aliases);

            // Get the app2 aliases
            ApplicationInfo applicationInfo2 = client.applicationInfo(blueGreenSettings.getApplication2());
            String aliases2 = applicationInfo2.getSettings().get("aliases");
            ApplicationAlias application2 = new ApplicationAlias(getAccount(), blueGreenSettings.getApplication2(), aliases2);

            if (primaryOnly) {
                // If the app1 has the active aliases already
                if (application1.containAliases(blueGreenSettings.getActiveAliases())) {
View Full Code Here

        try {
            String passiveAppId;
            BlueGreenSettings blueGreenSettings = BlueGreenSettings.getInstance(client, getAccount(), name);

            // Get the app1 alias
            ApplicationInfo applicationInfo = client.applicationInfo(blueGreenSettings.getApplication1());
            String aliases = applicationInfo.getSettings().get("aliases");
            ApplicationAlias application1 = new ApplicationAlias(getAccount(), blueGreenSettings.getApplication1(), aliases);

            // If the app1 has the alias already, stop the other app
            if (application1.containAliases(blueGreenSettings.getActiveAliases())) {
                passiveAppId = blueGreenSettings.getApplication2();
View Full Code Here

        try {
            List<ApplicationAlias> applicationAliasList = new ArrayList<ApplicationAlias>();
            BlueGreenSettings blueGreenSettings = BlueGreenSettings.getInstance(client, getAccount(), name);

            // Get the app1 alias if any
            ApplicationInfo applicationInfo = client.applicationInfo(blueGreenSettings.getApplication1());
            String aliases = applicationInfo.getSettings().get("aliases");
            ApplicationAlias application1 = new ApplicationAlias(getAccount(), blueGreenSettings.getApplication1(), aliases);

            // If the app1 has the alias already, set the other app alias
            if (application1.containAliases(blueGreenSettings.getActiveAliases())) {
                addApplicationAlias(applicationAliasList, blueGreenSettings.getApplication2(), blueGreenSettings.getActiveAliases());

                // Check to see if the other app has aliases
                ApplicationInfo applicationInfo2 = client.applicationInfo(blueGreenSettings.getApplication2());
                String aliases2 = applicationInfo2.getSettings().get("aliases");
                // If it has aliases, let swap them to the app1
                if (aliases2 != null) {
                    addApplicationAlias(applicationAliasList, application1.getAppId(), aliases2);
                }
            // If the app1 does not have the alias, set them
View Full Code Here

            String appId = null;
            BeesClient client = getBeesClient(BeesClient.class);
            BlueGreenSettings blueGreenSettings = BlueGreenSettings.getInstance(client, getAccount(), getName());

            // Get the app1 alias
            ApplicationInfo applicationInfo = client.applicationInfo(blueGreenSettings.getApplication1());
            String aliases = applicationInfo.getSettings().get("aliases");
            ApplicationAlias application1 = new ApplicationAlias(getAccount(), blueGreenSettings.getApplication1(), aliases);

            // If the app1 has the alias already, deploy to the other app
            if (application1.containAliases(blueGreenSettings.getActiveAliases())) {
                appId = blueGreenSettings.getApplication2();
View Full Code Here

            System.out.println("Blue-Green settings for: " + getName());
            System.out.println("  Primary Aliases: " + blueGreenSettings.getActiveAliasesString());
            System.out.println("  Application 1  : " + blueGreenSettings.getApplication1());
            System.out.println("  Application 2  : " + blueGreenSettings.getApplication2());
            // Get the app1 alias
            ApplicationInfo applicationInfo = client.applicationInfo(blueGreenSettings.getApplication1());
            String aliases = applicationInfo.getSettings().get("aliases");
            ApplicationAlias application1 = new ApplicationAlias(getAccount(), blueGreenSettings.getApplication1(), aliases);

            // If the app1 has the alias already, it is the active one
            if (application1.containAliases(blueGreenSettings.getActiveAliases())) {
                applicationIds.add(blueGreenSettings.getApplication1());
View Full Code Here

            String totalSizeStr = serverInfo.getParameters().get("memoryUsage");
            if (details || totalSizeStr == null) {
                for (String appId : serverInfo.getApplicationIDs()) {
                    try {
                        ApplicationInfo res = getApplicationInfo(serverPoolInfo, appId, client);
                        apps.add(res);
                        totalSize += getApplicationSize(res);
                        totalAppCells += getApplicationAppCell(res);
                    } catch (Exception e) {
                        System.err.println("WARNING: Cannot get application information: " + appId + " >" + e.getMessage());
View Full Code Here

            String appId = null;
            BeesClient client = getBeesClient(BeesClient.class);
            BlueGreenSettings blueGreenSettings = BlueGreenSettings.getInstance(client, getAccount(), getName());

            // Get the app1 alias
            ApplicationInfo applicationInfo = client.applicationInfo(blueGreenSettings.getApplication1());
            String aliases = applicationInfo.getSettings().get("aliases");
            ApplicationAlias application1 = new ApplicationAlias(getAccount(), blueGreenSettings.getApplication1(), aliases);

            // If the app1 has the alias already, deploy to the other app
            if (application1.containAliases(blueGreenSettings.getActiveAliases())) {
                appId = blueGreenSettings.getApplication2();
View Full Code Here

TOP

Related Classes of com.cloudbees.api.ApplicationInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.