def touch_endpoint(self, endpoint_url):
        """
        Test the deployed endpoint with a GET request.
        """

        # Private APIGW endpoints most likely can't be reached by a deployer
        # unless they're connected to the VPC by VPN. Instead of trying
        # connect to the service, print a warning and let the user know
        # to check it manually.
        # See: https://github.com/Miserlou/Zappa/pull/1719#issuecomment-471341565
        if 'PRIVATE' in self.stage_config.get('endpoint_configuration', []):
            print(
                click.style("Warning!", fg="yellow", bold=True) +
                " Since you're deploying a private API Gateway endpoint,"
                " Zappa cannot determine if your function is returning "
                " a correct status code. You should check your API's response"
                " manually before considering this deployment complete."
            )
            return

        touch_path = self.stage_config.get('touch_path', '/')
        req = requests.get(endpoint_url + touch_path)

        # Sometimes on really large packages, it can take 60-90 secs to be
        # ready and requests will return 504 status_code until ready.
        # So, if we get a 504 status code, rerun the request up to 4 times or
        # until we don't get a 504 error
        if req.status_code == 504:
            i = 0
            status_code = 504
            while status_code == 504 and i <= 4:
                req = requests.get(endpoint_url + touch_path)
                status_code = req.status_code
                i += 1

        if req.status_code >= 500:
            raise ClickException(click.style("Warning!", fg="red", bold=True) +
                " Status check on the deployed lambda failed." +
                " A GET request to '" + touch_path + "' yielded a " +
                click.style(str(req.status_code), fg="red", bold=True) + " response code.")
def touch_endpoint ( self , endpoint_url ) : if 'PRIVATE' in self . stage_config . get ( 'endpoint_configuration' , [ ] ) : print ( click . style ( "Warning!" , fg = "yellow" , bold = True ) + " Since you're deploying a private API Gateway endpoint," " Zappa cannot determine if your function is returning " " a correct status code. You should check your API's response" " manually before considering this deployment complete." ) return touch_path = self . stage_config . get ( 'touch_path' , '/' ) req = requests . get ( endpoint_url + touch_path ) if req . status_code == 504 : i = 0 status_code = 504 while status_code == 504 and i <= 4 : req = requests . get ( endpoint_url + touch_path ) status_code = req . status_code i += 1 if req . status_code >= 500 : raise ClickException ( click . style ( "Warning!" , fg = "red" , bold = True ) + " Status check on the deployed lambda failed." + " A GET request to '" + touch_path + "' yielded a " + click . style ( str ( req . status_code ) , fg = "red" , bold = True ) + " response code." )
Test the deployed endpoint with a GET request.