ucscsdk/ucschandle.py
def query_children(self, in_mo=None, in_dn=None, class_id=None,
                       filter_str=None, hierarchy=False, dme="central-mgr"):
        """
        Finds children of a given managed object or distinguished name.
        Arguments can be specified to query only a specific type(class_id)
        of children.
        Arguments can also be specified to query only direct children or the
        entire hierarchy of children.

        Args:
            in_mo (managed object): query children managed object under this
                                        object.
            in_dn (dn string): query children managed object for a
                                given managed object of the respective dn.
            class_id(str): by default None, if given find only specific
                            children object for a given class_id.
            filter_str(str): query objects with specific property with specific
                            value or pattern specifying value.

                      (property_name, "property_value, type="filter_type")\n
                      property_name: Name of the Property\n
                      property_value: Value of the property (str or regular
                                      expression)\n
                      filter_type: eq - equal to\n
                                   ne - not equal to\n
                                   ge - greater than or equal to\n
                                   gt - greater than\n
                                   le - less than or equal to\n
                                   lt - less than\n
                                   re - regular expression\n

                      logical filter type: not, and, or\n

                      e.g. '(dn,"org-root/ls-C1_B1", type="eq") or (name,
                                            "event", type="re", flag="I")'\n
            hierarchy(bool): if set to True will return all the child
                             hierarchical objects.
            need_response(bool): if set to True will return only response
                                object.
            hierarchy(bool): if set to True will return all the child
                              hierarchical objects.
            dme: DME to post the query to

        Returns:
            managedobjectlist or None   by default\n
            managedobjectlist or None   if hierarchy=True\n

        Example:
            mo_list = handle.query_children(in_mo=mo)\n
            mo_list = handle.query_children(in_mo=mo, class_id="classid")\n
            mo_list = handle.query_children(in_dn=dn)\n
            mo_list = handle.query_children(in_dn=dn, class_id="classid")\n
            mo_list = handle.query_children(in_dn="org-root",
                        class_id="LsServer", filter_str="(usr_lbl, 'test')")
            mo_list = handle.query_children(in_dn="org-root",
                class_id="LsServer", filter_str="(usr_lbl, 'test', type='eq')")
        """

        from .ucscfilter import generate_infilter
        from .ucscmethodfactory import config_resolve_children

        if not in_mo and not in_dn:
            raise ValueError('[Error]: GetChild: Provide in_mo or in_dn.')

        parent_dn = None
        if in_mo:
            parent_dn = in_mo.dn
        elif in_dn:
            parent_dn = in_dn

        in_filter = None

        if class_id:
            meta_class_id = \
                ucsccoreutils.find_class_id_in_mo_meta_ignore_case(
                    class_id)
            if meta_class_id:
                is_meta_class_id = True
            else:
                meta_class_id = class_id
                is_meta_class_id = False

            if filter_str:
                in_filter = generate_infilter(meta_class_id, filter_str,
                                              is_meta_class_id)
        else:
            meta_class_id = class_id

        elem = config_resolve_children(cookie=self.cookie,
                                       class_id=meta_class_id,
                                       in_dn=parent_dn,
                                       in_filter=in_filter,
                                       in_hierarchical=hierarchy)
        response = self.post_elem(elem, dme=dme)
        if response.error_code != 0:
            raise UcscException(response.error_code, response.error_descr)

        out_mo_list = ucsccoreutils.extract_molist_from_method_response(
            response, hierarchy)

        return out_mo_list

        Finds children of a given managed object or distinguished name.
        Arguments can be specified to query only a specific type(class_id)
        of children.
        Arguments can also be specified to query only direct children or the
        entire hierarchy of children.

        Args:
            in_mo (managed object): query children managed object under this
                                        object.
            in_dn (dn string): query children managed object for a
                                given managed object of the respective dn.
            class_id(str): by default None, if given find only specific
                            children object for a given class_id.
            filter_str(str): query objects with specific property with specific
                            value or pattern specifying value.

                      (property_name, "property_value, type="filter_type")\n
                      property_name: Name of the Property\n
                      property_value: Value of the property (str or regular
                                      expression)\n
                      filter_type: eq - equal to\n
                                   ne - not equal to\n
                                   ge - greater than or equal to\n
                                   gt - greater than\n
                                   le - less than or equal to\n
                                   lt - less than\n
                                   re - regular expression\n

                      logical filter type: not, and, or\n

                      e.g. '(dn,"org-root/ls-C1_B1", type="eq") or (name,
                                            "event", type="re", flag="I")'\n
            hierarchy(bool): if set to True will return all the child
                             hierarchical objects.
            need_response(bool): if set to True will return only response
                                object.
            hierarchy(bool): if set to True will return all the child
                              hierarchical objects.
            dme: DME to post the query to

        Returns:
            managedobjectlist or None   by default\n
            managedobjectlist or None   if hierarchy=True\n

        Example:
            mo_list = handle.query_children(in_mo=mo)\n
            mo_list = handle.query_children(in_mo=mo, class_id="classid")\n
            mo_list = handle.query_children(in_dn=dn)\n
            mo_list = handle.query_children(in_dn=dn, class_id="classid")\n
            mo_list = handle.query_children(in_dn="org-root",
                        class_id="LsServer", filter_str="(usr_lbl, 'test')")
            mo_list = handle.query_children(in_dn="org-root",
                class_id="LsServer", filter_str="(usr_lbl, 'test', type='eq')")
        
Finds children of a given managed object or distinguished name.
Arguments can be specified to query only a specific type(class_id)
of children.
Arguments can also be specified to query only direct children or the
entire hierarchy of children.
Finds children of a given managed object or distinguished name . Arguments can be specified to query only a specific type ( class_id ) of children . Arguments can also be specified to query only direct children or the entire hierarchy of children .
def query_children(self, in_mo=None, in_dn=None, class_id=None,
                       filter_str=None, hierarchy=False, dme="central-mgr"):
        from .ucscfilter import generate_infilter
        from .ucscmethodfactory import config_resolve_children
        if not in_mo and not in_dn:
            raise ValueError('[Error]: GetChild: Provide in_mo or in_dn.')
        parent_dn = None
        if in_mo:
            parent_dn = in_mo.dn
        elif in_dn:
            parent_dn = in_dn
        in_filter = None
        if class_id:
            meta_class_id = \
                ucsccoreutils.find_class_id_in_mo_meta_ignore_case(
                    class_id)
            if meta_class_id:
                is_meta_class_id = True
            else:
                meta_class_id = class_id
                is_meta_class_id = False
            if filter_str:
                in_filter = generate_infilter(meta_class_id, filter_str,
                                              is_meta_class_id)
        else:
            meta_class_id = class_id
        elem = config_resolve_children(cookie=self.cookie,
                                       class_id=meta_class_id,
                                       in_dn=parent_dn,
                                       in_filter=in_filter,
                                       in_hierarchical=hierarchy)
        response = self.post_elem(elem, dme=dme)
        if response.error_code != 0:
            raise UcscException(response.error_code, response.error_descr)
        out_mo_list = ucsccoreutils.extract_molist_from_method_response(
            response, hierarchy)
        return out_mo_list
def query_children ( self , in_mo = None , in_dn = None , class_id = None , filter_str = None , hierarchy = False , dme = "central-mgr" ) : from . ucscfilter import generate_infilter from . ucscmethodfactory import config_resolve_children if not in_mo and not in_dn : raise ValueError ( '[Error]: GetChild: Provide in_mo or in_dn.' ) parent_dn = None if in_mo : parent_dn = in_mo . dn elif in_dn : parent_dn = in_dn in_filter = None if class_id : meta_class_id = ucsccoreutils . find_class_id_in_mo_meta_ignore_case ( class_id ) if meta_class_id : is_meta_class_id = True else : meta_class_id = class_id is_meta_class_id = False if filter_str : in_filter = generate_infilter ( meta_class_id , filter_str , is_meta_class_id ) else : meta_class_id = class_id elem = config_resolve_children ( cookie = self . cookie , class_id = meta_class_id , in_dn = parent_dn , in_filter = in_filter , in_hierarchical = hierarchy ) response = self . post_elem ( elem , dme = dme ) if response . error_code != 0 : raise UcscException ( response . error_code , response . error_descr ) out_mo_list = ucsccoreutils . extract_molist_from_method_response ( response , hierarchy ) return out_mo_list
Finds children of a given managed object or distinguished name.
Finds children of a given managed object or distinguished name .
"""
        Finds children of a given managed object or distinguished name.
        Arguments can be specified to query only a specific type(class_id)
        of children.
        Arguments can also be specified to query only direct children or the
        entire hierarchy of children.

        Args:
            in_mo (managed object): query children managed object under this
                                        object.
            in_dn (dn string): query children managed object for a
                                given managed object of the respective dn.
            class_id(str): by default None, if given find only specific
                            children object for a given class_id.
            filter_str(str): query objects with specific property with specific
                            value or pattern specifying value.

                      (property_name, "property_value, type="filter_type")\n
                      property_name: Name of the Property\n
                      property_value: Value of the property (str or regular
                                      expression)\n
                      filter_type: eq - equal to\n
                                   ne - not equal to\n
                                   ge - greater than or equal to\n
                                   gt - greater than\n
                                   le - less than or equal to\n
                                   lt - less than\n
                                   re - regular expression\n

                      logical filter type: not, and, or\n

                      e.g. '(dn,"org-root/ls-C1_B1", type="eq") or (name,
                                            "event", type="re", flag="I")'\n
            hierarchy(bool): if set to True will return all the child
                             hierarchical objects.
            need_response(bool): if set to True will return only response
                                object.
            hierarchy(bool): if set to True will return all the child
                              hierarchical objects.
            dme: DME to post the query to

        Returns:
            managedobjectlist or None   by default\n
            managedobjectlist or None   if hierarchy=True\n

        Example:
            mo_list = handle.query_children(in_mo=mo)\n
            mo_list = handle.query_children(in_mo=mo, class_id="classid")\n
            mo_list = handle.query_children(in_dn=dn)\n
            mo_list = handle.query_children(in_dn=dn, class_id="classid")\n
            mo_list = handle.query_children(in_dn="org-root",
                        class_id="LsServer", filter_str="(usr_lbl, 'test')")
            mo_list = handle.query_children(in_dn="org-root",
                class_id="LsServer", filter_str="(usr_lbl, 'test', type='eq')")
        """
managedobjectlist or None   by default\n
managedobjectlist or None   if hierarchy=True\n
managedobjectlist or None by default \ n managedobjectlist or None if hierarchy = True \ n
self
in_mo
query children managed object under this
object.
query children managed object under this object .
in_dn
query children managed object for a
given managed object of the respective dn.
query children managed object for a given managed object of the respective dn .
class_id
by default None, if given find only specific
children object for a given class_id.
by default None if given find only specific children object for a given class_id .
filter_str
query objects with specific property with specific
value or pattern specifying value.

(property_name, "property_value, type="filter_type")\n
property_name: Name of the Property\n
property_value: Value of the property (str or regular
expression)\n
filter_type: eq - equal to\n
ne - not equal to\n
ge - greater than or equal to\n
gt - greater than\n
le - less than or equal to\n
lt - less than\n
re - regular expression\n

logical filter type: not, and, or\n

e.g.
query objects with specific property with specific value or pattern specifying value . ( property_name " property_value type = " filter_type " ) \ n property_name : Name of the Property \ n property_value : Value of the property ( str or regular expression ) \ n filter_type : eq - equal to \ n ne - not equal to \ n ge - greater than or equal to \ n gt - greater than \ n le - less than or equal to \ n lt - less than \ n re - regular expression \ n logical filter type : not and or \ n e . g .
hierarchy
if set to True will return all the child
hierarchical objects.
if set to True will return all the child hierarchical objects .
dme
DME to post the query to
DME to post the query to
need_response
if set to True will return only response
object.
if set to True will return only response object .
examples
mo_list = handle.query_children(in_mo=mo)\n
mo_list = handle.query_children(in_mo=mo, class_id="classid")\n
mo_list = handle.query_children(in_dn=dn)\n
mo_list = handle.query_children(in_dn=dn, class_id="classid")\n
mo_list = handle.query_children(in_dn="org-root",
class_id="LsServer", filter_str="(usr_lbl, 'test')")
mo_list = handle.query_children(in_dn="org-root",
class_id="LsServer", filter_str="(usr_lbl, 'test', type='eq')")
mo_list = handle . query_children ( in_mo = mo ) \ n mo_list = handle . query_children ( in_mo = mo class_id = " classid " ) \ n mo_list = handle . query_children ( in_dn = dn ) \ n mo_list = handle . query_children ( in_dn = dn class_id = " classid " ) \ n mo_list = handle . query_children ( in_dn = " org - root " class_id = " LsServer " filter_str = " ( usr_lbl ' test ' ) " ) mo_list = handle . query_children ( in_dn = " org - root " class_id = " LsServer " filter_str = " ( usr_lbl ' test ' type = ' eq ' ) " )