Add test scripts of F version
[vfc/nfvo/lcm.git] / resources / testscripts / F-version / ns_instance / terminate.py
1 import json
2 import httplib2
3 import sys
4
5 id = sys.argv[1]
6 data = {
7     "gracefulTerminationTimeout": 600,
8     "terminationType": "FORCEFUL"
9 }
10 headers = {'content-type': 'application/json', 'accept': 'application/json'}
11 ca_certs = None
12 auth_type = "rest_no_auth"
13 http = httplib2.Http(ca_certs=ca_certs, disable_ssl_certificate_validation=(auth_type == "rest_no_auth"))
14 http.follow_all_redirects = True
15 resp, resp_content = http.request('https://192.168.235.89:30283/api/nslcm/v1/ns/' + id + '/terminate',
16                                   method="POST",
17                                   body=json.dumps(data),
18                                   headers=headers)
19 print(resp['status'], resp_content)