Sfoglia il codice sorgente

HUE-8591 [cluster] Move API url to a config property

Romain Rigaux 7 anni fa
parent
commit
9aaf2a5

+ 11 - 0
desktop/libs/metadata/src/metadata/conf.py

@@ -199,6 +199,17 @@ ALTUS = ConfigSection(
   )
 )
 
+K8 = ConfigSection(
+  key='k8',
+  help=_t("""Configuration options for Kubernetes API"""),
+  members=dict(
+    API_URL=Config(
+      key='api_url',
+      help=_t('API URL to Kubernetes API or compatible service.'),
+      default='http://provisioner.35.236.77.238.nip.io/'),
+  )
+)
+
 DEFAULT_PUBLIC_KEY = Config(
   key="default_publick_key",
   help=_t("Public key used for cluster creation."),

+ 2 - 2
desktop/libs/notebook/src/notebook/connectors/altus.py

@@ -22,7 +22,7 @@ from datetime import datetime,  timedelta
 from django.urls import reverse
 from django.utils.translation import ugettext as _
 
-from metadata.conf import ALTUS
+from metadata.conf import ALTUS, K8
 from navoptapi.api_lib import ApiLib
 
 
@@ -276,7 +276,7 @@ class AnalyticDbApi():
 class DataWarehouse2Api():
 
   def __init__(self, user=None):
-    self._api_url = 'http://172.16.34.61:4747/dw'
+    self._api_url = '%s/wa' % K8.API_URL.get().rstrip('/')
 
     self.user = user
     self._client = HttpClient(self._api_url, logger=LOG)