Change-Id: Ie5e0c73c1a0ad69a7415e12221b59839c826c192
Issue-Id: VFC-93
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
# [mysql]
DB_IP = "127.0.0.1"
DB_PORT = 3306
# [mysql]
DB_IP = "127.0.0.1"
DB_PORT = 3306
-DB_NAME = "inventory"
-DB_USER = "inventory"
-DB_PASSWD = "inventory"
+DB_NAME = "vfcnfvolcm"
+DB_USER = "vfcnfvolcm"
+DB_PASSWD = "vfcnfvolcm"
# [register]
REG_TO_MSB_WHEN_START = True
# [register]
REG_TO_MSB_WHEN_START = True
CATALOG_ROOT_PATH = None
CATALOG_URL_PATH = None
CATALOG_ROOT_PATH = None
CATALOG_URL_PATH = None
+# [sdc config]
+SDC_BASE_URL = "https://127.0.0.1:1234/api"
+SDC_USER = "admin"
+SDC_PASSWD = "admin"
+
+
+
+
+
import logging
from lcm.pub.exceptions import NSLCMException
import logging
from lcm.pub.exceptions import NSLCMException
-from lcm.pub.utils.restcall import call_req
+from lcm.pub.utils.restcall import call_req, rest_no_auth
+from lcm.pub.config.config import SDC_BASE_URL, SDC_USER, SDC_PASSWD
logger = logging.getLogger(__name__)
logger = logging.getLogger(__name__)
ASSETTYPE_SERVICES = "services"
def call_sdc(resource, method, content=''):
ASSETTYPE_SERVICES = "services"
def call_sdc(resource, method, content=''):
- base_url = "TODO: SDC Base URL"
- sdc_user = "TODO: sdc user"
- sdc_passwd = "TODO: sdc passwd"
- sdc_auth_type = "TODO: sdc auth type"
- return call_req(base_url, sdc_user, sdc_passwd, sdc_auth_type, resource, method, content)
+ return call_req(base_url=SDC_BASE_URL,
+ user=SDC_USER,
+ passwd=SDC_PASSWD,
+ auth_type=rest_no_auth,
+ resource=resource,
+ method=method,
+ content=content)
def get_artifacts(asset_type):
resource = "/sdc/v1/catalog/{assetType}"
def get_artifacts(asset_type):
resource = "/sdc/v1/catalog/{assetType}"
return json.JSONDecoder().decode(ret[1])
def download_artifacts(download_url, local_path):
return json.JSONDecoder().decode(ret[1])
def download_artifacts(download_url, local_path):
- sdc_user = "TODO: sdc user"
- sdc_passwd = "TODO: sdc passwd"
- sdc_auth_type = "TODO: sdc auth type"
- ret = call_req(download_url, sdc_user, sdc_passwd, sdc_auth_type, "", "GET")
+ ret = call_req(base_url=download_url,
+ user=SDC_USER,
+ passwd=SDC_PASSWD,
+ auth_type=rest_no_auth,
+ resource="",
+ method="GET")
+ # TODO: