From a84c8a335a496627881401400b801de859efc9cb Mon Sep 17 00:00:00 2001 From: yangyan Date: Thu, 20 Feb 2020 18:01:26 +0800 Subject: Add test scripts of F version Change-Id: Id7508c41af929e1385f5ede99fd45cf9fcb84cae Issue-ID: VFC-1621 Signed-off-by: yangyan --- .../testscripts/F-version/ns_instance/terminate.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 resources/testscripts/F-version/ns_instance/terminate.py (limited to 'resources/testscripts/F-version/ns_instance/terminate.py') diff --git a/resources/testscripts/F-version/ns_instance/terminate.py b/resources/testscripts/F-version/ns_instance/terminate.py new file mode 100644 index 00000000..9d214c8c --- /dev/null +++ b/resources/testscripts/F-version/ns_instance/terminate.py @@ -0,0 +1,19 @@ +import json +import httplib2 +import sys + +id = sys.argv[1] +data = { + "gracefulTerminationTimeout": 600, + "terminationType": "FORCEFUL" +} +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/' + id + '/terminate', + method="POST", + body=json.dumps(data), + headers=headers) +print(resp['status'], resp_content) -- cgit 1.2.3-korg