def _test_connectivity(self, param, LADS):
"""
Called when the user depresses the test connectivity button on the Phantom UI.
This query returns a list of configured applications
https://api.a10networks.com/api/v2/applications
"""
self.debug_print("%s _test_connectivity %s" % (A10_LADS_Connector.BANNER, param))
msg = "test connectivity to %s status_code: " % (LADS.dashboard)
if LADS.genericGET(uri="/api/v2/applications"):
# True is success
return self.set_status_save_progress(phantom.APP_SUCCESS, msg + "%s %s apps: %s" %
(LADS.status_code, httplib.responses[LADS.status_code], LADS.get_names(LADS.response)))
else:
# None or False, is a failure based on incorrect IP address, username, passords
return self.set_status_save_progress(phantom.APP_ERROR, msg + "%s %s" % (LADS.status_code, LADS.response))
评论列表
文章目录