ucscsdk/ucschandle.py
def query_dns(self, dns=[], dme="central-mgr"):
        """
        Queries multiple obects from the server based of a comma separated list
        of their distinguised names.

        Args:
            dns (comma separated strings): distinguished names to be
                queried for
            dme: DME to post the query to.

        Returns:
            Dictionary {dn1: object, dn2: object2}

        Example:
            obj = handle.query_dns(["fabric/lan/net-100",
                                       "fabric/lan/net-101"])
        """

        from .ucscbasetype import DnSet, Dn
        from .ucscmethodfactory import config_resolve_dns

        if not dns:
            raise ValueError("Provide Comma Separated string of Dns")

        dn_list = [dn.strip() for dn in dns]
        dn_dict = {}
        for dn_ in dn_list:
            dn_dict[dn_] = None

        dn_set = DnSet()
        for dn_ in dn_dict:
            dn_obj = Dn()
            dn_obj.value = dn_
            dn_set.child_add(dn_obj)

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

        for out_mo in response.out_configs.child:
            dn_dict[out_mo.dn] = out_mo

        return dn_dict

        Queries multiple obects from the server based of a comma separated list
        of their distinguised names.

        Args:
            dns (comma separated strings): distinguished names to be
                queried for
            dme: DME to post the query to.

        Returns:
            Dictionary {dn1: object, dn2: object2}

        Example:
            obj = handle.query_dns(["fabric/lan/net-100",
                                       "fabric/lan/net-101"])
        
Queries multiple obects from the server based of a comma separated list
of their distinguised names.
Queries multiple obects from the server based of a comma separated list of their distinguised names .
def query_dns(self, dns=[], dme="central-mgr"):
        from .ucscbasetype import DnSet, Dn
        from .ucscmethodfactory import config_resolve_dns
        if not dns:
            raise ValueError("Provide Comma Separated string of Dns")
        dn_list = [dn.strip() for dn in dns]
        dn_dict = {}
        for dn_ in dn_list:
            dn_dict[dn_] = None
        dn_set = DnSet()
        for dn_ in dn_dict:
            dn_obj = Dn()
            dn_obj.value = dn_
            dn_set.child_add(dn_obj)
        elem = config_resolve_dns(cookie=self.cookie, in_dns=dn_set)
        response = self.post_elem(elem, dme=dme)
        if response.error_code != 0:
            raise UcscException(response.error_code,
                                response.error_descr)
        for out_mo in response.out_configs.child:
            dn_dict[out_mo.dn] = out_mo
        return dn_dict
def query_dns ( self , dns = [ ] , dme = "central-mgr" ) : from . ucscbasetype import DnSet , Dn from . ucscmethodfactory import config_resolve_dns if not dns : raise ValueError ( "Provide Comma Separated string of Dns" ) dn_list = [ dn . strip ( ) for dn in dns ] dn_dict = { } for dn_ in dn_list : dn_dict [ dn_ ] = None dn_set = DnSet ( ) for dn_ in dn_dict : dn_obj = Dn ( ) dn_obj . value = dn_ dn_set . child_add ( dn_obj ) elem = config_resolve_dns ( cookie = self . cookie , in_dns = dn_set ) response = self . post_elem ( elem , dme = dme ) if response . error_code != 0 : raise UcscException ( response . error_code , response . error_descr ) for out_mo in response . out_configs . child : dn_dict [ out_mo . dn ] = out_mo return dn_dict
Queries multiple obects from the server based of a comma separated list
of their distinguised names.
Queries multiple obects from the server based of a comma separated list of their distinguised names .
"""
        Queries multiple obects from the server based of a comma separated list
        of their distinguised names.

        Args:
            dns (comma separated strings): distinguished names to be
                queried for
            dme: DME to post the query to.

        Returns:
            Dictionary {dn1: object, dn2: object2}

        Example:
            obj = handle.query_dns(["fabric/lan/net-100",
                                       "fabric/lan/net-101"])
        """
Dictionary {dn1: object, dn2: object2}
Dictionary { dn1 : object dn2 : object2 }
self
dns
distinguished names to be
queried for
distinguished names to be queried for
dme
DME to post the query to.
DME to post the query to .
examples
None