spark_plugin.py
def rest_request(self, url, path, *args, **kwargs):
        """
        Makes REST call to Spark API endpoint
        """
        url = url.rstrip("/") + "/" + path.lstrip("/")
        if args:
            for arg in args:
                url = url.rstrip("/") + "/" + arg.lstrip("/")

        if kwargs:
            query = "&".join(["{0}={1}".format(key, value) for key, value in kwargs.items()])
            url = urljoin(url, "?" + query)

        try:
            req = urllib.request.Request(url)
            resp = urllib.request.urlopen(req)
            return resp
        except (urllib.error.HTTPError, urllib.error.URLError) as e:
            if HTTP_404_ERROR not in str(e):
                collectd.info("Unable to make request at (%s) %s" % (e, url))
            return None
        except Exception:
            return None

        Makes REST call to Spark API endpoint
        
Makes REST call to Spark API endpoint
Makes REST call to Spark API endpoint
def rest_request(self, url, path, *args, **kwargs):
        url = url.rstrip("/") + "/" + path.lstrip("/")
        if args:
            for arg in args:
                url = url.rstrip("/") + "/" + arg.lstrip("/")
        if kwargs:
            query = "&".join(["{0}={1}".format(key, value) for key, value in kwargs.items()])
            url = urljoin(url, "?" + query)
        try:
            req = urllib.request.Request(url)
            resp = urllib.request.urlopen(req)
            return resp
        except (urllib.error.HTTPError, urllib.error.URLError) as e:
            if HTTP_404_ERROR not in str(e):
                collectd.info("Unable to make request at (%s) %s" % (e, url))
            return None
        except Exception:
            return None
def rest_request ( self , url , path , * args , ** kwargs ) : url = url . rstrip ( "/" ) + "/" + path . lstrip ( "/" ) if args : for arg in args : url = url . rstrip ( "/" ) + "/" + arg . lstrip ( "/" ) if kwargs : query = "&" . join ( [ "{0}={1}" . format ( key , value ) for key , value in kwargs . items ( ) ] ) url = urljoin ( url , "?" + query ) try : req = urllib . request . Request ( url ) resp = urllib . request . urlopen ( req ) return resp except ( urllib . error . HTTPError , urllib . error . URLError ) as e : if HTTP_404_ERROR not in str ( e ) : collectd . info ( "Unable to make request at (%s) %s" % ( e , url ) ) return None except Exception : return None
Makes REST call to Spark API endpoint
Makes REST call to Spark API endpoint
"""
        Makes REST call to Spark API endpoint
        """
self
url
path