diff options
author | 2018-10-12 11:28:27 +0800 | |
---|---|---|
committer | 2018-10-12 13:15:33 +0800 | |
commit | f4d46ad8124e01517ed684796880d369566e6d97 (patch) | |
tree | 2298f9be8b447fed6cc4b1eca09f5dede101d6ed | |
parent | 52420611e4993f1fecaeb2fa85d84bef23d282b6 (diff) |
Update reg to MSB param of vfc-catalog
Change-Id: I167db1a4ed9dfb0fd33cdd1ba5b8cb8e342f730e
Issue-ID: VFC-1145
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
-rw-r--r-- | catalog/packages/biz/sdc_ns_package.py | 2 | ||||
-rw-r--r-- | catalog/packages/biz/sdc_vnf_package.py | 2 | ||||
-rw-r--r-- | catalog/pub/config/config.py | 26 | ||||
-rw-r--r-- | catalog/urls.py | 6 |
4 files changed, 28 insertions, 8 deletions
diff --git a/catalog/packages/biz/sdc_ns_package.py b/catalog/packages/biz/sdc_ns_package.py index b079f3e3..b9b38f8d 100644 --- a/catalog/packages/biz/sdc_ns_package.py +++ b/catalog/packages/biz/sdc_ns_package.py @@ -157,7 +157,7 @@ class NsPackage(object): package_info["nsdInvariantId"] = csars[0].invariantId package_info["downloadUrl"] = "http://%s:%s/%s/%s/%s" % ( MSB_SERVICE_IP, - REG_TO_MSB_REG_PARAM["nodes"][0]["port"], + REG_TO_MSB_REG_PARAM[0]["nodes"][0]["port"], CATALOG_URL_PATH, csar_id, csars[0].nsPackageUri) diff --git a/catalog/packages/biz/sdc_vnf_package.py b/catalog/packages/biz/sdc_vnf_package.py index 55de8096..f74aed9a 100644 --- a/catalog/packages/biz/sdc_vnf_package.py +++ b/catalog/packages/biz/sdc_vnf_package.py @@ -227,7 +227,7 @@ class NfPackage(object): pkg_info["vnfdModel"] = nf_pkg[0].vnfdModel pkg_info["downloadUrl"] = "http://%s:%s/%s/%s/%s" % ( MSB_SERVICE_IP, - REG_TO_MSB_REG_PARAM["nodes"][0]["port"], + REG_TO_MSB_REG_PARAM[0]["nodes"][0]["port"], CATALOG_URL_PATH, csar_id, nf_pkg[0].vnfPackageUri) diff --git a/catalog/pub/config/config.py b/catalog/pub/config/config.py index 0086e99a..2aaf3941 100644 --- a/catalog/pub/config/config.py +++ b/catalog/pub/config/config.py @@ -36,7 +36,7 @@ FORWARDED_FOR_FIELDS = ["HTTP_X_FORWARDED_FOR", "HTTP_X_FORWARDED_HOST", # [register] REG_TO_MSB_WHEN_START = True REG_TO_MSB_REG_URL = "/api/microservices/v1/services" -REG_TO_MSB_REG_PARAM = { +REG_TO_MSB_REG_PARAM = [{ "serviceName": "catalog", "version": "v1", "url": "/api/catalog/v1", @@ -47,7 +47,29 @@ REG_TO_MSB_REG_PARAM = { "port": "8806", "ttl": 0 }] -} +}, { + "serviceName": "nsd", + "version": "v1", + "url": "/api/nsd/v1", + "protocol": "REST", + "visualRange": "1", + "nodes": [{ + "ip": "127.0.0.1", + "port": "8806", + "ttl": 0 + }] +}, { + "serviceName": "vnfpkgm", + "version": "v1", + "url": "/api/vnfpkgm/v1", + "protocol": "REST", + "visualRange": "1", + "nodes": [{ + "ip": "127.0.0.1", + "port": "8806", + "ttl": 0 + }] +}] # catalog path(values is defined in settings.py) CATALOG_ROOT_PATH = None diff --git a/catalog/urls.py b/catalog/urls.py index 6b4abf1e..666b37db 100644 --- a/catalog/urls.py +++ b/catalog/urls.py @@ -27,7 +27,5 @@ urlpatterns = [ if REG_TO_MSB_WHEN_START: import json from catalog.pub.utils.restcall import req_by_msb - req_by_msb( - REG_TO_MSB_REG_URL, - "POST", - json.JSONEncoder().encode(REG_TO_MSB_REG_PARAM)) + for reg_param in REG_TO_MSB_REG_PARAM: + req_by_msb(REG_TO_MSB_REG_URL, "POST", json.JSONEncoder().encode(reg_param)) |