ucscsdk/ucscdriver.py
def post(self, uri, data=None, dump_xml=False, read=True):
        """
        sends the web request and receives the response from UcsCentral server

        Args:
            uri (str): URI of the  the UcsCentral Server
            data (str): request data to send via post request
            dump_xml (bool): if True, displays request and response
            read (bool): if True, returns response.read() else returns object.

        Returns:
            response xml string or response object

        Example:
            response = post("http://192.168.1.1:80", data=xml_str)
        """

        try:
            request = self.__create_request(uri=uri, data=data)
            if dump_xml:
                log.debug('%s ====> %s' % (uri, data))

            opener = urllib2.build_opener(*self.__handlers)
            response = opener.open(request)

            if read:
                response = response.read().decode('utf-8')
                if dump_xml:
                    log.debug('%s <==== %s' % (uri, response))
            return response
        except HTTPError as e:
            log.debug(e.headers)
            raise

        sends the web request and receives the response from UcsCentral server

        Args:
            uri (str): URI of the  the UcsCentral Server
            data (str): request data to send via post request
            dump_xml (bool): if True, displays request and response
            read (bool): if True, returns response.read() else returns object.

        Returns:
            response xml string or response object

        Example:
            response = post("http://192.168.1.1:80", data=xml_str)
        
sends the web request and receives the response from UcsCentral server
sends the web request and receives the response from UcsCentral server
def post(self, uri, data=None, dump_xml=False, read=True):
        try:
            request = self.__create_request(uri=uri, data=data)
            if dump_xml:
                log.debug('%s ====> %s' % (uri, data))
            opener = urllib2.build_opener(*self.__handlers)
            response = opener.open(request)
            if read:
                response = response.read().decode('utf-8')
                if dump_xml:
                    log.debug('%s <==== %s' % (uri, response))
            return response
        except HTTPError as e:
            log.debug(e.headers)
            raise
def post ( self , uri , data = None , dump_xml = False , read = True ) : try : request = self . __create_request ( uri = uri , data = data ) if dump_xml : log . debug ( '%s ====> %s' % ( uri , data ) ) opener = urllib2 . build_opener ( * self . __handlers ) response = opener . open ( request ) if read : response = response . read ( ) . decode ( 'utf-8' ) if dump_xml : log . debug ( '%s <==== %s' % ( uri , response ) ) return response except HTTPError as e : log . debug ( e . headers ) raise
sends the web request and receives the response from UcsCentral server
sends the web request and receives the response from UcsCentral server
"""
        sends the web request and receives the response from UcsCentral server

        Args:
            uri (str): URI of the  the UcsCentral Server
            data (str): request data to send via post request
            dump_xml (bool): if True, displays request and response
            read (bool): if True, returns response.read() else returns object.

        Returns:
            response xml string or response object

        Example:
            response = post("http://192.168.1.1:80", data=xml_str)
        """
response xml string or response object
response xml string or response object
self
uri
URI of the  the UcsCentral Server
URI of the the UcsCentral Server
data
request data to send via post request
request data to send via post request
dump_xml
if True, displays request and response
if True displays request and response
read
if True, returns response.read() else returns object.
if True returns response . read () else returns object .
examples
None