ucscsdk/ucschandle.py
def process_xml_elem(self, elem, dme="central-mgr"):
        """
        process_xml_elem is a helper method which posts xml elements to the
        server and returns parsed response. It's role is to operate on the
        output of methods from ucscmethodfactory, which return xml
        element node(s).

        Args:
            elem (xml element object)
            dme: DME to post the query to

        Returns:
            mo list or external method object

        Example:
            elem = ucscmethodfactory.config_find_dns_by_class_id(
                   cookie=handle.cookie, class_id="LsServer", in_filter=None)\n
            dn_objs = handle.process_xml_elem(elem)
        """

        response = self.post_elem(elem, dme=dme)
        if response.error_code != 0:
            raise UcscException(response.error_code,
                                response.error_descr)

        if hasattr(response, "out_config"):
            return response.out_config.child
        elif hasattr(response, "out_configs"):
            mo_list = []
            pair_flag = False
            for ch_ in response.out_configs.child:
                if pair_flag or ch_.get_class_id() != "Pair":
                    mo_list.append(ch_)
                elif ch_.get_class_id() == "Pair":
                    mo_list.extend(ch_.child)
                    pair_flag = True
            return mo_list
        elif hasattr(response, "out_dns"):
            return response.out_dns.child
        else:
            return response

        process_xml_elem is a helper method which posts xml elements to the
        server and returns parsed response. It's role is to operate on the
        output of methods from ucscmethodfactory, which return xml
        element node(s).

        Args:
            elem (xml element object)
            dme: DME to post the query to

        Returns:
            mo list or external method object

        Example:
            elem = ucscmethodfactory.config_find_dns_by_class_id(
                   cookie=handle.cookie, class_id="LsServer", in_filter=None)\n
            dn_objs = handle.process_xml_elem(elem)
        
process_xml_elem is a helper method which posts xml elements to the
server and returns parsed response. It's role is to operate on the
output of methods from ucscmethodfactory, which return xml
element node(s).

elem (xml element object)
dme: DME to post the query to

mo list or external method object


process_xml_elem is a helper method which posts xml elements to the server and returns parsed response . It ' s role is to operate on the output of methods from ucscmethodfactory which return xml element node ( s ) . elem ( xml element object ) dme : DME to post the query to mo list or external method object
def process_xml_elem(self, elem, dme="central-mgr"):
        response = self.post_elem(elem, dme=dme)
        if response.error_code != 0:
            raise UcscException(response.error_code,
                                response.error_descr)
        if hasattr(response, "out_config"):
            return response.out_config.child
        elif hasattr(response, "out_configs"):
            mo_list = []
            pair_flag = False
            for ch_ in response.out_configs.child:
                if pair_flag or ch_.get_class_id() != "Pair":
                    mo_list.append(ch_)
                elif ch_.get_class_id() == "Pair":
                    mo_list.extend(ch_.child)
                    pair_flag = True
            return mo_list
        elif hasattr(response, "out_dns"):
            return response.out_dns.child
        else:
            return response
def process_xml_elem ( self , elem , dme = "central-mgr" ) : response = self . post_elem ( elem , dme = dme ) if response . error_code != 0 : raise UcscException ( response . error_code , response . error_descr ) if hasattr ( response , "out_config" ) : return response . out_config . child elif hasattr ( response , "out_configs" ) : mo_list = [ ] pair_flag = False for ch_ in response . out_configs . child : if pair_flag or ch_ . get_class_id ( ) != "Pair" : mo_list . append ( ch_ ) elif ch_ . get_class_id ( ) == "Pair" : mo_list . extend ( ch_ . child ) pair_flag = True return mo_list elif hasattr ( response , "out_dns" ) : return response . out_dns . child else : return response
process_xml_elem is a helper method which posts xml elements to the
server and returns parsed response.
process_xml_elem is a helper method which posts xml elements to the server and returns parsed response .
"""
        process_xml_elem is a helper method which posts xml elements to the
        server and returns parsed response. It's role is to operate on the
        output of methods from ucscmethodfactory, which return xml
        element node(s).

        Args:
            elem (xml element object)
            dme: DME to post the query to

        Returns:
            mo list or external method object

        Example:
            elem = ucscmethodfactory.config_find_dns_by_class_id(
                   cookie=handle.cookie, class_id="LsServer", in_filter=None)\n
            dn_objs = handle.process_xml_elem(elem)
        """
self
elem
dme