Package com.cloud.utils.xmlobject

Examples of com.cloud.utils.xmlobject.XmlObject


        UcsManagerVO mgrvo = ucsDao.findById(ucsMgrId);
        UcsHttpClient client = new UcsHttpClient(mgrvo.getUrl());
        String cookie = getCookie(ucsMgrId);
        String cmd = UcsCommands.configResolveDn(cookie, dn);
        String res = client.call(cmd);
        XmlObject xo = XmlObjectParser.parseFromString(res);
        s_logger.debug(String.format("association response is %s", res));
       
        if (xo.get("outConfig.computeBlade.association").equals("none")) {
            throw new CloudRuntimeException(String.format("cannot associated a profile to blade[dn:%s]. please check your UCS manasger for detailed error information", dn));
        }

        return xo.get("outConfig.computeBlade.association").equals("associated");
        //return !xo.get("outConfig.computeBlade.assignedToDn").equals("");
    }
View Full Code Here


        UcsManagerVO mgrvo = ucsDao.findById(cmd.getUcsManagerId());
        String cookie = getCookie(cmd.getUcsManagerId());
        String instantiateTemplateCmd = UcsCommands.instantiateTemplate(cookie, cmd.getTemplateDn(), profileName);
        UcsHttpClient http = new UcsHttpClient(mgrvo.getUrl());
        String res = http.call(instantiateTemplateCmd);
        XmlObject xo = XmlObjectParser.parseFromString(res);
        String profileDn = xo.get("outConfig.lsServer.dn");
        String ucscmd = UcsCommands.associateProfileToBlade(cookie, profileDn, bvo.getDn());
        res = http.call(ucscmd);
        int count = 0;
        int timeout = 3600;
        while (count < timeout) {
View Full Code Here

import com.cloud.utils.xmlobject.XmlObject;

public class UcsCommands {
    public static String loginCmd(String username, String password) {
        XmlObject cmd = new XmlObject("aaaLogin");
        cmd.putElement("inName", username);
        cmd.putElement("inPassword", password);
        return cmd.dump();
    }
View Full Code Here

        cmd.putElement("inPassword", password);
        return cmd.dump();
    }

    public static String refreshCmd(String username, String password, String cookie) {
        XmlObject cmd = new XmlObject("aaaRefresh");
        cmd.putElement("inName", username);
        cmd.putElement("inPassword", password);
        cmd.putElement("inCookie", cookie);
        return cmd.dump();
    }
View Full Code Here

        cmd.putElement("inCookie", cookie);
        return cmd.dump();
    }

    public static String listComputeBlades(String cookie) {
        XmlObject cmd = new XmlObject("configResolveClass");
        cmd.putElement("classId", "computeBlade");
        cmd.putElement("cookie", cookie);
        cmd.putElement("inHierarchical", "false");
        return cmd.dump();
    }
View Full Code Here

        cmd.putElement("inHierarchical", "false");
        return cmd.dump();
    }

    public static String listProfiles(String cookie) {
        XmlObject cmd = new XmlObject("configFindDnsByClassId");
        cmd.putElement("classId", "lsServer");
        cmd.putElement("cookie", cookie);
        return cmd.dump();
    }
View Full Code Here

        cmd.putElement("cookie", cookie);
        return cmd.dump();
    }

    public static String cloneProfile(String cookie, String srcDn, String newProfileName) {
        XmlObject cmd = new XmlObject("lsClone");
        cmd.putElement("cookie", cookie);
        cmd.putElement("dn", srcDn);
        cmd.putElement("inTargetOrg", "org-root");
        cmd.putElement("inServerName", newProfileName);
        cmd.putElement("inHierarchical", "false");
        return cmd.dump();
    }
View Full Code Here

        cmd.putElement("inHierarchical", "false");
        return cmd.dump();
    }

    public static String configResolveDn(String cookie, String dn) {
        XmlObject cmd = new XmlObject("configResolveDn");
        cmd.putElement("cookie", cookie);
        cmd.putElement("dn", dn);
        return cmd.toString();
    }
View Full Code Here

        cmd.putElement("dn", dn);
        return cmd.toString();
    }

    public static String associateProfileToBlade(String cookie, String profileDn, String bladeDn) {
        XmlObject cmd =
            new XmlObject("configConfMos").putElement("cookie", cookie)
                .putElement("inHierarchical", "true")
                .putElement(
                    "inConfigs",
                    new XmlObject("inConfigs").putElement(
                        "pair",
                        new XmlObject("pair").putElement("key", profileDn).putElement(
                            "lsServer",
                            new XmlObject("lsServer").putElement("agentPolicyName", "")
                                .putElement("biosProfileName", "")
                                .putElement("bootPolicyName", "")
                                .putElement("descr", "")
                                .putElement("dn", profileDn)
                                .putElement("dynamicConPolicyName", "")
                                .putElement("extIPState", "none")
                                .putElement("hostFwPolicyName", "")
                                .putElement("identPoolName", "")
                                .putElement("localDiskPolicyName", "")
                                .putElement("maintPolicyName", "")
                                .putElement("mgmtAccessPolicyName", "")
                                .putElement("mgmtFwPolicyName", "")
                                .putElement("powerPolicyName", "")
                                .putElement("scrubPolicyName", "")
                                .putElement("solPolicyName", "")
                                .putElement("srcTemplName", "")
                                .putElement("statsPolicyName", "default")
                                .putElement("status", "")
                                .putElement("usrLbl", "")
                                .putElement("uuid", "")
                                .putElement("vconProfileName", "")
                                .putElement("lsBinding",
                                    new XmlObject("lsBinding").putElement("pnDn", bladeDn).putElement("restrictMigration", "no").putElement("rn", "pn")))));

        return cmd.dump();
    }
View Full Code Here

import com.cloud.utils.xmlobject.XmlObject;

public class UcsCommands {
    public static String loginCmd(String username, String password) {
        XmlObject cmd = new XmlObject("aaaLogin");
        cmd.putElement("inName", username);
        cmd.putElement("inPassword", password);
        return cmd.dump();
    }
View Full Code Here

TOP

Related Classes of com.cloud.utils.xmlobject.XmlObject

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.