- msoLogger.trace("Started Execute VFC adapter Delete Process ")
- msoLogger.info("url:"+url +"\nrequestBody:"+ requestBody)
-
- APIResponse apiResponse = null
- try{
- // Get the Basic Auth credentials for the VFCAdapter, username is 'bpel', auth is '07a7159d3bf51a0e53be7a8f89699be7'
- def basicAuthHeaderValue = ""
- RESTConfig config = new RESTConfig(url)
- RESTClient client = null;
- int statusCode = 0;
-
- // user 'bepl' authHeader is the same with mso.db.auth
- String basicAuthValuedb = UrnPropertiesReader.getVariable("mso.db.auth", execution)
- msoLogger.debug("basicAuthValuedb: " + basicAuthValuedb)
-
- client = new RESTClient(config)
- client.addHeader("Accept", "application/json")
- client.addAuthorizationHeader(basicAuthValuedb)
- client.addHeader("Content-Type", "application/json")
-
- apiResponse = client.httpDelete(requestBody)
- statusCode = apiResponse.getStatusCode()
-
- msoLogger.debug("response code:"+ apiResponse.getStatusCode() +"\nresponse body:"+ apiResponse.getResponseBodyAsString())
+ logger.trace("Started Execute VFC adapter Delete Process ")
+ logger.info("url:"+url +"\nrequestBody:"+ requestBody)
+ Response r
+ try{
+
+ URL Url = new URL(url)
+ // Get the Basic Auth credentials for the VFCAdapter, username is 'bpel', auth is '07a7159d3bf51a0e53be7a8f89699be7'
+ // user 'bepl' authHeader is the same with mso.db.auth
+ String basicAuthValuedb = UrnPropertiesReader.getVariable("mso.db.auth", execution)
+ HttpClient httpClient = httpClientFactory.newJsonClient(url, ONAPComponents.VNF_ADAPTER)
+ httpClient.addAdditionalHeader("Accept", "application/json")
+ httpClient.addAdditionalHeader("Authorization", basicAuthValuedb)
+ httpClient.addAdditionalHeader("Content-Type", "application/json")
+ r = httpClient.delete(requestBody)