summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFu Jinhua <fu.jinhua@zte.com.cn>2017-09-01 09:40:33 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-01 09:40:33 +0000
commit51af25d420b6e6cab9ad6ecad26fd58ab7f145b9 (patch)
treea6e402df574fec6b126f846c8bad786f75e8da9d
parentabd2646cefce60d250f71dbbd4b37fadae8296fb (diff)
parent4cd4d43008cbacbf40939fabbaa0a3a02a0ddfc6 (diff)
Merge "Update sdc rest call logic"
-rw-r--r--lcm/pub/msapi/sdc.py23
1 files changed, 20 insertions, 3 deletions
diff --git a/lcm/pub/msapi/sdc.py b/lcm/pub/msapi/sdc.py
index b4ec1772..79a48d2a 100644
--- a/lcm/pub/msapi/sdc.py
+++ b/lcm/pub/msapi/sdc.py
@@ -26,7 +26,7 @@ ASSETTYPE_SERVICES = "services"
def call_sdc(resource, method, content=''):
additional_headers = {
- 'X-ECOMP-InstanceID': 'VFC-NFVO-LCM'
+ 'X-ECOMP-InstanceID': 'VFC'
}
return restcall.call_req(base_url=SDC_BASE_URL,
user=SDC_USER,
@@ -37,6 +37,23 @@ def call_sdc(resource, method, content=''):
content=content,
additional_headers=additional_headers)
+"""
+sample of return value
+[
+ {
+ "uuid": "c94490a0-f7ef-48be-b3f8-8d8662a37236",
+ "invariantUUID": "63eaec39-ffbe-411c-a838-448f2c73f7eb",
+ "name": "underlayvpn",
+ "version": "2.0",
+ "toscaModelURL": "/sdc/v1/catalog/resources/c94490a0-f7ef-48be-b3f8-8d8662a37236/toscaModel",
+ "category": "Volte",
+ "subCategory": "VolteVF",
+ "resourceType": "VF",
+ "lifecycleState": "CERTIFIED",
+ "lastUpdaterUserId": "jh0003"
+ }
+]
+"""
def get_artifacts(asset_type):
resource = "/sdc/v1/catalog/{assetType}"
resource = resource.format(assetType=asset_type)
@@ -63,11 +80,11 @@ def delete_artifact(asset_type, asset_id, artifact_id):
return json.JSONDecoder().decode(ret[1])
def download_artifacts(download_url, local_path):
- ret = restcall.call_req(base_url=download_url,
+ ret = restcall.call_req(base_url=SDC_BASE_URL,
user=SDC_USER,
passwd=SDC_PASSWD,
auth_type=rest_no_auth,
- resource="",
+ resource=download_url,
method="GET")
# TODO: