Add test scripts of F version
[vfc/nfvo/lcm.git] / resources / testscripts / F-version / ns_instance / instance.py
1 import json
2 import httplib2
3 import sys
4 ns_instance_Id = sys.argv[1]
5 data = {
6     "additionalParamForNs": {
7         "sdnControllerId": "2"
8     },
9     "locationConstraints": [{
10         "vnfProfileId": "45711f40-3f43-415b-bb45-46e5c6940735",
11         "locationConstraints": {
12             "vimId": "CPE-DC_RegionOne"
13         }
14     }]
15 }
16 headers = {'content-type': 'application/json', 'accept': 'application/json'}
17 ca_certs = None
18 auth_type = "rest_no_auth"
19 http = httplib2.Http(ca_certs=ca_certs, disable_ssl_certificate_validation=(auth_type == "rest_no_auth"))
20 http.follow_all_redirects = True
21 resp, resp_content = http.request('https://192.168.235.89:30283/api/nslcm/v1/ns/' + ns_instance_Id + '/instantiate',
22                                   method="POST", body=json.dumps(data), headers=headers)
23 print(resp['status'], resp_content)