Package com.cloud.utils.xmlobject

Examples of com.cloud.utils.xmlobject.XmlObject


    String operPower;
    String totalMemory;
    String uuid;

    public static List<ComputeBlade> fromXmString(String xmlstr) {
        XmlObject root = XmlObjectParser.parseFromString(xmlstr);
        List<XmlObject> lst = root.getAsList("outConfigs.computeBlade");
        List<ComputeBlade> blades = new ArrayList<ComputeBlade>();
        if (lst == null) {
            return blades;
        }
        for (XmlObject xo : lst) {
View Full Code Here


                    cmd = UcsCommands.refreshCmd(mgrvo.getUsername(), mgrvo.getPassword(), cookie);
                }
            }
            if(!(cmd == null)) {
                String ret = client.call(cmd);
                XmlObject xo = XmlObjectParser.parseFromString(ret);
                String cookie = xo.get("outCookie");
                ucsCookie = new UcsCookie(cookie, currentTime);
                cookies.put(ucsMgrId, ucsCookie);
                //cookiesTime.put(cookie, currentTime); //This is currentTime on purpose, and not latest time.
            }
            return ucsCookie.getCookie();
View Full Code Here

        UcsManagerVO mgrvo = ucsDao.findById(ucsMgrId);
        UcsHttpClient client = new UcsHttpClient(mgrvo.getUrl());
        String cookie = getCookie(ucsMgrId);
        String cmd = UcsCommands.cloneProfile(cookie, srcDn, newProfileName);
        String res = client.call(cmd);
        XmlObject xo = XmlObjectParser.parseFromString(res);
        return xo.get("outConfig.lsServer.dn");
    }
View Full Code Here

        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");
    }
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

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.