1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
# Copyright 2017 ZTE Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
# [MSB]
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"
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 = os.getenv("DB_IP", "127.0.0.1")
DB_PORT = os.getenv("DB_PORT", "3306")
DB_NAME = "etsicatalog"
DB_USER = os.getenv("DB_USER", "etsicatalog")
DB_PASSWD = os.getenv("DB_PASSWD", "etsicatalog")
# [MDC]
SERVICE_NAME = "catalog"
FORWARDED_FOR_FIELDS = ["HTTP_X_FORWARDED_FOR", "HTTP_X_FORWARDED_HOST",
"HTTP_X_FORWARDED_SERVER"]
# [register]
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": SERVICE_IP,
"port": "8806",
"ttl": 0
}]
}, {
"serviceName": "nsd",
"version": "v1",
"enable_ssl": SSL_ENABLED,
"url": "/api/nsd/v1",
"protocol": "REST",
"visualRange": "1",
"nodes": [{
"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": SERVICE_IP,
"port": "8806",
"ttl": 0
}]
}, {
"serviceName": "parser",
"version": "v1",
"enable_ssl": SSL_ENABLED,
"url": "/api/parser/v1",
"protocol": "REST",
"visualRange": "1",
"nodes": [{
"ip": SERVICE_IP,
"port": "8806",
"ttl": 0
}]
}]
MSB_SVC_CALALOG_URL = "/api/microservices/v1/services/catalog/version/v1"
MSB_SVC_NSD_URL = "/api/microservices/v1/services/nsd/version/v1"
MSB_SVC_VNFPKGM_URL = "/api/microservices/v1/services/vnfpkgm/version/v1"
MSB_SVC_PARSER_URL = "/api/microservices/v1/services/parser/version/v1"
# catalog path(values is defined in settings.py)
CATALOG_ROOT_PATH = None
CATALOG_URL_PATH = None
VNFD_SCHEMA_VERSION_DEFAULT = "base"
|