summaryrefslogtreecommitdiffstats
path: root/newton/newton/pub
diff options
context:
space:
mode:
authorBin Yang <bin.yang@windriver.com>2017-09-07 09:54:06 +0800
committerBin Yang <bin.yang@windriver.com>2017-09-07 09:54:06 +0800
commite89da401974dabc88c110cbb4b6da9f9dd14f9a3 (patch)
tree477045fa546074c303e985d14cb17a2044e3bedd /newton/newton/pub
parent0a0adefe44123f161d79dd0341df6db3b7cdd404 (diff)
Populate cloud resources into AAI
populate tenants,flavors,images info into AAI Change-Id: Ifa9701916168fd61814659622233b1129412b189 Issue-Id: MULTICLOUD-58 Signed-off-by: Bin Yang <bin.yang@windriver.com>
Diffstat (limited to 'newton/newton/pub')
-rw-r--r--newton/newton/pub/config/config.py8
-rw-r--r--newton/newton/pub/utils/restcall.py8
2 files changed, 10 insertions, 6 deletions
diff --git a/newton/newton/pub/config/config.py b/newton/newton/pub/config/config.py
index 96837118..0dde6152 100644
--- a/newton/newton/pub/config/config.py
+++ b/newton/newton/pub/config/config.py
@@ -12,9 +12,13 @@
import os
# [MSB]
-MSB_SERVICE_IP = '127.0.0.1'
+MSB_SERVICE_ADDR = '127.0.0.1'
MSB_SERVICE_PORT = '80'
+
+#[Multicloud]
+MULTICLOUD_PREFIX = "http://%s:%s/api/multicloud-newton/v0" %(MSB_SERVICE_ADDR, MSB_SERVICE_PORT)
+
# [A&AI]
AAI_ADDR = "aai.api.simpledemo.openecomp.org"
AAI_PORT = "8443"
@@ -23,7 +27,7 @@ AAI_SCHEMA_VERSION = "v11"
AAI_USERNAME = 'AAI'
AAI_PASSWORD = 'AAI'
-AAI_APP_ID = 'MultiCloud-Newton'
+MULTICLOUD_APP_ID = 'MultiCloud-Newton'
# [IMAGE LOCAL PATH]
ROOT_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
diff --git a/newton/newton/pub/utils/restcall.py b/newton/newton/pub/utils/restcall.py
index c2fa361d..871df460 100644
--- a/newton/newton/pub/utils/restcall.py
+++ b/newton/newton/pub/utils/restcall.py
@@ -23,8 +23,8 @@ from newton.pub.config.config import AAI_SCHEMA_VERSION
from newton.pub.config.config import AAI_SERVICE_URL
from newton.pub.config.config import AAI_USERNAME
from newton.pub.config.config import AAI_PASSWORD
-from newton.pub.config.config import MSB_SERVICE_IP, MSB_SERVICE_PORT
-from newton.pub.config.config import AAI_APP_ID
+from newton.pub.config.config import MSB_SERVICE_ADDR, MSB_SERVICE_PORT
+from newton.pub.config.config import MULTICLOUD_APP_ID
rest_no_auth, rest_oneway_auth, rest_bothway_auth = 0, 1, 2
HTTP_200_OK, HTTP_201_CREATED, HTTP_204_NO_CONTENT, HTTP_202_ACCEPTED \
@@ -95,7 +95,7 @@ def call_req(base_url, user, passwd, auth_type,
def req_by_msb(resource, method, content=''):
- base_url = "http://%s:%s/" % (MSB_SERVICE_IP, MSB_SERVICE_PORT)
+ base_url = "http://%s:%s/" % (MSB_SERVICE_ADDR, MSB_SERVICE_PORT)
# logger.debug("requests--get::> %s" % "33")
return call_req(base_url, "", "", rest_no_auth,
resource, method, "", content)
@@ -105,7 +105,7 @@ def req_to_vim(base_url, resource, method, extra_headers='', content=''):
return call_req(base_url, "", "", rest_no_auth,
resource, method, extra_headers, content)
-def req_to_aai(resource, method, content='', appid=AAI_APP_ID):
+def req_to_aai(resource, method, content='', appid=MULTICLOUD_APP_ID):
tmp_trasaction_id = uuid.uuid1()
headers = {
'X-FromAppId': appid,