ucscsdk/ucscxmlcodec.py
def from_xml_str(xml_str, handle=None):
    """
    Generates response object from the given xml string.

    Args:
        xml_str (str): xml string

    Returns:
        object (external method or managed object or generic managed object)

    Example:
        xml_str='''\n
        <lsServer dn="org-root/ls-testsp" dynamicConPolicyName="test"\n
        extIPPoolName="ext-mgmt" name="testsp" />\n
        '''\n
        root_element = extract_root_elem(xml_str)\n
    """

    root_elem = ET.fromstring(xml_str)
    if root_elem.tag == "error":
        error_code = root_elem.attrib['errorCode']
        error_descr = root_elem.attrib['errorDescr']
        raise ex.UcscException(error_code, error_descr)

    class_id = ucscgenutils.word_u(root_elem.tag)
    response = ucsccoreutils.get_ucsc_obj(class_id, root_elem)
    response.from_xml(root_elem, handle)
    return response

    Generates response object from the given xml string.

    Args:
        xml_str (str): xml string

    Returns:
        object (external method or managed object or generic managed object)

    Example:
        xml_str='''\n
        <lsServer dn="org-root/ls-testsp" dynamicConPolicyName="test"\n
        extIPPoolName="ext-mgmt" name="testsp" />\n
        '''\n
        root_element = extract_root_elem(xml_str)\n
    
Generates response object from the given xml string.
Generates response object from the given xml string .
def from_xml_str(xml_str, handle=None):
    root_elem = ET.fromstring(xml_str)
    if root_elem.tag == "error":
        error_code = root_elem.attrib['errorCode']
        error_descr = root_elem.attrib['errorDescr']
        raise ex.UcscException(error_code, error_descr)
    class_id = ucscgenutils.word_u(root_elem.tag)
    response = ucsccoreutils.get_ucsc_obj(class_id, root_elem)
    response.from_xml(root_elem, handle)
    return response
def from_xml_str ( xml_str , handle = None ) : root_elem = ET . fromstring ( xml_str ) if root_elem . tag == "error" : error_code = root_elem . attrib [ 'errorCode' ] error_descr = root_elem . attrib [ 'errorDescr' ] raise ex . UcscException ( error_code , error_descr ) class_id = ucscgenutils . word_u ( root_elem . tag ) response = ucsccoreutils . get_ucsc_obj ( class_id , root_elem ) response . from_xml ( root_elem , handle ) return response
Generates response object from the given xml string.
Generates response object from the given xml string .
"""
    Generates response object from the given xml string.

    Args:
        xml_str (str): xml string

    Returns:
        object (external method or managed object or generic managed object)

    Example:
        xml_str='''\n
        <lsServer dn="org-root/ls-testsp" dynamicConPolicyName="test"\n
        extIPPoolName="ext-mgmt" name="testsp" />\n
        '''\n
        root_element = extract_root_elem(xml_str)\n
    """
object (external method or managed object or generic managed object)
object ( external method or managed object or generic managed object )
xml_str
None
handle
examples
None