Change-Id: Ia656616853d27229b14e6b85f483d5a398a439b9
Issue-Id:VFC-327
Signed-off-by: luxin <luxin7@huawei.com>
String result = null;
String vnfPath = path.contains("%s") ? String.format(path, mgrVcmm.getRoaRand()) : path;
String result = null;
String vnfPath = path.contains("%s") ? String.format(path, mgrVcmm.getRoaRand()) : path;
- LOG.info("function=call, msg=url is {}, session is {}", vnfmObject.getString("url") + vnfPath,
- mgrVcmm.getAccessSession());
+ String oldUrl = vnfmObject.getString("url").trim();
+ String newUrl = oldUrl.replaceAll("30001", "30000");
+ LOG.info("function=call, msg=url is {}, session is {}", newUrl + vnfPath, mgrVcmm.getAccessSession());
HttpRequests.Builder builder =
HttpRequests.Builder builder =
- new HttpRequests.Builder(authModel).addHeader(Constant.ACCESSSESSION, mgrVcmm.getAccessSession())
- .setUrl(vnfmObject.getString("url"), vnfPath).setParams(paramsJson);
+ new HttpRequests.Builder(authModel).addHeader("X-Auth-Token", mgrVcmm.getAccessSession())
+ .setUrl(newUrl, vnfPath).setParams(paramsJson);
MethodType methodType = MethodType.methodType(HttpRequests.Builder.class, new Class[0]);
MethodHandle mt =
MethodHandles.lookup().findVirtual(builder.getClass(), methodName, methodType).bindTo(builder);
MethodType methodType = MethodType.methodType(HttpRequests.Builder.class, new Class[0]);
MethodHandle mt =
MethodHandles.lookup().findVirtual(builder.getClass(), methodName, methodType).bindTo(builder);
// logout delete tokens
String token = mgrVcmm.getAccessSession();
// logout delete tokens
String token = mgrVcmm.getAccessSession();
- String oldUrl = vnfmObject.getString("url").trim();
- String newUrl = oldUrl.replaceAll("30001", "30000");
String user = vnfmObject.getString("userName");
removeV3Tokens(newUrl, token, user);
} catch(IOException e) {
String user = vnfmObject.getString("userName");
removeV3Tokens(newUrl, token, user);
} catch(IOException e) {
try {
httpMethod = new HttpRequests.Builder(info.getAuthenticateMode())
.setUrl(info.getUrl(), ParamConstants.CSM_AUTH_CONNECT_SOUTH)
try {
httpMethod = new HttpRequests.Builder(info.getAuthenticateMode())
.setUrl(info.getUrl(), ParamConstants.CSM_AUTH_CONNECT_SOUTH)
- .setParams(String.format(ParamConstants.GET_TOKENS_V3, info.getUserName(), info.getUserPwd()))
+ .setParams(String.format(ParamConstants.GET_TOKENS_V3, info.getUserName(), info.getUserPwd(),
+ info.getUserName()))
.post().execute();
statusCode = httpMethod.getStatusCode();
String result = httpMethod.getResponseBodyAsString();
.post().execute();
statusCode = httpMethod.getStatusCode();
String result = httpMethod.getResponseBodyAsString();
- LOG.info("connect result:" + result);
+ LOG.info("connect statusCode={}, result={}:", statusCode, result);
if(statusCode == HttpStatus.SC_CREATED) {
if(statusCode == HttpStatus.SC_CREATED) {
- Header header = httpMethod.getResponseHeader("accessSession");
+ LOG.info("function=connectSouth, header={}.", httpMethod.getResponseHeaders());
+ Header header = httpMethod.getResponseHeader("X-Subject-Token");
+ LOG.info("function=connectSouth, header={}.", header.getValue());
setAccessSession(header.getValue());
statusCode = HttpStatus.SC_OK;
} else {
setAccessSession(header.getValue());
statusCode = HttpStatus.SC_OK;
} else {
restJson.put(Constant.RETCODE, Constant.REST_SUCCESS);
} else {
restJson.put(Constant.RETCODE, Constant.REST_SUCCESS);
} else {
- LOG.error("function=getJob, msg=send get vnf msg to csm get wrong status: {}", statusCode);
+ LOG.error("function=healVnf, msg=send heal vnf msg to csm get wrong status: {}", statusCode);