* ============LICENSE_START=======================================================
* org.onap.holmes.common.aai
* ================================================================================
- * Copyright (C) 2018-2020 Huawei. All rights reserved.
+ * Copyright (C) 2018-2021 Huawei, ZTE. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import lombok.extern.slf4j.Slf4j;
-import org.jvnet.hk2.annotations.Service;
import org.onap.holmes.common.aai.config.AaiConfig;
-import org.onap.holmes.common.exception.CorrelationException;
+import org.onap.holmes.common.config.MicroServiceConfig;
import org.onap.holmes.common.utils.JerseyClient;
+import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
import static org.onap.holmes.common.aai.AaiJsonParserUtil.*;
-@Service
@Slf4j
+@Service
public class AaiQuery4Ccvpn2 {
private Map<String, Object> headers;
private String getSiteVNFId(String siteService) {
String response = JerseyClient.newInstance()
.headers(headers)
- .path(AaiConfig.MsbConsts.AAI_SITE_RESOURCES_QUERY)
- .get(getHostAddr());
+ .path(AaiConfig.AaiConsts.AAI_SITE_RESOURCES_QUERY)
+ .get(MicroServiceConfig.getAaiAddr());
JsonObject resObj = JsonParser.parseString(response).getAsJsonObject();
JsonArray siteResources = extractJsonArray(resObj, "site-resource");
if (siteResources != null) {
private JsonObject getServiceInstanceByVnfId(String vnfId) {
String resStr = JerseyClient.newInstance()
.headers(headers)
- .path(getPath(AaiConfig.MsbConsts.AAI_SITE_VNF_QUERY,
+ .path(getPath(AaiConfig.AaiConsts.AAI_SITE_VNF_QUERY,
"vnfId", vnfId))
- .get(getHostAddr());
+ .get(MicroServiceConfig.getAaiAddr());
return getInfo(resStr, "service-instance");
}
String res = JerseyClient.newInstance()
.headers(headers)
.path(getPath(serviceInstancePath))
- .get(getHostAddr());
+ .get(MicroServiceConfig.getAaiAddr());
JsonObject instance = JsonParser.parseString(res).getAsJsonObject();
String[] params = new String[2];
Pattern pattern = Pattern.compile("/aai/v\\d+/business/customers/customer/(.+)" +