def getApp(appID, logoutput=True): ''' Gets JSON element of specific application ID. ''' if Hadoop.isEncrypted(): rmAppsUrl = YARN.getRMUrl() + "/ws/v1/cluster/apps" else: rmAppsUrl = YARN.getRMUrl() + "/ws/v1/cluster/apps" res = util.getHTTPResponse("JSON", rmAppsUrl) apps = util.getElement("JSON", res, "apps", False) appList = util.getElement("JSON", apps, "app", False) for app in appList: if util.getValue("JSON", util.getElement("JSON", app, "id")) == appID: if logoutput: logger.info("getApp Found: app = %s" % app) return app if logoutput: logger.info("getApp returns None") return None