X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=catalog%2Fpub%2Fconfig%2Fconfig.py;h=49d1d84d79a07679cf6ac8cc4a6607e4354719ec;hb=46bd3041d522ddce28ae3450e98c9c49b44b02cc;hp=3b8a59e0955806dab095ce570b70148ca45402fe;hpb=14eb438e920a9905e7254bf3aeb6bc4cc423e6b3;p=modeling%2Fetsicatalog.git diff --git a/catalog/pub/config/config.py b/catalog/pub/config/config.py index 3b8a59e..49d1d84 100644 --- a/catalog/pub/config/config.py +++ b/catalog/pub/config/config.py @@ -12,21 +12,35 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os + # [MSB] -MSB_SERVICE_IP = '127.0.0.1' -MSB_SERVICE_PORT = '80' +MSB_BASE_URL = os.getenv("MSB_ADDR", "http://127.0.0.1:80") +MSB_ENABLED = os.getenv("MSB_ENABLED", "true") + +# [SDC config] +if MSB_ENABLED == "true": + SDC_BASE_URL = MSB_BASE_URL + "/api" +else: + SDC_BASE_URL = os.getenv("SDC_ADDR") +SDC_USER = "modeling" +SDC_PASSWD = "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U" -# [REDIS] -# REDIS_HOST = '127.0.0.1' -# REDIS_PORT = '6379' -# REDIS_PASSWD = '' +SERVICE_IP = os.getenv("SERVICE_IP", "127.0.0.1") + +# [DMAAP config] +DMAAP_ENABLED = os.getenv("DMAAP_ENABLED", False) +DMAAP_MR_BASE_URL = os.getenv("DMAAP_ADDR") +CONSUMER_GROUP = "consumerGroup" +CONSUMER_ID = "consumerId" +POLLING_INTERVAL = 15 # [mysql] -DB_IP = "127.0.0.1" -DB_PORT = 3306 +DB_IP = os.getenv("DB_IP", "127.0.0.1") +DB_PORT = os.getenv("DB_PORT", "3306") DB_NAME = "etsicatalog" -DB_USER = "etsicatalog" -DB_PASSWD = "etsicatalog" +DB_USER = os.getenv("DB_USER", "etsicatalog") +DB_PASSWD = os.getenv("DB_PASSWD", "etsicatalog") # [MDC] SERVICE_NAME = "catalog" @@ -34,49 +48,54 @@ FORWARDED_FOR_FIELDS = ["HTTP_X_FORWARDED_FOR", "HTTP_X_FORWARDED_HOST", "HTTP_X_FORWARDED_SERVER"] # [register] -REG_TO_MSB_WHEN_START = True +REG_TO_MSB_WHEN_START = False REG_TO_MSB_REG_URL = "/api/microservices/v1/services" +SSL_ENABLED = os.getenv("SSL_ENABLED", "false") REG_TO_MSB_REG_PARAM = [{ "serviceName": "catalog", "version": "v1", + "enable_ssl": SSL_ENABLED, "url": "/api/catalog/v1", "protocol": "REST", "visualRange": "1", "nodes": [{ - "ip": "127.0.0.1", + "ip": SERVICE_IP, "port": "8806", "ttl": 0 }] }, { "serviceName": "nsd", "version": "v1", + "enable_ssl": SSL_ENABLED, "url": "/api/nsd/v1", "protocol": "REST", "visualRange": "1", "nodes": [{ - "ip": "127.0.0.1", + "ip": SERVICE_IP, "port": "8806", "ttl": 0 }] }, { "serviceName": "vnfpkgm", "version": "v1", + "enable_ssl": SSL_ENABLED, "url": "/api/vnfpkgm/v1", "protocol": "REST", "visualRange": "1", "nodes": [{ - "ip": "127.0.0.1", + "ip": SERVICE_IP, "port": "8806", "ttl": 0 }] }, { "serviceName": "parser", "version": "v1", + "enable_ssl": SSL_ENABLED, "url": "/api/parser/v1", "protocol": "REST", "visualRange": "1", "nodes": [{ - "ip": "127.0.0.1", + "ip": SERVICE_IP, "port": "8806", "ttl": 0 }] @@ -90,9 +109,4 @@ MSB_SVC_PARSER_URL = "/api/microservices/v1/services/parser/version/v1" CATALOG_ROOT_PATH = None CATALOG_URL_PATH = None -# [sdc config] -SDC_BASE_URL = "https://msb-iag/api" -SDC_USER = "aai" -SDC_PASSWD = "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U" - VNFD_SCHEMA_VERSION_DEFAULT = "base"