32f39f5be1dc326b6632536417912f1d9e955ab7
[vfc/nfvo/lcm.git] / resources / testscripts / F-version / ns / ns_create.py
1 import json
2 import httplib2
3
4 full_url = 'https://192.168.235.89:30283/api/nsd/v1/ns_descriptors'
5 ud_data = {'userDefinedData': {"key2": "value2"}}
6 headers = {'content-type': 'application/json', 'accept': 'application/json'}
7 ca_certs = None
8 auth_type = "rest_no_auth"
9 http = httplib2.Http(ca_certs=ca_certs, disable_ssl_certificate_validation=(auth_type == "rest_no_auth"))
10 http.follow_all_redirects = True
11 resp, resp_content = http.request(full_url, method="POST", body=json.dumps(ud_data), headers=headers)
12 resp_status, resp_body = resp['status'], resp_content
13 print(resp_status, resp_body)