aboutsummaryrefslogtreecommitdiffstats
path: root/resources/testscripts/F-version/ns_instance/instance.py
diff options
context:
space:
mode:
authoryangyan <yangyanyj@chinamobile.com>2020-02-20 18:01:26 +0800
committeryangyan <yangyanyj@chinamobile.com>2020-02-20 20:41:43 +0800
commita84c8a335a496627881401400b801de859efc9cb (patch)
tree20640c4abee6a5331648d26a820e9d50db530880 /resources/testscripts/F-version/ns_instance/instance.py
parentb72afcc3d49ecaaa62a7e4634ac493ab446e15d5 (diff)
Add test scripts of F version
Change-Id: Id7508c41af929e1385f5ede99fd45cf9fcb84cae Issue-ID: VFC-1621 Signed-off-by: yangyan <yangyanyj@chinamobile.com>
Diffstat (limited to 'resources/testscripts/F-version/ns_instance/instance.py')
-rw-r--r--resources/testscripts/F-version/ns_instance/instance.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/resources/testscripts/F-version/ns_instance/instance.py b/resources/testscripts/F-version/ns_instance/instance.py
new file mode 100644
index 00000000..43e81e8b
--- /dev/null
+++ b/resources/testscripts/F-version/ns_instance/instance.py
@@ -0,0 +1,23 @@
+import json
+import httplib2
+import sys
+ns_instance_Id = sys.argv[1]
+data = {
+ "additionalParamForNs": {
+ "sdnControllerId": "2"
+ },
+ "locationConstraints": [{
+ "vnfProfileId": "45711f40-3f43-415b-bb45-46e5c6940735",
+ "locationConstraints": {
+ "vimId": "CPE-DC_RegionOne"
+ }
+ }]
+}
+headers = {'content-type': 'application/json', 'accept': 'application/json'}
+ca_certs = None
+auth_type = "rest_no_auth"
+http = httplib2.Http(ca_certs=ca_certs, disable_ssl_certificate_validation=(auth_type == "rest_no_auth"))
+http.follow_all_redirects = True
+resp, resp_content = http.request('https://192.168.235.89:30283/api/nslcm/v1/ns/' + ns_instance_Id + '/instantiate',
+ method="POST", body=json.dumps(data), headers=headers)
+print(resp['status'], resp_content)