def getClusterNameUrl(self): self.logger.info(self.urlGetClusters) hres, res = self.callPyCurlRequest( url=self.urlGetClusters, data=None, method='get', usernamepassword=self.username_password ) d = json.loads(res) if Config.hasSection('hdc'): proxy_enabled = Config.get('hdc', 'USE_CLI') if proxy_enabled == 'yes': return str(d['items'][0]['href']) return Ambari.getWebUrl() + "/api/v1/clusters/" + Ambari.getClusterName()
logger = logging.getLogger(__name__) JAVA_HOME = Config.get('machine', 'JAVA_HOME') JAVA_CMD = os.path.join(JAVA_HOME, 'bin', 'java') HADOOP_HOME = Config.get('hadoop', 'HADOOP_HOME') KNOX_HOME = Config.get('knox', 'KNOX_HOME') KNOX_HOST = Config.get('knox', 'KNOX_HOST').split(',')[ 0] # Just use the first Knox instance in the list for now. KNOX_USER = Config.get('knox', 'KNOX_USER') KNOX_CONF = Config.get('knox', 'KNOX_CONF') knox_host_list = [Config.get('knox', 'KNOX_HOST')] #Initialized with Knox Host proxy_enabled = 'no' #HDC Config if Config.hasSection('hdc'): proxy_enabled = Config.get('hdc', 'USE_CLI') #get list of hosts running Knox Gateway if proxy_enabled == 'no': if (Hadoop.isEncrypted() and Machine.isHumboldt() == False): newAmbariUtil = AmbariAPIUtil(port=8443, isHttps=True) else: newAmbariUtil = AmbariAPIUtil(port=8080, isHttps=False) if ((Machine.isHumboldt() == False) and (proxy_enabled == 'no')): # If multiple Knox Hosts, get the List using Ambari API knoxHosts = newAmbariUtil.getComponentHosts('KNOX', 'KNOX_GATEWAY') if knoxHosts is not None: knox_host_list = knoxHosts.split(",") logger.info("List of Hosts running Knox Gateway * knoxHosts: %s " %