diff options
Diffstat (limited to 'src')
23 files changed, 155 insertions, 2615 deletions
diff --git a/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcCatalogServices.java b/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcCatalogServices.java deleted file mode 100644 index 37c62576c..000000000 --- a/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcCatalogServices.java +++ /dev/null @@ -1,1050 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP CLAMP
- * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END============================================
- * Modifications copyright (c) 2018 Nokia
- * ===================================================================
- *
- */
-
-package org.onap.clamp.clds.client.req.sdc;
-
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParseException;
-import com.google.gson.reflect.TypeToken;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.io.StringReader;
-import java.lang.reflect.Type;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.nio.charset.StandardCharsets;
-import java.security.GeneralSecurityException;
-import java.util.ArrayList;
-import java.util.Base64;
-import java.util.Collections;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.commons.codec.DecoderException;
-import org.apache.commons.csv.CSVFormat;
-import org.apache.commons.csv.CSVRecord;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.http.HttpHeaders;
-import org.onap.clamp.clds.config.ClampProperties;
-import org.onap.clamp.clds.exception.sdc.SdcCommunicationException;
-import org.onap.clamp.clds.model.CldsAlarmCondition;
-import org.onap.clamp.clds.model.CldsServiceData;
-import org.onap.clamp.clds.model.CldsVfData;
-import org.onap.clamp.clds.model.CldsVfKPIData;
-import org.onap.clamp.clds.model.CldsVfcData;
-import org.onap.clamp.clds.model.sdc.SdcResource;
-import org.onap.clamp.clds.model.sdc.SdcResourceBasicInfo;
-import org.onap.clamp.clds.model.sdc.SdcServiceDetail;
-import org.onap.clamp.clds.model.sdc.SdcServiceInfo;
-import org.onap.clamp.clds.service.CldsService;
-import org.onap.clamp.clds.util.CryptoUtils;
-import org.onap.clamp.clds.util.JsonUtils;
-import org.onap.clamp.clds.util.LoggingUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Primary;
-import org.springframework.stereotype.Component;
-
-@Component
-@Primary
-public class SdcCatalogServices {
-
- private static final EELFLogger logger = EELFManager.getInstance().getLogger(SdcCatalogServices.class);
- private static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger();
- private static final String RESOURCE_VF_TYPE = "VF";
- private static final String RESOURCE_VFC_TYPE = "VFC";
- private static final String RESOURCE_CVFC_TYPE = "CVFC";
- private static final String SDC_REQUESTID_PROPERTY_NAME = "sdc.header.requestId";
- private static final String SDC_METADATA_URL_PREFIX = "/metadata";
- private static final String SDC_INSTANCE_ID_PROPERTY_NAME = "sdc.InstanceID";
- private static final String SDC_CATALOG_URL_PROPERTY_NAME = "sdc.catalog.url";
- private static final String SDC_SERVICE_URL_PROPERTY_NAME = "sdc.serviceUrl";
- private static final String SDC_INSTANCE_ID_CLAMP = "CLAMP-Tool";
- private static final String RESOURCE_URL_PREFIX = "resources";
- private static final LoggingUtils utils = new LoggingUtils(logger);
-
- private static final Type LIST_SDC_SERVICE_INFO_TYPE = new TypeToken<List<SdcServiceInfo>>() {
- }.getType();
-
- private static final Type LIST_SDC_RESOURCE_BASIC_INFO_TYPE = new TypeToken<List<SdcResourceBasicInfo>>() {
- }.getType();
-
- @Autowired
- private ClampProperties refProp;
-
- /**
- * Return SDC id and pw as a HTTP Basic Auth string (for example: Basic
- * dGVzdDoxMjM0NTY=).
- *
- * @return The String with Basic Auth and password
- * @throws GeneralSecurityException
- * In case of issue when decryting the SDC password
- * @throws DecoderException
- * In case of issues with the decoding of the HexString message
- */
- public String getSdcBasicAuth() throws GeneralSecurityException, DecoderException {
- String sdcId = refProp.getStringValue("sdc.serviceUsername");
- String sdcPw = refProp.getStringValue("sdc.servicePassword");
- String password = CryptoUtils.decrypt(sdcPw);
- String idPw = Base64.getEncoder().encodeToString((sdcId + ":" + password).getBytes(StandardCharsets.UTF_8));
- return "Basic " + idPw;
- }
-
- /**
- * This method get the SDC services Information with the corresponding Service
- * UUID.
- *
- * @param uuid
- * The service UUID
- * @return A Json String with all the service list
- * @throws GeneralSecurityException
- * In case of issue when decryting the SDC password
- * @throws DecoderException
- * In case of issues with the decoding of the Hex String
- */
- public String getSdcServicesInformation(String uuid) throws GeneralSecurityException, DecoderException {
- Date startTime = new Date();
- String baseUrl = refProp.getStringValue(SDC_SERVICE_URL_PROPERTY_NAME);
- String basicAuth = getSdcBasicAuth();
- try {
- String url = baseUrl;
- if (uuid != null && !uuid.isEmpty()) {
- url = baseUrl + "/" + uuid + SDC_METADATA_URL_PREFIX;
- }
- URL urlObj = new URL(url);
- HttpURLConnection conn = (HttpURLConnection) urlObj.openConnection();
- conn = utils.invoke(conn, "SDC", "getSdcServicesInformation");
- conn.setRequestProperty(refProp.getStringValue(SDC_INSTANCE_ID_PROPERTY_NAME), SDC_INSTANCE_ID_CLAMP);
- conn.setRequestProperty(HttpHeaders.AUTHORIZATION, basicAuth);
- conn.setRequestProperty(HttpHeaders.CONTENT_TYPE, "application/json;charset=UTF-8");
- conn.setRequestProperty(refProp.getStringValue(SDC_REQUESTID_PROPERTY_NAME), LoggingUtils.getRequestId());
- conn.setRequestMethod("GET");
- String resp = getResponse(conn);
- logger.debug("Services list received from SDC:" + resp);
- utils.invokeReturn();
- return resp;
- } catch (IOException e) {
- LoggingUtils.setResponseContext("900", "Get sdc services failed", this.getClass().getName());
- LoggingUtils.setErrorContext("900", "Get sdc services error");
- logger.error("not able to get any service information from sdc for uuid:" + uuid, e);
- } finally {
- LoggingUtils.setTimeContext(startTime, new Date());
- metricsLogger.info("getSdcServicesInformation complete");
- }
- utils.invokeReturn();
- return "";
- }
-
- /**
- * To remove duplicate serviceUUIDs from sdc services List.
- *
- * @param rawCldsSdcServiceList
- * A list of CldsSdcServiceInfo
- * @return A list of CldsSdcServiceInfo without duplicate service UUID
- */
- public List<SdcServiceInfo> removeDuplicateServices(List<SdcServiceInfo> rawCldsSdcServiceList) {
- List<SdcServiceInfo> cldsSdcServiceInfoList = null;
- if (rawCldsSdcServiceList != null && !rawCldsSdcServiceList.isEmpty()) {
- // sort list
- Collections.sort(rawCldsSdcServiceList);
- // and then take only the services with the max version (last in the
- // list with the same name)
- cldsSdcServiceInfoList = new ArrayList<>();
- for (int i = 1; i < rawCldsSdcServiceList.size(); i++) {
- // compare name with previous - if not equal, then keep the
- // previous (it's the last with that name)
- SdcServiceInfo prev = rawCldsSdcServiceList.get(i - 1);
- if (!rawCldsSdcServiceList.get(i).getName().equals(prev.getName())) {
- cldsSdcServiceInfoList.add(prev);
- }
- }
- // add the last in the list
- cldsSdcServiceInfoList.add(rawCldsSdcServiceList.get(rawCldsSdcServiceList.size() - 1));
- }
- return cldsSdcServiceInfoList;
- }
-
- /**
- * To remove duplicate serviceUUIDs from sdc resources List.
- *
- * @param rawCldsSdcResourceList
- * @return List of CldsSdcResource
- */
- public List<SdcResource> removeDuplicateSdcResourceInstances(List<SdcResource> rawCldsSdcResourceList) {
- List<SdcResource> cldsSdcResourceList = null;
- if (rawCldsSdcResourceList != null && !rawCldsSdcResourceList.isEmpty()) {
- // sort list
- Collections.sort(rawCldsSdcResourceList);
- // and then take only the resources with the max version (last in
- // the list with the same name)
- cldsSdcResourceList = new ArrayList<>();
- for (int i = 1; i < rawCldsSdcResourceList.size(); i++) {
- // compare name with previous - if not equal, then keep the
- // previous (it's the last with that name)
- SdcResource prev = rawCldsSdcResourceList.get(i - 1);
- if (!rawCldsSdcResourceList.get(i).getResourceInstanceName().equals(prev.getResourceInstanceName())) {
- cldsSdcResourceList.add(prev);
- }
- }
- // add the last in the list
- cldsSdcResourceList.add(rawCldsSdcResourceList.get(rawCldsSdcResourceList.size() - 1));
- }
- return cldsSdcResourceList;
- }
-
- /**
- * To remove duplicate basic resources with same resourceUUIDs.
- *
- * @param rawCldsSdcResourceListBasicList
- * @return List of CldsSdcResourceBasicInfo
- */
- public List<SdcResourceBasicInfo> removeDuplicateSdcResourceBasicInfo(
- List<SdcResourceBasicInfo> rawCldsSdcResourceListBasicList) {
- List<SdcResourceBasicInfo> cldsSdcResourceBasicInfoList = new ArrayList<>();
- if (rawCldsSdcResourceListBasicList != null && !rawCldsSdcResourceListBasicList.isEmpty()) {
- // sort list
- Collections.sort(rawCldsSdcResourceListBasicList);
- // and then take only the resources with the max version (last in
- // the list with the same name)
- for (int i = 1; i < rawCldsSdcResourceListBasicList.size(); i++) {
- // compare name with previous - if not equal, then keep the
- // previous (it's the last with that name)
- SdcResourceBasicInfo prev = rawCldsSdcResourceListBasicList.get(i - 1);
- if (!rawCldsSdcResourceListBasicList.get(i).getName().equals(prev.getName())) {
- cldsSdcResourceBasicInfoList.add(prev);
- }
- }
- // add the last in the list
- cldsSdcResourceBasicInfoList
- .add(rawCldsSdcResourceListBasicList.get(rawCldsSdcResourceListBasicList.size() - 1));
- }
- return cldsSdcResourceBasicInfoList;
- }
-
- /**
- * To get ServiceUUID by using serviceInvariantUUID.
- *
- * @param invariantId
- * The invariant ID
- * @return The service UUID
- * @throws GeneralSecurityException
- * In case of issue when decryting the SDC password
- * @throws DecoderException
- * In case of issues with the decoding of the Hex String
- */
- public String getServiceUuidFromServiceInvariantId(String invariantId)
- throws GeneralSecurityException, DecoderException {
- String serviceUuid = "";
- String responseStr = getSdcServicesInformation(null);
- List<SdcServiceInfo> rawCldsSdcServicesList = getCldsSdcServicesListFromJson(responseStr);
- List<SdcServiceInfo> cldsSdcServicesList = removeDuplicateServices(rawCldsSdcServicesList);
- if (cldsSdcServicesList != null && !cldsSdcServicesList.isEmpty()) {
- for (SdcServiceInfo currCldsSdcServiceInfo : cldsSdcServicesList) {
- if (currCldsSdcServiceInfo != null && currCldsSdcServiceInfo.getInvariantUUID() != null
- && currCldsSdcServiceInfo.getInvariantUUID().equalsIgnoreCase(invariantId)) {
- serviceUuid = currCldsSdcServiceInfo.getUuid();
- break;
- }
- }
- }
- return serviceUuid;
- }
-
- /**
- * To get CldsAsdsServiceInfo class by parsing json string.
- *
- * @param jsonStr
- * The Json string that must be decoded
- * @return The list of CldsSdcServiceInfo, if there is a failure it return an
- * empty list
- */
- private List<SdcServiceInfo> getCldsSdcServicesListFromJson(String jsonStr) {
- if (StringUtils.isBlank(jsonStr)) {
- return new ArrayList<>();
- }
- try {
- return JsonUtils.GSON.fromJson(jsonStr, LIST_SDC_SERVICE_INFO_TYPE);
- } catch (JsonParseException e) {
- logger.error("Error when attempting to decode the JSON containing CldsSdcServiceInfo", e);
- return new ArrayList<>();
- }
- }
-
- /**
- * To get List of CldsSdcResourceBasicInfo class by parsing json string.
- *
- * @param jsonStr
- * The JSOn string that must be decoded
- * @return The list of CldsSdcResourceBasicInfo, an empty list in case of issues
- */
- private List<SdcResourceBasicInfo> getAllSdcResourcesListFromJson(String jsonStr) {
- if (StringUtils.isBlank(jsonStr)) {
- return new ArrayList<>();
- }
- try {
- return JsonUtils.GSON.fromJson(jsonStr, LIST_SDC_RESOURCE_BASIC_INFO_TYPE);
- } catch (JsonParseException e) {
- logger.error("Exception occurred when attempting to decode the list of CldsSdcResourceBasicInfo JSON", e);
- return new ArrayList<>();
- }
- }
-
- /**
- * To get CldsSdcServiceDetail by parsing json string.
- *
- * @param jsonStr
- * @return
- */
- public SdcServiceDetail decodeCldsSdcServiceDetailFromJson(String jsonStr) {
- try {
- return JsonUtils.GSON.fromJson(jsonStr, SdcServiceDetail.class);
- } catch (JsonParseException e) {
- logger.error("Exception when attempting to decode the CldsSdcServiceDetail JSON", e);
- return null;
- }
- }
-
- public String getResponse(HttpURLConnection conn) {
- try (InputStream is = getInputStream(conn)) {
- try (BufferedReader in = new BufferedReader(new InputStreamReader(is))) {
- return IOUtils.toString(in);
- }
- } catch (IOException e) {
- logger.error("Exception when attempting to open SDC response", e);
- throw new SdcCommunicationException("Exception when attempting to open SDC response", e);
- }
- }
-
- private InputStream getInputStream(HttpURLConnection conn) {
- try {
- InputStream inStream = conn.getErrorStream();
- if (inStream == null) {
- inStream = conn.getInputStream();
- }
- return inStream;
- } catch (IOException e) {
- logger.error("Exception when attempting to open SDC error stream", e);
- throw new SdcCommunicationException("Exception when attempting to open SDC error stream", e);
- }
- }
-
- /**
- * Check if the SDC Info in cache has expired.
- *
- * @param cldsServiceData
- * The object representing the service data
- * @return boolean flag
- * @throws GeneralSecurityException
- * In case of issues with the decryting the encrypted password
- * @throws DecoderException
- * In case of issues with the decoding of the Hex String
- */
- public boolean isCldsSdcCacheDataExpired(CldsServiceData cldsServiceData)
- throws GeneralSecurityException, DecoderException {
- if (cldsServiceData != null && cldsServiceData.getServiceUUID() != null) {
- String cachedServiceUuid = cldsServiceData.getServiceUUID();
- String latestServiceUuid = getServiceUuidFromServiceInvariantId(cldsServiceData.getServiceInvariantUUID());
- String configuredMaxAge = refProp.getStringValue("clds.service.cache.invalidate.after.seconds");
- if (configuredMaxAge == null) {
- logger.warn(
- "clds.service.cache.invalidate.after.seconds NOT set in clds-reference.properties file, taking 60s as default");
- configuredMaxAge = "60";
- }
- return (!cachedServiceUuid.equalsIgnoreCase(latestServiceUuid)) || (cldsServiceData.getAgeOfRecord() != null
- && cldsServiceData.getAgeOfRecord() > Long.parseLong(configuredMaxAge));
- } else {
- return true;
- }
- }
-
- /**
- * Get the Service Data with Alarm Conditions for a given invariantServiceUuid.
- *
- * @param invariantServiceUuid
- * @return The CldsServiceData
- * @throws GeneralSecurityException
- * In case of issues with the decryting the encrypted password
- * @throws DecoderException
- * In case of issues with the decoding of the Hex String
- */
- public CldsServiceData getCldsServiceDataWithAlarmConditions(String invariantServiceUuid)
- throws GeneralSecurityException, DecoderException {
- String url = refProp.getStringValue(SDC_SERVICE_URL_PROPERTY_NAME);
- String catalogUrl = refProp.getStringValue(SDC_CATALOG_URL_PROPERTY_NAME);
- String serviceUuid = getServiceUuidFromServiceInvariantId(invariantServiceUuid);
- String serviceDetailUrl = url + "/" + serviceUuid + SDC_METADATA_URL_PREFIX;
- String responseStr = getCldsServicesOrResourcesBasedOnURL(serviceDetailUrl);
- CldsServiceData cldsServiceData = new CldsServiceData();
- if (responseStr != null) {
- SdcServiceDetail cldsSdcServiceDetail;
- try {
- cldsSdcServiceDetail = JsonUtils.GSON.fromJson(responseStr, SdcServiceDetail.class);
- } catch (JsonParseException e) {
- logger.error("Exception when decoding the CldsServiceData JSON from SDC", e);
- throw new SdcCommunicationException("Exception when decoding the CldsServiceData JSON from SDC", e);
- }
- // To remove duplicate resources from serviceDetail and add valid
- // vfs to service
- if (cldsSdcServiceDetail != null && cldsSdcServiceDetail.getResources() != null) {
- cldsServiceData.setServiceUUID(cldsSdcServiceDetail.getUuid());
- cldsServiceData.setServiceInvariantUUID(cldsSdcServiceDetail.getInvariantUUID());
- List<SdcResource> cldsSdcResourceList = removeDuplicateSdcResourceInstances(
- cldsSdcServiceDetail.getResources());
- if (cldsSdcResourceList != null && !cldsSdcResourceList.isEmpty()) {
- List<CldsVfData> cldsVfDataList = new ArrayList<>();
- for (SdcResource currCldsSdcResource : cldsSdcResourceList) {
- if (currCldsSdcResource != null && currCldsSdcResource.getResoucreType() != null
- && "VF".equalsIgnoreCase(currCldsSdcResource.getResoucreType())) {
- CldsVfData currCldsVfData = new CldsVfData();
- currCldsVfData.setVfName(currCldsSdcResource.getResourceInstanceName());
- currCldsVfData.setVfInvariantResourceUUID(currCldsSdcResource.getResourceInvariantUUID());
- cldsVfDataList.add(currCldsVfData);
- }
- }
- cldsServiceData.setCldsVfs(cldsVfDataList);
- // For each vf in the list , add all vfc's
- getAllVfcForVfList(cldsVfDataList, catalogUrl);
- logger.info("Invariant Service ID of cldsServiceData:" + cldsServiceData.getServiceInvariantUUID());
- }
- }
- }
- return cldsServiceData;
- }
-
- private void getAllVfcForVfList(List<CldsVfData> cldsVfDataList, String catalogUrl)
- throws GeneralSecurityException {
- // todo : refact this..
- if (cldsVfDataList != null && !cldsVfDataList.isEmpty()) {
- List<SdcResourceBasicInfo> allVfResources = getAllSdcVForVfcResourcesBasedOnResourceType(RESOURCE_VF_TYPE);
- List<SdcResourceBasicInfo> allVfcResources = getAllSdcVForVfcResourcesBasedOnResourceType(
- RESOURCE_VFC_TYPE);
- allVfcResources.addAll(getAllSdcVForVfcResourcesBasedOnResourceType(RESOURCE_CVFC_TYPE));
- for (CldsVfData currCldsVfData : cldsVfDataList) {
- if (currCldsVfData != null && currCldsVfData.getVfInvariantResourceUUID() != null) {
- String resourceUuid = getResourceUuidFromResourceInvariantUuid(
- currCldsVfData.getVfInvariantResourceUUID(), allVfResources);
- if (resourceUuid != null) {
- String vfResourceUuidUrl = catalogUrl + RESOURCE_URL_PREFIX + "/" + resourceUuid
- + SDC_METADATA_URL_PREFIX;
- String vfResponse = getCldsServicesOrResourcesBasedOnURL(vfResourceUuidUrl);
- if (vfResponse != null) {
- // Below 2 line are to get the KPI(field path) data
- // associated with the VF's
- List<CldsVfKPIData> cldsVfKPIDataList = getFieldPathFromVF(vfResponse);
- currCldsVfData.setCldsKPIList(cldsVfKPIDataList);
- List<CldsVfcData> vfcDataListFromVfResponse = getVfcDataListFromVfResponse(vfResponse);
- if (vfcDataListFromVfResponse != null) {
- currCldsVfData.setCldsVfcs(vfcDataListFromVfResponse);
- if (!vfcDataListFromVfResponse.isEmpty()) {
- // To get artifacts for every VFC and get
- // alarm conditions from artifact
- for (CldsVfcData currCldsVfcData : vfcDataListFromVfResponse) {
- if (currCldsVfcData != null
- && currCldsVfcData.getVfcInvariantResourceUUID() != null) {
- String resourceVfcUuid = getResourceUuidFromResourceInvariantUuid(
- currCldsVfcData.getVfcInvariantResourceUUID(), allVfcResources);
- if (resourceVfcUuid != null) {
- String vfcResourceUuidUrl = catalogUrl + RESOURCE_URL_PREFIX + "/"
- + resourceVfcUuid + SDC_METADATA_URL_PREFIX;
- String vfcResponse = getCldsServicesOrResourcesBasedOnURL(
- vfcResourceUuidUrl);
- if (vfcResponse != null) {
- List<CldsAlarmCondition> alarmCondtionsFromVfc = getAlarmCondtionsFromVfc(
- vfcResponse);
- currCldsVfcData.setCldsAlarmConditions(alarmCondtionsFromVfc);
- }
- } else {
- logger.info("No resourceVFC UUID found for given invariantID:"
- + currCldsVfcData.getVfcInvariantResourceUUID());
- }
- }
- }
- }
- }
- }
- } else {
- logger.info("No resourceUUID found for given invariantREsourceUUID:"
- + currCldsVfData.getVfInvariantResourceUUID());
- }
- }
- }
- }
- }
-
- private List<CldsVfcData> getVfcDataListFromVfResponse(String vfResponse) {
- JsonObject vfResponseNode;
- try {
- vfResponseNode = JsonUtils.GSON.fromJson(vfResponse, JsonObject.class);
- } catch (JsonParseException e) {
- logger.error("Exception when decoding the JSON list of CldsVfcData", e);
- return new ArrayList<>();
- }
- JsonArray vfcArrayNode = vfResponseNode.get("resources").getAsJsonArray();
- List<CldsVfcData> cldsVfcDataList = new ArrayList<>();
- if (vfcArrayNode != null) {
- for (JsonElement vfcjsonNode : vfcArrayNode) {
- JsonObject currVfcNode = vfcjsonNode.getAsJsonObject();
- JsonElement resourceTypeNode = currVfcNode.get("resoucreType");
- if (resourceTypeNode != null && resourceTypeNode.isJsonPrimitive()) {
- if ("VFC".equalsIgnoreCase(resourceTypeNode.getAsString())) {
- handleVFCtypeNode(currVfcNode, cldsVfcDataList);
- } else if ("CVFC".equalsIgnoreCase(resourceTypeNode.getAsString())) {
- handleCVFCtypeNode(currVfcNode, cldsVfcDataList);
- }
- }
- }
- }
- return cldsVfcDataList;
- }
-
- private void handleVFCtypeNode(JsonObject currVfcNode, List<CldsVfcData> cldsVfcDataList) {
- CldsVfcData currCldsVfcData = new CldsVfcData();
- String vfcResourceName = currVfcNode.get("resourceInstanceName").getAsString();
- String vfcInvariantResourceUuid = currVfcNode.get("resourceInvariantUUID").getAsString();
- currCldsVfcData.setVfcName(vfcResourceName);
- currCldsVfcData.setVfcInvariantResourceUUID(vfcInvariantResourceUuid);
- cldsVfcDataList.add(currCldsVfcData);
- }
-
- private void handleCVFCtypeNode(JsonObject currVfcNode, List<CldsVfcData> cldsVfcDataList) {
- handleVFCtypeNode(currVfcNode, cldsVfcDataList);
- cldsVfcDataList.addAll(getVFCfromCVFC(currVfcNode.get("resourceUUID").getAsString()));
- }
-
- private List<CldsVfcData> getVFCfromCVFC(String resourceUUID) {
- String catalogUrl = refProp.getStringValue(SDC_CATALOG_URL_PROPERTY_NAME);
- List<CldsVfcData> cldsVfcDataList = new ArrayList<>();
- if (resourceUUID != null) {
- String vfcResourceUUIDUrl = catalogUrl + RESOURCE_URL_PREFIX + "/" + resourceUUID + SDC_METADATA_URL_PREFIX;
- try {
- String vfcResponse = getCldsServicesOrResourcesBasedOnURL(vfcResourceUUIDUrl);
- JsonObject vfResponseNode = JsonUtils.GSON.fromJson(vfcResponse, JsonObject.class);
- JsonArray vfcArrayNode = vfResponseNode.get("resources").getAsJsonArray();
- if (vfcArrayNode != null) {
- for (JsonElement vfcjsonNode : vfcArrayNode) {
- JsonObject currVfcNode = vfcjsonNode.getAsJsonObject();
- JsonElement resourceTypeNode = currVfcNode.get("resoucreType");
- if (resourceTypeNode != null && resourceTypeNode.isJsonPrimitive() && "VFC".equalsIgnoreCase(resourceTypeNode.getAsString())) {
- handleVFCtypeNode(currVfcNode, cldsVfcDataList);
- }
- }
- }
- } catch (JsonParseException e) {
- logger.error("Exception during JSON analyzis", e);
- }
- }
- return cldsVfcDataList;
- }
-
- private String removeUnwantedBracesFromString(String id) {
- return (id != null) ? id.replaceAll("\"", "") : "";
- }
-
- private List<CldsAlarmCondition> getAlarmCondtionsFromVfc(String vfcResponse) throws GeneralSecurityException {
- List<CldsAlarmCondition> cldsAlarmConditionList = new ArrayList<>();
- JsonObject vfcResponseNode;
- try {
- vfcResponseNode = JsonUtils.GSON.fromJson(vfcResponse, JsonObject.class);
- } catch (JsonParseException e) {
- logger.error("Exception when decoding the JSON list of CldsAlarmCondition", e);
- return cldsAlarmConditionList;
- }
- JsonElement artifactsNode = vfcResponseNode.get("artifacts");
- if (artifactsNode != null && artifactsNode.isJsonArray() && artifactsNode.getAsJsonArray().size() > 0) {
- JsonArray artifactsList = artifactsNode.getAsJsonArray();
- for (int index = 0; index < artifactsList.size(); index++) {
- JsonObject currArtifactNode = artifactsList.get(index).getAsJsonObject();
- JsonElement artifactUrlNode = currArtifactNode.get("artifactURL");
- if (artifactUrlNode != null && artifactUrlNode.isJsonPrimitive()) {
- String responsesFromArtifactUrl = getResponsesFromArtifactUrl(artifactUrlNode.getAsString());
- cldsAlarmConditionList.addAll(parseCsvToGetAlarmConditions(responsesFromArtifactUrl));
- logger.info(responsesFromArtifactUrl);
- }
- }
- }
- return cldsAlarmConditionList;
- }
-
- private List<CldsAlarmCondition> parseCsvToGetAlarmConditions(String allAlarmCondsValues) {
- try {
- List<CldsAlarmCondition> cldsAlarmConditionList = new ArrayList<>();
- Reader alarmReader = new StringReader(allAlarmCondsValues);
- Iterable<CSVRecord> records = CSVFormat.RFC4180.parse(alarmReader);
- if (records != null) {
- Iterator<CSVRecord> it = records.iterator();
- if (it.hasNext()) {
- it.next();
- }
- it.forEachRemaining(record -> processRecord(cldsAlarmConditionList, record));
- }
- return cldsAlarmConditionList;
- } catch (IOException e) {
- logger.error("Exception when attempting to parse the CSV containing the alarm", e);
- return new ArrayList<>();
- }
- }
-
- // Method to get the artifact for any particular VF
- private List<CldsVfKPIData> getFieldPathFromVF(String vfResponse) throws GeneralSecurityException {
- List<CldsVfKPIData> cldsVfKPIDataList = new ArrayList<>();
- JsonObject vfResponseNode;
- try {
- vfResponseNode = JsonUtils.GSON.fromJson(vfResponse, JsonObject.class);
- } catch (JsonParseException e) {
- logger.error("Exception when decoding the JSON list of CldsVfKPIData", e);
- return cldsVfKPIDataList;
- }
- JsonArray artifactsArrayNode = vfResponseNode.get("artifacts").getAsJsonArray();
- if (artifactsArrayNode != null && artifactsArrayNode.size() > 0) {
- for (int index = 0; index < artifactsArrayNode.size(); index++) {
- JsonObject currArtifactNode = artifactsArrayNode.get(index).getAsJsonObject();
- JsonElement artifactUrlNode = currArtifactNode.get("artifactURL");
- JsonElement artifactNameNode = currArtifactNode.get("artifactName");
- String artifactName = "";
- if (artifactNameNode != null) {
- artifactName = artifactNameNode.getAsString();
- artifactName = artifactName.substring(artifactName.lastIndexOf('.') + 1);
- }
- if (artifactUrlNode != null && "csv".equalsIgnoreCase(artifactName)) {
- String responsesFromArtifactUrl = getResponsesFromArtifactUrl(artifactUrlNode.getAsString());
- cldsVfKPIDataList.addAll(parseCsvToGetFieldPath(responsesFromArtifactUrl));
- logger.info(responsesFromArtifactUrl);
- }
- }
- }
- return cldsVfKPIDataList;
- }
-
- private CldsVfKPIData convertCsvRecordToKpiData(CSVRecord record) {
- if (record.size() < 6) {
- logger.debug("invalid csv field path Record,total columns less than 6: " + record);
- return null;
- }
- if (StringUtils.isBlank(record.get(1)) || StringUtils.isBlank(record.get(3))
- || StringUtils.isBlank(record.get(5))) {
- logger.debug("Invalid csv field path Record,one of column is having blank value : " + record);
- return null;
- }
- CldsVfKPIData cldsVfKPIData = new CldsVfKPIData();
- cldsVfKPIData.setNfNamingCode(record.get(0).trim());
- cldsVfKPIData.setNfNamingValue(record.get(1).trim());
- cldsVfKPIData.setFieldPath(record.get(2).trim());
- cldsVfKPIData.setFieldPathValue(record.get(3).trim());
- cldsVfKPIData.setThresholdName(record.get(4).trim());
- cldsVfKPIData.setThresholdValue(record.get(5).trim());
- return cldsVfKPIData;
- }
-
- // Method to get the artifactURL Data and set the CldsVfKPIData node
- private List<CldsVfKPIData> parseCsvToGetFieldPath(String allFieldPathValues) {
- try {
- List<CldsVfKPIData> cldsVfKPIDataList = new ArrayList<>();
- Reader alarmReader = new StringReader(allFieldPathValues);
- Iterable<CSVRecord> records = CSVFormat.RFC4180.parse(alarmReader);
- if (records != null) {
- for (CSVRecord record : records) {
- CldsVfKPIData kpiData = this.convertCsvRecordToKpiData(record);
- if (kpiData != null) {
- cldsVfKPIDataList.add(kpiData);
- }
- }
- }
- return cldsVfKPIDataList;
- } catch (IOException e) {
- logger.error("Exception when attempting to parse the CSV containing the alarm kpi data", e);
- return new ArrayList<>();
- }
- }
-
- private void processRecord(List<CldsAlarmCondition> cldsAlarmConditionList, CSVRecord record) {
- if (record == null) {
- return;
- }
- if (record.size() < 5) {
- logger.debug("invalid csv alarm Record,total columns less than 5: " + record);
- return;
- }
- if (StringUtils.isBlank(record.get(1)) || StringUtils.isBlank(record.get(3))
- || StringUtils.isBlank(record.get(4))) {
- logger.debug("invalid csv alarm Record,one of column is having blank value : " + record);
- return;
- }
- CldsAlarmCondition cldsAlarmCondition = new CldsAlarmCondition();
- cldsAlarmCondition.setEventSourceType(record.get(1));
- cldsAlarmCondition.setEventName(record.get(2));
- cldsAlarmCondition.setAlarmConditionKey(record.get(3));
- cldsAlarmCondition.setSeverity(record.get(4));
- cldsAlarmConditionList.add(cldsAlarmCondition);
- }
-
- // Get the responses for the current artifact from the artifacts URL.
- private String getResponsesFromArtifactUrl(String artifactsUrl) {
- String hostUrl = refProp.getStringValue("sdc.hostUrl");
- String artifactsUrlReworked = artifactsUrl.replaceAll("\"", "");
- String artifactUrl = hostUrl + artifactsUrlReworked;
- logger.info("value of artifactURl:" + artifactUrl);
- String currArtifactResponse = getCldsServicesOrResourcesBasedOnURL(artifactUrl);
- logger.info("value of artifactResponse:" + currArtifactResponse);
- return currArtifactResponse;
- }
-
- /**
- * Service to services/resources/artifacts from sdc.Pass alarmConditions as true
- * to get alarm conditons from artifact url and else it is false
- *
- * @param url
- * The URL to trigger
- * @return The String containing the payload
- */
- public String getCldsServicesOrResourcesBasedOnURL(String url) {
- Date startTime = new Date();
- try {
- LoggingUtils.setTargetContext("SDC", "getCldsServicesOrResourcesBasedOnURL");
- String urlReworked = removeUnwantedBracesFromString(url);
- URL urlObj = new URL(urlReworked);
- HttpURLConnection conn = (HttpURLConnection) urlObj.openConnection();
- conn = utils.invoke(conn, "SDC", "getSdcResources");
- String basicAuth = getSdcBasicAuth();
- conn.setRequestProperty(refProp.getStringValue(SDC_INSTANCE_ID_PROPERTY_NAME), SDC_INSTANCE_ID_CLAMP);
- conn.setRequestProperty(HttpHeaders.AUTHORIZATION, basicAuth);
- conn.setRequestProperty(HttpHeaders.CONTENT_TYPE, "application/json;charset=UTF-8");
- conn.setRequestProperty(refProp.getStringValue(SDC_REQUESTID_PROPERTY_NAME), LoggingUtils.getRequestId());
- conn.setRequestMethod("GET");
- int responseCode = conn.getResponseCode();
- logger.info("Sdc resource url - " + urlReworked + " , responseCode=" + responseCode);
- try (BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()))) {
- String response = IOUtils.toString(in);
- return response;
- }
- } catch (IOException e) {
- LoggingUtils.setErrorContext("900", "Get sdc resources error");
- logger.error("Exception occurred during query to SDC", e);
- return "";
- } catch (DecoderException e) {
- LoggingUtils.setErrorContext("900", "Get sdc resources error");
- logger.error("Exception when attempting to decode the Hex string", e);
- throw new SdcCommunicationException("Exception when attempting to decode the Hex string", e);
- } catch (GeneralSecurityException e) {
- LoggingUtils.setErrorContext("900", "Get sdc resources error");
- logger.error("Exception when attempting to decrypt the encrypted password", e);
- throw new SdcCommunicationException("Exception when attempting to decrypt the encrypted password", e);
- } finally {
- LoggingUtils.setTimeContext(startTime, new Date());
- metricsLogger.info("getCldsServicesOrResourcesBasedOnURL completed");
- utils.invokeReturn();
- }
- }
-
- /**
- * To create properties object by using cldsServicedata.
- *
- * @throws IOException In case of issues during the parsing of the Global Properties
- */
- public String createPropertiesObjectByUUID(CldsServiceData cldsServiceData) throws IOException {
- String totalPropsStr;
- JsonObject globalPropsJson = refProp.getJsonTemplate(CldsService.GLOBAL_PROPERTIES_KEY).getAsJsonObject();
- if (cldsServiceData != null && cldsServiceData.getServiceUUID() != null) {
- // Objectnode to save all byservice, byvf , byvfc and byalarm nodes
- JsonObject byIdObjectNode = new JsonObject();
- // To create vf ResourceUUID node with serviceInvariantUUID
- JsonObject invariantUuidObjectNodeWithVf = createVfObjectNodeByServiceInvariantUuid(cldsServiceData);
- byIdObjectNode.add("byService", invariantUuidObjectNodeWithVf);
- // To create byVf and vfcResourceNode with vfResourceUUID
- JsonObject vfcObjectNodeByVfUuid = createVfcObjectNodeByVfUuid(cldsServiceData.getCldsVfs());
- byIdObjectNode.add("byVf", vfcObjectNodeByVfUuid);
- // To create byKpi
- JsonObject kpiJsonObject = new JsonObject();
- if (cldsServiceData.getCldsVfs() != null && !cldsServiceData.getCldsVfs().isEmpty()) {
- for (CldsVfData currCldsVfData : cldsServiceData.getCldsVfs()) {
- if (currCldsVfData != null) {
- createKpiObjectNodeByVfUuid(kpiJsonObject, currCldsVfData.getCldsKPIList());
- }
- }
- }
- byIdObjectNode.add("byKpi", kpiJsonObject);
- // To create byVfc and alarmCondition with vfcResourceUUID
- JsonObject vfcResourceUuidObjectNode = new JsonObject();
- if (cldsServiceData.getCldsVfs() != null && !cldsServiceData.getCldsVfs().isEmpty()) {
- for (CldsVfData currCldsVfData : cldsServiceData.getCldsVfs()) {
- if (currCldsVfData != null) {
- createAlarmCondObjectNodeByVfcUuid(vfcResourceUuidObjectNode, currCldsVfData.getCldsVfcs());
- }
- }
- }
- byIdObjectNode.add("byVfc", vfcResourceUuidObjectNode);
- // To create byAlarmCondition with alarmConditionKey
- List<CldsAlarmCondition> allAlarmConditions = getAllAlarmConditionsFromCldsServiceData(cldsServiceData,
- "alarmCondition");
- JsonObject alarmCondObjectNodeByAlarmKey = createAlarmCondObjectNodeByAlarmKey(allAlarmConditions);
- byIdObjectNode.add("byAlarmCondition", alarmCondObjectNodeByAlarmKey);
- // To create byAlertDescription with AlertDescription
- List<CldsAlarmCondition> allAlertDescriptions = getAllAlarmConditionsFromCldsServiceData(cldsServiceData,
- "alertDescription");
- JsonObject alertDescObjectNodeByAlert = createAlarmCondObjectNodeByAlarmKey(allAlertDescriptions);
- byIdObjectNode.add("byAlertDescription", alertDescObjectNodeByAlert);
- globalPropsJson.add("shared", byIdObjectNode);
- logger.info("Global properties JSON created with SDC info:" + globalPropsJson);
- }
- totalPropsStr = globalPropsJson.toString();
- return totalPropsStr;
- }
-
- /**
- * Method to get alarm conditions/alert description from Service Data.
- *
- * @param cldsServiceData
- * CldsServiceData the Service Data to analyze
- * @param eventName
- * The String event name that will be used to filter the alarm list
- * @return The list of CldsAlarmCondition for the event name specified
- */
- public List<CldsAlarmCondition> getAllAlarmConditionsFromCldsServiceData(CldsServiceData cldsServiceData,
- String eventName) {
- List<CldsAlarmCondition> alarmCondList = new ArrayList<>();
- if (cldsServiceData != null && cldsServiceData.getCldsVfs() != null
- && !cldsServiceData.getCldsVfs().isEmpty()) {
- for (CldsVfData currCldsVfData : cldsServiceData.getCldsVfs()) {
- alarmCondList.addAll(getAllAlarmConditionsFromCldsVfData(currCldsVfData, eventName));
- }
- }
- return alarmCondList;
- }
-
- /**
- * Method to get alarm conditions/alert description from VF Data.
- *
- * @param currCldsVfData
- * The Vf Data to analyze
- * @param eventName
- * The String event name that will be used to filter the alarm list
- * @return The list of CldsAlarmCondition for the event name specified
- */
- private List<CldsAlarmCondition> getAllAlarmConditionsFromCldsVfData(CldsVfData currCldsVfData, String eventName) {
- List<CldsAlarmCondition> alarmCondList = new ArrayList<>();
- if (currCldsVfData != null && currCldsVfData.getCldsVfcs() != null && !currCldsVfData.getCldsVfcs().isEmpty()) {
- for (CldsVfcData currCldsVfcData : currCldsVfData.getCldsVfcs()) {
- alarmCondList.addAll(getAllAlarmConditionsFromCldsVfcData(currCldsVfcData, eventName));
- }
- }
- return alarmCondList;
- }
-
- /**
- * Method to get alarm conditions/alert description from VFC Data.
- *
- * @param currCldsVfcData
- * The VfC Data to analyze
- * @param eventName
- * The String event name that will be used to filter the alarm list
- * @return The list of CldsAlarmCondition for the event name specified
- */
- private List<CldsAlarmCondition> getAllAlarmConditionsFromCldsVfcData(CldsVfcData currCldsVfcData,
- String eventName) {
- List<CldsAlarmCondition> alarmCondList = new ArrayList<>();
- if (currCldsVfcData != null && currCldsVfcData.getCldsAlarmConditions() != null
- && !currCldsVfcData.getCldsAlarmConditions().isEmpty()) {
- for (CldsAlarmCondition currCldsAlarmCondition : currCldsVfcData.getCldsAlarmConditions()) {
- if (currCldsAlarmCondition != null
- && currCldsAlarmCondition.getEventName().equalsIgnoreCase(eventName)) {
- alarmCondList.add(currCldsAlarmCondition);
- }
- }
- }
- return alarmCondList;
- }
-
- private JsonObject createAlarmCondObjectNodeByAlarmKey(List<CldsAlarmCondition> cldsAlarmCondList) {
- JsonObject alarmCondKeyNode = new JsonObject();
- if (cldsAlarmCondList != null && !cldsAlarmCondList.isEmpty()) {
- for (CldsAlarmCondition currCldsAlarmCondition : cldsAlarmCondList) {
- if (currCldsAlarmCondition != null) {
- JsonObject alarmCondNode = new JsonObject();
- alarmCondNode.addProperty("eventSourceType", currCldsAlarmCondition.getEventSourceType());
- alarmCondNode.addProperty("eventSeverity", currCldsAlarmCondition.getSeverity());
- alarmCondKeyNode.add(currCldsAlarmCondition.getAlarmConditionKey(), alarmCondNode);
- }
- }
- } else {
- JsonObject alarmCondNode = new JsonObject();
- alarmCondNode.addProperty("eventSourceType", "");
- alarmCondNode.addProperty("eventSeverity", "");
- alarmCondKeyNode.add("", alarmCondNode);
- }
- return alarmCondKeyNode;
- }
-
- private JsonObject createVfObjectNodeByServiceInvariantUuid(CldsServiceData cldsServiceData) {
- JsonObject invariantUuidObjectNode = new JsonObject();
- JsonObject vfObjectNode = new JsonObject();
- JsonObject vfUuidNode = new JsonObject();
- List<CldsVfData> cldsVfsList = cldsServiceData.getCldsVfs();
- if (cldsVfsList != null && !cldsVfsList.isEmpty()) {
- for (CldsVfData currCldsVfData : cldsVfsList) {
- if (currCldsVfData != null) {
- vfUuidNode.addProperty(currCldsVfData.getVfInvariantResourceUUID(), currCldsVfData.getVfName());
- }
- }
- } else {
- vfUuidNode.addProperty("", "");
- }
- vfObjectNode.add("vf", vfUuidNode);
- invariantUuidObjectNode.add(cldsServiceData.getServiceInvariantUUID(), vfObjectNode);
- return invariantUuidObjectNode;
- }
-
- private void createKpiObjectNodeByVfUuid(JsonObject vfResourceUuidObjectNode,
- List<CldsVfKPIData> cldsVfKpiDataList) {
- if (cldsVfKpiDataList != null && !cldsVfKpiDataList.isEmpty()) {
- for (CldsVfKPIData currCldsVfKpiData : cldsVfKpiDataList) {
- if (currCldsVfKpiData != null) {
- JsonObject thresholdNameObjectNode = new JsonObject();
- JsonObject fieldPathObjectNode = new JsonObject();
- JsonObject nfNamingCodeNode = new JsonObject();
- fieldPathObjectNode.addProperty(currCldsVfKpiData.getFieldPathValue(),
- currCldsVfKpiData.getFieldPathValue());
- nfNamingCodeNode.addProperty(currCldsVfKpiData.getNfNamingValue(), currCldsVfKpiData.getNfNamingValue());
- thresholdNameObjectNode.add("fieldPath", fieldPathObjectNode);
- thresholdNameObjectNode.add("nfNamingCode", nfNamingCodeNode);
- vfResourceUuidObjectNode.add(currCldsVfKpiData.getThresholdValue(), thresholdNameObjectNode);
- }
- }
- }
- }
-
- private void createAlarmCondObjectNodeByVfcUuid(JsonObject vfcResourceUuidObjectNode,
- List<CldsVfcData> cldsVfcDataList) {
- JsonObject vfcObjectNode = new JsonObject();
- JsonObject alarmCondNode = new JsonObject();
- JsonObject alertDescNode = new JsonObject();
- if (cldsVfcDataList != null && !cldsVfcDataList.isEmpty()) {
- for (CldsVfcData currCldsVfcData : cldsVfcDataList) {
- if (currCldsVfcData != null) {
- if (currCldsVfcData.getCldsAlarmConditions() != null
- && !currCldsVfcData.getCldsAlarmConditions().isEmpty()) {
- for (CldsAlarmCondition currCldsAlarmCondition : currCldsVfcData.getCldsAlarmConditions()) {
- if ("alarmCondition".equalsIgnoreCase(currCldsAlarmCondition.getEventName())) {
- alarmCondNode.addProperty(currCldsAlarmCondition.getAlarmConditionKey(),
- currCldsAlarmCondition.getAlarmConditionKey());
- } else {
- alertDescNode.addProperty(currCldsAlarmCondition.getAlarmConditionKey(),
- currCldsAlarmCondition.getAlarmConditionKey());
- }
- }
- }
- vfcObjectNode.add("alarmCondition", alarmCondNode);
- vfcObjectNode.add("alertDescription", alertDescNode);
- vfcResourceUuidObjectNode.add(currCldsVfcData.getVfcInvariantResourceUUID(), vfcObjectNode);
- }
- }
- } else {
- alarmCondNode.addProperty("", "");
- vfcObjectNode.add("alarmCondition", alarmCondNode);
- alertDescNode.addProperty("", "");
- vfcObjectNode.add("alertDescription", alarmCondNode);
- vfcResourceUuidObjectNode.add("", vfcObjectNode);
- }
- }
-
- /**
- * Method to create vfc and kpi nodes inside vf node
- *
- * @param mapper
- * @param cldsVfDataList
- * @return
- */
- private JsonObject createVfcObjectNodeByVfUuid(List<CldsVfData> cldsVfDataList) {
- JsonObject vfUuidObjectNode = new JsonObject();
- if (cldsVfDataList != null && !cldsVfDataList.isEmpty()) {
- for (CldsVfData currCldsVfData : cldsVfDataList) {
- if (currCldsVfData != null) {
- JsonObject vfObjectNode = new JsonObject();
- JsonObject vfcUuidNode = new JsonObject();
- JsonObject kpiObjectNode = new JsonObject();
- if (currCldsVfData.getCldsVfcs() != null && !currCldsVfData.getCldsVfcs().isEmpty()) {
- for (CldsVfcData currCldsVfcData : currCldsVfData.getCldsVfcs()) {
- if (currCldsVfcData.getCldsAlarmConditions() != null
- && !currCldsVfcData.getCldsAlarmConditions().isEmpty()) {
- vfcUuidNode.addProperty(currCldsVfcData.getVfcInvariantResourceUUID(),
- currCldsVfcData.getVfcName());
- }
- }
- } else {
- vfcUuidNode.addProperty("", "");
- }
- if (currCldsVfData.getCldsKPIList() != null && !currCldsVfData.getCldsKPIList().isEmpty()) {
- for (CldsVfKPIData currCldsVfKPIData : currCldsVfData.getCldsKPIList()) {
- // ToDo: something wrong happened here
- kpiObjectNode.addProperty(currCldsVfKPIData.getThresholdValue(),
- currCldsVfKPIData.getThresholdValue());
- }
- } else {
- kpiObjectNode.addProperty("", "");
- }
- vfObjectNode.add("vfc", vfcUuidNode);
- vfObjectNode.add("kpi", kpiObjectNode);
- vfUuidObjectNode.add(currCldsVfData.getVfInvariantResourceUUID(), vfObjectNode);
- }
- }
- } else {
- JsonObject vfcUuidNode = new JsonObject();
- vfcUuidNode.addProperty("", "");
- JsonObject vfcObjectNode = new JsonObject();
- vfcObjectNode.add("vfc", vfcUuidNode);
- vfUuidObjectNode.add("", vfcObjectNode);
- }
- return vfUuidObjectNode;
- }
-
- // To get all sdc VF/VFC Resources basic info.
- private List<SdcResourceBasicInfo> getAllSdcVForVfcResourcesBasedOnResourceType(String resourceType) {
- String catalogUrl = refProp.getStringValue(SDC_CATALOG_URL_PROPERTY_NAME);
- String resourceUrl = catalogUrl + "resources?resourceType=" + resourceType;
- String allSdcVfcResources = getCldsServicesOrResourcesBasedOnURL(resourceUrl);
- return removeDuplicateSdcResourceBasicInfo(getAllSdcResourcesListFromJson(allSdcVfcResources));
- }
-
- private String getResourceUuidFromResourceInvariantUuid(String resourceInvariantUuid,
- List<SdcResourceBasicInfo> resourceInfoList) {
- String resourceUuid = null;
- if (resourceInfoList != null && !resourceInfoList.isEmpty()) {
- for (SdcResourceBasicInfo currResource : resourceInfoList) {
- if (currResource != null && currResource.getInvariantUUID() != null && currResource.getUuid() != null
- && currResource.getInvariantUUID().equalsIgnoreCase(resourceInvariantUuid)) {
- resourceUuid = currResource.getUuid();
- break;
- }
- }
- }
- return resourceUuid;
- }
-}
diff --git a/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcRequests.java b/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcRequests.java deleted file mode 100644 index d9093f4e4..000000000 --- a/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcRequests.java +++ /dev/null @@ -1,227 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP CLAMP - * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END============================================ - * =================================================================== - * - */ - -package org.onap.clamp.clds.client.req.sdc; - -import com.att.eelf.configuration.EELFLogger; -import com.att.eelf.configuration.EELFManager; - -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.security.GeneralSecurityException; -import java.util.ArrayList; -import java.util.Base64; -import java.util.Iterator; -import java.util.List; -import java.util.Map.Entry; - -import org.apache.commons.codec.DecoderException; -import org.onap.clamp.clds.client.req.tca.TcaRequestFormatter; -import org.onap.clamp.clds.config.ClampProperties; -import org.onap.clamp.clds.model.properties.Global; -import org.onap.clamp.clds.model.properties.ModelProperties; -import org.onap.clamp.clds.model.properties.Tca; -import org.onap.clamp.clds.model.sdc.SdcResource; -import org.onap.clamp.clds.model.sdc.SdcServiceDetail; -import org.onap.clamp.clds.util.JsonUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Primary; -import org.springframework.stereotype.Component; - -/** - * Construct a Sdc request given CLDS objects. - */ -@Component -@Primary -public class SdcRequests { - - protected static final EELFLogger logger = EELFManager.getInstance().getLogger(SdcRequests.class); - protected static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger(); - @Autowired - private SdcCatalogServices sdcCatalogServices; - @Autowired - protected ClampProperties refProp; - - /** - * Format the Blueprint from a Yaml - * - * @param prop - * The ModelProperties describing the clds model - * @param docText - * The Yaml file that must be converted - * @return A String containing the BluePrint - * @throws IOException - * In case of issues - */ - public String formatBlueprint(ModelProperties prop, String docText) throws IOException { - String yamlvalue = getYamlvalue(docText); - String updatedBlueprint = ""; - Tca tca = prop.getType(Tca.class); - if (tca.isFound()) { - updatedBlueprint = TcaRequestFormatter.updatedBlueprintWithConfiguration(refProp, prop, yamlvalue); - } - logger.info("value of blueprint:" + updatedBlueprint); - return updatedBlueprint; - } - - /** - * Format the SDC Locations Request in the JSON Format - * - * @param prop - * The ModelProperties describing the clds model - * @param artifactName - * The name of the artifact - * @return SDC Locations request in the JSON Format - */ - public String formatSdcLocationsReq(ModelProperties prop, String artifactName) { - Global global = prop.getGlobal(); - List<String> locationsList = global.getLocation(); - JsonArray locationsArrayNode = new JsonArray(); - JsonObject locationObject = new JsonObject(); - for (String currLocation : locationsList) { - locationsArrayNode.add(currLocation); - } - locationObject.addProperty("artifactName", artifactName); - locationObject.add("locations", locationsArrayNode); - String locationJsonFormat = locationObject.toString(); - logger.info("Value of location Json Artifact:" + locationsArrayNode); - return locationJsonFormat; - } - - /** - * Format the SDC Request - * - * @param payloadData - * The ModelProperties describing the clds model - * @param artifactName - * The name of the artifact - * @param artifactLabel - * The Label of the artifact - * @param artifactType - * The type of the artifact - * @return formatted SDC Request - */ - public String formatSdcReq(String payloadData, String artifactName, String artifactLabel, String artifactType) { - logger.info("artifact=" + payloadData); - String base64Artifact = Base64.getEncoder().encodeToString(payloadData.getBytes(StandardCharsets.UTF_8)); - return "{ \n" + "\"payloadData\" : \"" + base64Artifact + "\",\n" + "\"artifactLabel\" : \"" + artifactLabel - + "\",\n" + "\"artifactName\" :\"" + artifactName + "\",\n" + "\"artifactType\" : \"" + artifactType - + "\",\n" + "\"artifactGroupType\" : \"DEPLOYMENT\",\n" + "\"description\" : \"from CLAMP Cockpit\"\n" - + "} \n"; - } - - private List<String> filterVfResourceList(String serviceUuid, List<SdcResource> sdcResourcesList, - List<String> cldsResourceVfList) { - List<String> urlList = new ArrayList<>(); - for (SdcResource cldsSdcResource : sdcResourcesList) { - if (cldsSdcResource != null && cldsSdcResource.getResoucreType() != null - && cldsSdcResource.getResoucreType().equalsIgnoreCase("VF") - && cldsResourceVfList.contains(cldsSdcResource.getResourceInvariantUUID())) { - String normalizedResourceInstanceName = normalizeResourceInstanceName( - cldsSdcResource.getResourceInstanceName()); - String svcUrl = createUrlForResource(normalizedResourceInstanceName, serviceUuid); - urlList.add(svcUrl); - } - } - return urlList; - } - - private String createUrlForResource(String normalizedResourceInstanceName, String serviceUuid) { - return refProp.getStringValue("sdc.serviceUrl") + "/" + serviceUuid + "/resourceInstances/" - + normalizedResourceInstanceName + "/artifacts"; - } - - /** - * To get List of urls for all vfresources - * - * @param prop - * The model properties JSON describing the closed loop flow - * @return A list of Service URL - * @throws GeneralSecurityException - * In case of issues when decrypting the password - * @throws DecoderException - * In case of issues when decoding the Hex String - */ - public List<String> getSdcReqUrlsList(ModelProperties prop) throws GeneralSecurityException, DecoderException { - List<String> urlList = new ArrayList<>(); - Global globalProps = prop.getGlobal(); - if (globalProps != null && globalProps.getService() != null && globalProps.getResourceVf() != null) { - String serviceUuid = sdcCatalogServices.getServiceUuidFromServiceInvariantId(globalProps.getService()); - SdcServiceDetail sdcServiceDetail = sdcCatalogServices - .decodeCldsSdcServiceDetailFromJson(sdcCatalogServices.getSdcServicesInformation(serviceUuid)); - if (sdcServiceDetail != null) { - urlList = filterVfResourceList(serviceUuid, sdcServiceDetail.getResources(), - globalProps.getResourceVf()); - } - } else { - logger.warn("GlobalProperties json is empty, skipping getSdcReqUrlsList and returning empty list"); - } - return urlList; - } - - /** - * "Normalize" the resource instance name: - Remove spaces, underscores, - * dashes, and periods. - make lower case This is required by SDC when using - * the resource instance name to upload an artifact. - * - * @param inText - * @return - */ - public String normalizeResourceInstanceName(String inText) { - return inText.replace(" ", "").replace("-", "").replace(".", "").toLowerCase(); - } - - /** - * Method to get yaml/template properties value from json. - * - * @param jsonGlobal - * The Json containing a Yaml file - * @return The yaml extracted from the JSON - * @throws IOException - * In case of issues with the Json parser - */ - protected String getYamlvalue(String jsonGlobal) throws IOException { - String yamlFileValue = ""; - JsonObject root = JsonUtils.GSON.fromJson(jsonGlobal, JsonObject.class); - Iterator<Entry<String, JsonElement>> entryItr = root.entrySet().iterator(); - while (entryItr.hasNext()) { - Entry<String, JsonElement> entry = entryItr.next(); - String key = entry.getKey(); - if (key != null && key.equalsIgnoreCase("global")) { - JsonArray arrayNode = entry.getValue().getAsJsonArray(); - for (JsonElement anArrayNode : arrayNode) { - JsonObject node = anArrayNode.getAsJsonObject(); - JsonArray arrayValueNode = node.get("value").getAsJsonArray(); - JsonElement jsonNode = arrayValueNode.get(0); - yamlFileValue = jsonNode.getAsString(); - logger.info("value:" + yamlFileValue); - } - break; - } - } - return yamlFileValue; - } -} diff --git a/src/main/java/org/onap/clamp/clds/dao/CldsDao.java b/src/main/java/org/onap/clamp/clds/dao/CldsDao.java index b6e27c5e1..eef635359 100644 --- a/src/main/java/org/onap/clamp/clds/dao/CldsDao.java +++ b/src/main/java/org/onap/clamp/clds/dao/CldsDao.java @@ -336,45 +336,6 @@ public class CldsDao { return template; } - public void clearServiceCache() { - String clearCldsServiceCacheSql = "TRUNCATE clds_service_cache"; - jdbcTemplateObject.execute(clearCldsServiceCacheSql); - } - - public CldsServiceData getCldsServiceCache(String invariantUUID) { - CldsServiceData cldsServiceData = null; - try { - String getCldsServiceSQL = "SELECT * , TIMESTAMPDIFF(SECOND, timestamp, CURRENT_TIMESTAMP()) FROM clds_service_cache where invariant_service_id = ? "; - cldsServiceData = jdbcTemplateObject.queryForObject(getCldsServiceSQL, new Object[] { invariantUUID }, - new CldsServiceDataMapper()); - if (cldsServiceData != null) { - logger.info("CldsServiceData found in cache for Service Invariant ID:" - + cldsServiceData.getServiceInvariantUUID()); - return cldsServiceData; - } else { - logger.warn("CldsServiceData not found in cache for Service Invariant ID:" + invariantUUID); - return null; - } - } catch (EmptyResultDataAccessException e) { - logger.info("CldsServiceData not found in cache for Service Invariant ID: " + invariantUUID); - logger.debug("CldsServiceData not found in cache for Service Invariant ID: " + invariantUUID, e); - return null; - } - } - - public void setCldsServiceCache(CldsDbServiceCache cldsDBServiceCache) { - if (cldsDBServiceCache != null && cldsDBServiceCache.getInvariantId() != null - && cldsDBServiceCache.getServiceId() != null) { - String invariantUuid = cldsDBServiceCache.getInvariantId(); - String serviceUuid = cldsDBServiceCache.getServiceId(); - InputStream is = cldsDBServiceCache.getCldsDataInstream(); - String insertCldsServiceCacheSql = "INSERT INTO clds_service_cache" - + "(invariant_service_id,service_id,timestamp,object_data) VALUES" - + "(?,?,CURRENT_TIMESTAMP,?) ON DUPLICATE KEY UPDATE invariant_service_id = VALUES(invariant_service_id) , timestamp = CURRENT_TIMESTAMP , object_data = VALUES(object_data) "; - jdbcTemplateObject.update(insertCldsServiceCacheSql, invariantUuid, serviceUuid, is); - } - } - private static Map<String, Object> logSqlExecution(SimpleJdbcCall call, SqlParameterSource source) { try { return call.execute(source); diff --git a/src/main/java/org/onap/clamp/clds/service/CldsService.java b/src/main/java/org/onap/clamp/clds/service/CldsService.java index 2bad07f4a..42e9cf713 100644 --- a/src/main/java/org/onap/clamp/clds/service/CldsService.java +++ b/src/main/java/org/onap/clamp/clds/service/CldsService.java @@ -35,7 +35,6 @@ import java.lang.reflect.Type; import java.security.GeneralSecurityException; import java.util.Date; import java.util.List; -import java.util.Optional; import java.util.UUID; import javax.servlet.http.HttpServletRequest; @@ -45,23 +44,19 @@ import javax.xml.transform.TransformerException; import org.apache.camel.Produce; import org.apache.commons.codec.DecoderException; -import org.apache.commons.lang3.StringUtils; import org.json.simple.parser.ParseException; import org.onap.clamp.clds.camel.CamelProxy; import org.onap.clamp.clds.client.DcaeDispatcherServices; import org.onap.clamp.clds.client.DcaeInventoryServices; -import org.onap.clamp.clds.client.req.sdc.SdcCatalogServices; import org.onap.clamp.clds.config.ClampProperties; import org.onap.clamp.clds.dao.CldsDao; import org.onap.clamp.clds.exception.policy.PolicyClientException; import org.onap.clamp.clds.exception.sdc.SdcCommunicationException; -import org.onap.clamp.clds.model.CldsDbServiceCache; import org.onap.clamp.clds.model.CldsEvent; import org.onap.clamp.clds.model.CldsInfo; import org.onap.clamp.clds.model.CldsModel; import org.onap.clamp.clds.model.CldsModelProp; import org.onap.clamp.clds.model.CldsMonitoringDetails; -import org.onap.clamp.clds.model.CldsServiceData; import org.onap.clamp.clds.model.CldsTemplate; import org.onap.clamp.clds.model.DcaeEvent; import org.onap.clamp.clds.model.ValueItem; @@ -94,11 +89,9 @@ public class CldsService extends SecureServiceBase { protected static final EELFLogger logger = EELFManager.getInstance().getLogger(CldsService.class); public static final String GLOBAL_PROPERTIES_KEY = "files.globalProperties"; - private final String cldsPersmissionTypeCl; private final String cldsPermissionTypeClManage; private final String cldsPermissionTypeClEvent; private final String cldsPermissionTypeFilterVf; - private final String cldsPermissionTypeTemplate; private final String cldsPermissionInstance; final SecureServicePermission permissionReadCl; final SecureServicePermission permissionUpdateCl; @@ -110,7 +103,6 @@ public class CldsService extends SecureServiceBase { private final CldsDao cldsDao; private final XslTransformer cldsBpmnTransformer; private final ClampProperties refProp; - private final SdcCatalogServices sdcCatalogServices; private final DcaeDispatcherServices dcaeDispatcherServices; private final DcaeInventoryServices dcaeInventoryServices; private LoggingUtils util = new LoggingUtils(logger); @@ -120,7 +112,7 @@ public class CldsService extends SecureServiceBase { @Autowired public CldsService(CldsDao cldsDao, XslTransformer cldsBpmnTransformer, ClampProperties refProp, - SdcCatalogServices sdcCatalogServices, DcaeDispatcherServices dcaeDispatcherServices, + DcaeDispatcherServices dcaeDispatcherServices, DcaeInventoryServices dcaeInventoryServices, @Value("${clamp.config.security.permission.type.cl:permission-type-cl}") String cldsPersmissionTypeCl, @Value("${clamp.config.security.permission.type.cl.manage:permission-type-cl-manage}") String cldsPermissionTypeClManage, @@ -132,14 +124,11 @@ public class CldsService extends SecureServiceBase { this.cldsDao = cldsDao; this.cldsBpmnTransformer = cldsBpmnTransformer; this.refProp = refProp; - this.sdcCatalogServices = sdcCatalogServices; this.dcaeDispatcherServices = dcaeDispatcherServices; this.dcaeInventoryServices = dcaeInventoryServices; - this.cldsPersmissionTypeCl = cldsPersmissionTypeCl; this.cldsPermissionTypeClManage = cldsPermissionTypeClManage; this.cldsPermissionTypeClEvent = cldsPermissionTypeClEvent; this.cldsPermissionTypeFilterVf = cldsPermissionTypeFilterVf; - this.cldsPermissionTypeTemplate = cldsPermissionTypeTemplate; this.cldsPermissionInstance = cldsPermissionInstance; permissionReadCl = SecureServicePermission.create(cldsPersmissionTypeCl, cldsPermissionInstance, "read"); permissionUpdateCl = SecureServicePermission.create(cldsPersmissionTypeCl, cldsPermissionInstance, "update"); @@ -470,32 +459,6 @@ public class CldsService extends SecureServiceBase { } /** - * REST service that retrieves sdc services - * - * @throws GeneralSecurityException - * In case of issue when decryting the SDC password - * @throws DecoderException - * In case of issues with the decoding of the Hex String - */ - public String getSdcServices() throws GeneralSecurityException, DecoderException { - util.entering(request, "CldsService: GET sdc services"); - Date startTime = new Date(); - String retStr; - try { - retStr = createUiServiceFormatJson(sdcCatalogServices.getSdcServicesInformation(null)); - } catch (IOException e) { - logger.error("IOException during SDC communication", e); - throw new SdcCommunicationException("IOException during SDC communication", e); - } - logger.info("value of sdcServices : {}", retStr); - // audit log - LoggingUtils.setTimeContext(startTime, new Date()); - auditLogger.info("GET sdc services completed"); - util.exiting("200", "Get sdc services success", Level.INFO, ONAPLogConstants.ResponseStatus.COMPLETED); - return retStr; - } - - /** * REST service that retrieves total properties required by UI * * @throws IOException @@ -505,41 +468,6 @@ public class CldsService extends SecureServiceBase { return refProp.getJsonTemplate(GLOBAL_PROPERTIES_KEY).toString(); } - /** - * REST service that retrieves total properties by using invariantUUID based on - * refresh and non refresh - * - * @throws GeneralSecurityException - * In case of issues with the decryting the encrypted password - * @throws DecoderException - * In case of issues with the decoding of the Hex String - * @throws IOException - * In case of issue to convert CldsServiceCache to InputStream - */ - public String getSdcPropertiesByServiceUUIDForRefresh(String serviceInvariantUUID, Boolean refresh) - throws GeneralSecurityException, DecoderException, IOException { - util.entering(request, "CldsService: GET sdc properties by uuid"); - Date startTime = new Date(); - CldsServiceData cldsServiceData = new CldsServiceData(); - cldsServiceData.setServiceInvariantUUID(serviceInvariantUUID); - if (!Optional.ofNullable(refresh).orElse(false)) { - cldsServiceData = cldsDao.getCldsServiceCache(serviceInvariantUUID); - } - if (sdcCatalogServices.isCldsSdcCacheDataExpired(cldsServiceData)) { - cldsServiceData = sdcCatalogServices.getCldsServiceDataWithAlarmConditions(serviceInvariantUUID); - cldsDao.setCldsServiceCache(new CldsDbServiceCache(cldsServiceData)); - } - // filter out VFs the user is not authorized for - cldsServiceData.filterVfs(this); - // format retrieved data into properties json - String sdcProperties = sdcCatalogServices.createPropertiesObjectByUUID(cldsServiceData); - // audit log - LoggingUtils.setTimeContext(startTime, new Date()); - auditLogger.info("GET sdc properties by uuid completed"); - util.exiting("200", "Get sdc properties by uuid success", Level.INFO, - ONAPLogConstants.ResponseStatus.COMPLETED); - return sdcProperties; - } /** * Determine if the user is authorized for a particular VF by its invariant @@ -579,27 +507,6 @@ public class CldsService extends SecureServiceBase { } } - private String createUiServiceFormatJson(String responseStr) throws IOException { - if (StringUtils.isBlank(responseStr)) { - return ""; - } - List<SdcServiceInfo> rawList = JsonUtils.GSON.fromJson(responseStr, LIST_OF_SDC_SERVICE_INFO_TYPE); - JsonObject invariantIdServiceNode = new JsonObject(); - JsonObject serviceNode = new JsonObject(); - logger.info("value of cldsserviceiNfolist: {}", rawList); - if (rawList != null && !rawList.isEmpty()) { - List<SdcServiceInfo> cldsSdcServiceInfoList = sdcCatalogServices.removeDuplicateServices(rawList); - for (SdcServiceInfo currCldsSdcServiceInfo : cldsSdcServiceInfoList) { - if (currCldsSdcServiceInfo != null) { - invariantIdServiceNode.addProperty(currCldsSdcServiceInfo.getInvariantUUID(), - currCldsSdcServiceInfo.getName()); - } - } - serviceNode.add("service", invariantIdServiceNode); - } - return serviceNode.toString(); - } - public ResponseEntity<CldsModel> deployModel(String modelName, CldsModel model) { util.entering(request, "CldsService: Deploy model"); Date startTime = new Date(); diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/global_properties.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/global_properties.html index 811f6b716..c47e90a49 100644 --- a/src/main/resources/META-INF/resources/designer/partials/portfolios/global_properties.html +++ b/src/main/resources/META-INF/resources/designer/partials/portfolios/global_properties.html @@ -48,28 +48,6 @@ <div> <div class="form-group clearfix"> - <label for="services" class="col-sm-4 control-label">Services</label> - - <div class="col-sm-8"> - <select class="form-control" name="service" id="service" - onchange="propChangeAlert(this);"> - <!-- <option ng-repeat="(key, value) in services" value="{{key}}">{{value}}</option> --> - </select> - </div> - </div> - <div class="form-group clearfix"> - <label for="vf" class="col-sm-4 control-label"> Resource-VF</label> - - <div class="col-sm-8"> - <select class="form-control" id="vf" name="vf" - onchange="propChangeAlert(this);"> - - </select> - - </div> - </div> - - <div class="form-group clearfix"> <label for="actionSet" class="col-sm-4 control-label"> Action Set</label> @@ -125,63 +103,8 @@ <script> //display message only if global was previously saved - serDiff = false; - vfDiff = false; asDiff = false; - (function() { - $("#paramsWarn").hide(); - /*Below service method is called for checking the service is being loaded or not*/ - var intialize = intializeService; - function intializeService() { - $("#service").off('focus').off('change'); - $("#service").on('change', function() { - var chosen = $(this).val(); - (function(spinner) { - $("#ridinSpinners").show(); - setTimeout(spinner, 1); - })(function() { - loadSharedPropertyByService(chosen, null, intialize); - if (elementMap["global"]) { - if ($("#vf").val() == oldVf) { - vfDiff = false; - if ((!vfDiff) && (!asDiff) && (!serDiff)) { - $(".propChangeWarn").hide(); - } - ; - } else { - vfDiff = true; - $(".propChangeWarn").show(); - } - } - $("#ridinSpinners").hide(); - }); - }); - } - loadSharedPropertyByService(undefined, null, intialize); - intializeService(); - $("#paramsRetry").on('click', function() { - //$("#paramsWarn").hide(); - var currentValue = $("#service").val(); - $("#ridinSpinners").css("display", "") - var bool = loadSharedPropertyByService(currentValue); - $("#ridinSpinners").css("display", "none") - }); - $("#paramsCancel").on('click', function() { - loadSharedPropertyByServiceProperties(); - $("#paramsWarn").hide(); - }); - })(); - $(function() { - if (elementMap["global"]) { - for (var i = 0; i < elementMap["global"].length; i++) { - if (elementMap["global"][i]["name"] == "vf") { - oldVf = elementMap["global"][i]["value"]; - } - } - } else { - oldVf = ""; - } - }); + function propChangeAlert(actionset) { //throw warnings only if options were previously chosen if (elementMap["global"]) { @@ -191,12 +114,8 @@ if (elementMap["global"][i]["value"][0] == actionset.value) { if (elementMap["global"][i]["name"] == "actionSet") { asDiff = false; - } else if (elementMap["global"][i]["name"] == "service") { - serDiff = false; - } else if (elementMap["global"][i]["name"] == "vf") { - vfDiff = false; } - if ((!vfDiff) && (!asDiff) && (!serDiff)) { + if (!asDiff) { $(".propChangeWarn").hide(); } ; @@ -204,12 +123,7 @@ } else { if (elementMap["global"][i]["name"] == "actionSet") { asDiff = true; - } else if (elementMap["global"][i]["name"] == "service") { - serDiff = true; - } else if (elementMap["global"][i]["name"] == "vf") { - vfDiff = true; - } - ; + }; $(".propChangeWarn").show(); } break loop1; diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/refresh_asdc.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/refresh_asdc.html deleted file mode 100644 index 441766d42..000000000 --- a/src/main/resources/META-INF/resources/designer/partials/portfolios/refresh_asdc.html +++ /dev/null @@ -1,146 +0,0 @@ -<!-- - ============LICENSE_START======================================================= - ONAP CLAMP - ================================================================================ - Copyright (C) 2017 AT&T Intellectual Property. 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. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ============LICENSE_END============================================ - =================================================================== - - --> - -<style> -#paramsWarnrefresh { - display: none; -} - -</style> -<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> -<div attribute-test="refreshasdc" id="configure-widgets"> - <div attribute-test="refreshasdch" class="modal-header"> - <button type="button" class="close" ng-click="close(false)" - aria-hidden="true" style="margin-top: -3px">×</button> - <h4>Model Properties</h4> - </div> - <div class="modal-body" style="height: 280px"> - <div style="height: 10px"></div> - <div class="alert alert-danger refreshASDC" role="alert" id='paramsWarnrefresh'> - <strong>Ooops!</strong> Unable to load properties for <span id='servName'>. Would you like to</span> - <a href="javascript:void(0);" ng-click="paramsRetry();" class="btn-link" id='paramsRetry'>Retry </a> / - <a href="javascript:void(0);" ng-click="paramsCancel();" class="btn-link" id='paramsCancel'>Cancel</a> - </div> - <form id="saveProps" > - <div> - - <div class="form-group"> - <label for="services" class="col-sm-4 control-label" >Refresh ASDC services?</label> - - - </div> - - </div> - - </form> - <i hidden id="ridinSpinners" class="fa fa-spinner fa-spin" style="display:none;width:100%;text-align:center;font-size:24px;color:black;"></i> - - </div> - <div attribute-test="refreshasdcf" class="modal-footer"> - <!--<button ng-click="reset()" class="btn btn-primary" style="float:left">Reset</button>--> - <button ng-click="refreshASDC()" class="btn btn-primary">refresh</button> - <button ng-click="close(true)" id="close_button" - class="btn btn-primary">Cancel</button> - - </div> - <script> -// $.ajax({ -// async:false, -// dataType: "json", -// url: '/restservices/clds/v1/clds/asdc/services/', -// success: function(data){ -// vf_Services=data; -// }, -// error:function(s,a,err){ -// console.log(err) -// console.log(s) -// console.log(a) -// }, -// timeout:100000 -// }); -// var services=vf_Services.service -// console.log(elementMap["global"]) -// for(k in services){ -// console.log("lol") -// $("#service").append("<option value="+k+">"+services[k]+"</option>") -// } -// loadSharedPropertyByService() -// var el = elementMap["global"]; -// $("#status").val($("#activity_modeler").text()) -// if (el !== undefined) { -// for (var i = 0; i < el.length; i++) { -// $("#" + el[i].name).val(el[i].value); -// } -// } - var previous; - (function () { - - $("#service").on('focus', function () { - // Store the current value on focus and on change - previous = this.value; - console.log("hello") - }).change(function(){ - $("#ridinSpinners").css("display","") - var bool=loadSharedPropertyByService($(this).val()) - $("#ridinSpinners").css("display","none") - if(!bool) - $(this).val(previous) - }); - - })(); -// $("#service").on("change",function(){ -// $("#ridinSpinners").css("display","") -// loadSharedPropertyByService($(this).val()) -// $("#ridinSpinners").css("display","none") -// }) - function noRepeats(form){ - var select={}; - for(var i=0;i<form.length;i++){ - if(select[form[i].name]===undefined) - select[form[i].name]=[] - select[form[i].name].push(form[i].value); - } - var arr=[] - for(s in select){ - var f={} - f.name=s - f.value=select[s] - arr.push(f) - } - return arr - } - - $("#saveProps").on('submit', function(event) { - saveGlobalProperties(noRepeats($(this).serializeArray())) - event.preventDefault(); - - $("#close_button").click(); - - }) - $("#savePropsBtn").click(function(event) { - //alert($("#CProp_Target").val()) - $("#saveProps").submit(); - }) - </script> -</div> - diff --git a/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js b/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js index 9d4598b8e..0e44aec16 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js +++ b/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js @@ -117,34 +117,6 @@ app handleQueryToBackend(def, action, deployUrl, requestData); return def.promise; }; - this.getASDCServices = function() { - - var def = $q.defer(); - var sets = []; - var svcUrl = "/restservices/clds/v1/clds/sdc/services/"; - $http.get(svcUrl).success(function(data) { - - def.resolve(data); - }).error(function(data) { - - def.reject("sdc Services not found"); - }); - return def.promise; - }; - this.getASDCService = function(uuid) { - - var def = $q.defer(); - var sets = []; - var svcUrl = "/restservices/clds/v1/clds/sdc/services/" + uuid; - $http.get(svcUrl).success(function(data) { - - def.resolve(data); - }).error(function(data) { - - def.reject("SDC service not found"); - }); - return def.promise; - }; this.getModel = function(modelName) { var def = $q.defer(); @@ -373,8 +345,6 @@ app .remove('ThisLink'); document.getElementById('Refresh Status').classList .remove('ThisLink'); - document.getElementById('Refresh ASDC').classList - .remove('ThisLink'); } // enable/disable menu options based on permittedActionCd // list @@ -392,10 +362,4 @@ app this.checkPermittedActionCd(permittedActionCd, 'UnDeploy', 'UNDEPLOY'); } - this.getASDCServices().then(function(pars) { - - var obj = JSON.parse(pars); - var services = obj.service; - asdc_Services = services - }); } ]); diff --git a/src/main/resources/META-INF/resources/designer/scripts/CldsOpenModelCtrl.js b/src/main/resources/META-INF/resources/designer/scripts/CldsOpenModelCtrl.js index a64af7467..2b7c62589 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/CldsOpenModelCtrl.js +++ b/src/main/resources/META-INF/resources/designer/scripts/CldsOpenModelCtrl.js @@ -51,8 +51,6 @@ function($scope, $rootScope, $modalInstance, $window, $uibModalInstance, cldsMod }); $scope.paramsRetry = function() { // $("#paramsWarn").hide(); - var currentValue = $("#service").val() == null ? previous : $( - "#service").val(); $("#ridinSpinners").css("display", "") loadSharedPropertyByService(currentValue, true, callBack); $("#ridinSpinners").css("display", "none") @@ -71,11 +69,6 @@ function($scope, $rootScope, $modalInstance, $window, $uibModalInstance, cldsMod $scope.close(); } } - $scope.refreshASDC = function() { - $("#ridinSpinners").css("display", "") - var bool = loadSharedPropertyByService(undefined, true, callBack); - $("#ridinSpinners").css("display", "none"); - } cldsTemplateService.getSavedTemplate().then(function(pars) { $scope.templateNamel = [] for (var i = 0; i < pars.length; i++) { diff --git a/src/main/resources/META-INF/resources/designer/scripts/GlobalPropertiesCtrl.js b/src/main/resources/META-INF/resources/designer/scripts/GlobalPropertiesCtrl.js index f4c658ce1..21572a5f2 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/GlobalPropertiesCtrl.js +++ b/src/main/resources/META-INF/resources/designer/scripts/GlobalPropertiesCtrl.js @@ -31,15 +31,9 @@ app.controller('GlobalPropertiesCtrl', [ function($scope, $rootScope, $uibModalInstance, cldsModelService, $location, dialogs, cldsTemplateService) { $scope.$watch('name', function(newValue, oldValue) { - var services = asdc_Services + setASDCFields() - // add blank service item as the default service, to force user chose - // the correct service by themselves - $("#service").append("<option></option>") - for (k in services) { - $("#service").append( - "<option value=" + k + ">" + services[k] + "</option>") - } + var el = elementMap["global"]; if (el !== undefined) { for (var i = 0; i < el.length; i++) { diff --git a/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js b/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js index b69cfea08..11ad5fa95 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js +++ b/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js @@ -142,56 +142,7 @@ function setMultiSelect() { } function loadSharedPropertyByService(onChangeUUID, refresh, callBack) { - var uuid = onChangeUUID; - if (uuid === undefined) { - uuid = elementMap["global"] && elementMap["global"].length > 0 ? - elementMap["global"][0].value : ""; - } - var share = null, - serviceUrl = '/restservices/clds/v1/clds/properties/' + uuid; - if (refresh) { - serviceUrl = '/restservices/clds/v1/clds/properties/' + uuid + '?refresh=true'; - } - - $.ajax({ - async: false, - dataType: "json", - url: serviceUrl, - success: function(data) { - vf_Services = JSON.parse(data); setASDCFields() - if (refresh) { - $("#paramsWarnrefresh").hide(); - } - if ($("#paramsWarn")) { - $("#paramsWarn").hide(); - } - if (callBack && _.isFunction(callBack)) { - callBack(true); - } - }, - error: function(s, a, err) { - if (refresh) { - $("#paramsWarnrefresh").show(); - } - if ($("#paramsWarn")) { - $("#paramsWarn").show(); - } - - $('#servName').text($("#service option:selected").text()); - if (callBack && _.isFunction(callBack)) { - callBack(false); - } - console.log(err) - console.log(s) - console.log(a) - }, - timeout: 100000 - - }); - - //vf_Services=share['shared']['byService'][uuid]; - //location_values = share['global']['location']; } function loadSharedPropertyByServiceProperties(callBack) { @@ -218,45 +169,8 @@ function loadSharedPropertyByServiceProperties(callBack) { } function setASDCFields() { - if (vf_Services === null || vf_Services === undefined) { - loadSharedPropertyByService() - } else { try { - $("#vf").empty().multiselect("refresh"); - $("#location").empty().multiselect("refresh"); - $("#actionSet").empty().multiselect("refresh"); - $("#vfc").empty().multiselect("refresh"); - $("#paramsWarn").hide(); - var uuid = Object.keys(vf_Services['shared']['byService'])[0]; - - var vf_values = vf_Services['shared']['byService'][uuid] && - vf_Services['shared']['byService'][uuid]['vf'] && - _.keys(vf_Services['shared']['byService'][uuid]['vf']).length > 0 ? - vf_Services['shared']['byService'][uuid]['vf'] : null; - - var selectedVF = {} - for (let e in elementMap["global"]) { - if (elementMap['global'][e].name === "vf") { - selectedVF = elementMap['global'][e].value[0] - } - } - - var vfc_values2 = selectedVF && - vf_Services['shared']['byVf'][selectedVF] && - vf_Services['shared']['byVf'][selectedVF]['vfc'] && - _.keys(vf_Services['shared']['byVf'][selectedVF]['vfc']).length > 0 ? - vf_Services['shared']['byVf'][selectedVF]['vfc'] : null; - - if (vf_values) { - for (key in vf_values) { - if ($("#vf").length > 0) { - $("#vf").append("<option value=\"" + key + "\">" + vf_values[key] + "</opton>") - } - } - $("#vf").multiselect("rebuild"); - } - - var location_values = vf_Services['global']['location']; + var location_values = defaults_props['global']['location']; if (location_values) { for (key in location_values) { if ($("#location").length > 0) { @@ -266,7 +180,7 @@ function setASDCFields() { $("#location").multiselect("rebuild"); } - var actionSet_values = vf_Services['global']['actionSet']; + var actionSet_values = defaults_props['global']['actionSet']; if (actionSet_values) { for (key in actionSet_values) { if ($("#actionSet").length > 0) { @@ -275,22 +189,6 @@ function setASDCFields() { } $("#actionSet").multiselect("rebuild"); } - - if (vfc_values2) { - $("#vfc").append("<option value=\"\"></opton>"); - for (key in vfc_values2) { - if ($("#vfc").length > 0) { - $("#vfc").append("<option value=\"" + key.split("\"").join("") + "\">" + vfc_values2[key] + "</opton>") - } - } - $("#vfc").multiselect("rebuild"); - } - if ($("#vfc").length > 0 && !vfc_values2) { - showWarn(); - } - if ($("#vf").length > 0 && !vf_values) { - showWarn(); - } if ($("#location").length > 0 && !location_values) { showWarn(); } @@ -302,7 +200,7 @@ function setASDCFields() { } catch (e) { console.log(e) } - } + } //Typically used when opening a new model/template diff --git a/src/main/resources/META-INF/resources/designer/scripts/app.js b/src/main/resources/META-INF/resources/designer/scripts/app.js index c9bb9e3a4..544756888 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/app.js +++ b/src/main/resources/META-INF/resources/designer/scripts/app.js @@ -264,8 +264,6 @@ function($scope, $rootScope, $timeout, dialogs) { $scope.cldsRevertModel(); } else if (name == "Close Model") { $scope.cldsClose(); - } else if (name == "Refresh ASDC") { - $scope.cldsRefreshASDC(); } else if (name == "Open CL") { $scope.cldsOpenModel(); } else if (name == "Save CL") { @@ -351,9 +349,6 @@ function($scope, $rootScope, $timeout, dialogs) { "View" : [ { link : "/refreshStatus", name : "Refresh Status" - }, { - link : "/cldsRefreshASDC", - name : "Refresh ASDC" } ], "Help" : [ { link : "http://wiki.onap.org", @@ -520,24 +515,6 @@ function($scope, $rootScope, $timeout, dialogs) { callBack(null); }); }; - $scope.cldsRefreshASDC = function() { - - var dlg = dialogs.create('partials/portfolios/refresh_asdc.html', - 'CldsOpenModelCtrl', { - closable : true, - draggable : true - }, { - size : 'lg', - keyboard : true, - backdrop : 'static', - windowClass : 'my-class' - }); - dlg.result.then(function(name) { - - }, function() { - - }); - } $scope.cldsRevertModel = function() { var dlg = dialogs.create( diff --git a/src/main/resources/META-INF/resources/swagger.html b/src/main/resources/META-INF/resources/swagger.html index cf19bf6ee..e2bc77a20 100644 --- a/src/main/resources/META-INF/resources/swagger.html +++ b/src/main/resources/META-INF/resources/swagger.html @@ -439,7 +439,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </li> <li><a href="#_paths">2. Paths</a> <ul class="sectlevel2"> -<li><a href="#_route10">2.1. PUT /clds/action/{action}/{modelName}?test={test}</a> +<li><a href="#_route66">2.1. PUT /clds/action/{action}/{modelName}?test={test}</a> <ul class="sectlevel3"> <li><a href="#_parameters">2.1.1. Parameters</a></li> <li><a href="#_responses">2.1.2. Responses</a></li> @@ -447,19 +447,19 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <li><a href="#_produces">2.1.4. Produces</a></li> </ul> </li> -<li><a href="#_route2">2.2. GET /clds/cldsDetails</a> +<li><a href="#_route58">2.2. GET /clds/cldsDetails</a> <ul class="sectlevel3"> <li><a href="#_responses_2">2.2.1. Responses</a></li> <li><a href="#_produces_2">2.2.2. Produces</a></li> </ul> </li> -<li><a href="#_route3">2.3. GET /clds/cldsInfo</a> +<li><a href="#_route59">2.3. GET /clds/cldsInfo</a> <ul class="sectlevel3"> <li><a href="#_responses_3">2.3.1. Responses</a></li> <li><a href="#_produces_3">2.3.2. Produces</a></li> </ul> </li> -<li><a href="#_route11">2.4. POST /clds/dcae/event?test={test}</a> +<li><a href="#_route67">2.4. POST /clds/dcae/event?test={test}</a> <ul class="sectlevel3"> <li><a href="#_parameters_2">2.4.1. Parameters</a></li> <li><a href="#_responses_4">2.4.2. Responses</a></li> @@ -467,7 +467,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <li><a href="#_produces_4">2.4.4. Produces</a></li> </ul> </li> -<li><a href="#_route15">2.5. PUT /clds/deploy/{modelName}</a> +<li><a href="#_route69">2.5. PUT /clds/deploy/{modelName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_3">2.5.1. Parameters</a></li> <li><a href="#_responses_5">2.5.2. Responses</a></li> @@ -475,34 +475,34 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <li><a href="#_produces_5">2.5.4. Produces</a></li> </ul> </li> -<li><a href="#_route9">2.6. GET /clds/model-names</a> +<li><a href="#_route65">2.6. GET /clds/model-names</a> <ul class="sectlevel3"> <li><a href="#_responses_6">2.6.1. Responses</a></li> <li><a href="#_produces_6">2.6.2. Produces</a></li> </ul> </li> -<li><a href="#_route5">2.7. GET /clds/model/bpmn/{modelName}</a> +<li><a href="#_route61">2.7. GET /clds/model/bpmn/{modelName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_4">2.7.1. Parameters</a></li> <li><a href="#_responses_7">2.7.2. Responses</a></li> <li><a href="#_produces_7">2.7.3. Produces</a></li> </ul> </li> -<li><a href="#_route6">2.8. GET /clds/model/image/{modelName}</a> +<li><a href="#_route62">2.8. GET /clds/model/image/{modelName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_5">2.8.1. Parameters</a></li> <li><a href="#_responses_8">2.8.2. Responses</a></li> <li><a href="#_produces_8">2.8.3. Produces</a></li> </ul> </li> -<li><a href="#_route7">2.9. GET /clds/model/{modelName}</a> +<li><a href="#_route63">2.9. GET /clds/model/{modelName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_6">2.9.1. Parameters</a></li> <li><a href="#_responses_9">2.9.2. Responses</a></li> <li><a href="#_produces_9">2.9.3. Produces</a></li> </ul> </li> -<li><a href="#_route8">2.10. PUT /clds/model/{modelName}</a> +<li><a href="#_route64">2.10. PUT /clds/model/{modelName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_7">2.10.1. Parameters</a></li> <li><a href="#_responses_10">2.10.2. Responses</a></li> @@ -510,135 +510,122 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <li><a href="#_produces_10">2.10.4. Produces</a></li> </ul> </li> -<li><a href="#_route13">2.11. GET /clds/properties</a> +<li><a href="#_route68">2.11. GET /clds/properties</a> <ul class="sectlevel3"> <li><a href="#_responses_11">2.11.1. Responses</a></li> <li><a href="#_produces_11">2.11.2. Produces</a></li> </ul> </li> -<li><a href="#_route14">2.12. GET /clds/properties/{serviceInvariantUUID}?refresh={refresh}</a> +<li><a href="#_route70">2.12. PUT /clds/undeploy/{modelName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_8">2.12.1. Parameters</a></li> <li><a href="#_responses_12">2.12.2. Responses</a></li> -<li><a href="#_produces_12">2.12.3. Produces</a></li> +<li><a href="#_consumes_5">2.12.3. Consumes</a></li> +<li><a href="#_produces_12">2.12.4. Produces</a></li> </ul> </li> -<li><a href="#_route12">2.13. GET /clds/sdc/services</a> +<li><a href="#_route75">2.13. GET /cldsTempate/template-names</a> <ul class="sectlevel3"> <li><a href="#_responses_13">2.13.1. Responses</a></li> <li><a href="#_produces_13">2.13.2. Produces</a></li> </ul> </li> -<li><a href="#_route16">2.14. PUT /clds/undeploy/{modelName}</a> +<li><a href="#_route71">2.14. GET /cldsTempate/template/bpmn/{templateName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_9">2.14.1. Parameters</a></li> <li><a href="#_responses_14">2.14.2. Responses</a></li> -<li><a href="#_consumes_5">2.14.3. Consumes</a></li> -<li><a href="#_produces_14">2.14.4. Produces</a></li> +<li><a href="#_produces_14">2.14.3. Produces</a></li> </ul> </li> -<li><a href="#_route21">2.15. GET /cldsTempate/template-names</a> +<li><a href="#_route72">2.15. GET /cldsTempate/template/image/{templateName}</a> <ul class="sectlevel3"> -<li><a href="#_responses_15">2.15.1. Responses</a></li> -<li><a href="#_produces_15">2.15.2. Produces</a></li> +<li><a href="#_parameters_10">2.15.1. Parameters</a></li> +<li><a href="#_responses_15">2.15.2. Responses</a></li> +<li><a href="#_produces_15">2.15.3. Produces</a></li> </ul> </li> -<li><a href="#_route17">2.16. GET /cldsTempate/template/bpmn/{templateName}</a> +<li><a href="#_route73">2.16. GET /cldsTempate/template/{templateName}</a> <ul class="sectlevel3"> -<li><a href="#_parameters_10">2.16.1. Parameters</a></li> +<li><a href="#_parameters_11">2.16.1. Parameters</a></li> <li><a href="#_responses_16">2.16.2. Responses</a></li> <li><a href="#_produces_16">2.16.3. Produces</a></li> </ul> </li> -<li><a href="#_route18">2.17. GET /cldsTempate/template/image/{templateName}</a> +<li><a href="#_route74">2.17. PUT /cldsTempate/template/{templateName}</a> <ul class="sectlevel3"> -<li><a href="#_parameters_11">2.17.1. Parameters</a></li> +<li><a href="#_parameters_12">2.17.1. Parameters</a></li> <li><a href="#_responses_17">2.17.2. Responses</a></li> -<li><a href="#_produces_17">2.17.3. Produces</a></li> +<li><a href="#_consumes_6">2.17.3. Consumes</a></li> +<li><a href="#_produces_17">2.17.4. Produces</a></li> </ul> </li> -<li><a href="#_route19">2.18. GET /cldsTempate/template/{templateName}</a> +<li><a href="#_route81">2.18. GET /dictionary</a> <ul class="sectlevel3"> -<li><a href="#_parameters_12">2.18.1. Parameters</a></li> -<li><a href="#_responses_18">2.18.2. Responses</a></li> -<li><a href="#_produces_18">2.18.3. Produces</a></li> +<li><a href="#_responses_18">2.18.1. Responses</a></li> +<li><a href="#_produces_18">2.18.2. Produces</a></li> </ul> </li> -<li><a href="#_route20">2.19. PUT /cldsTempate/template/{templateName}</a> +<li><a href="#_route80">2.19. PUT /dictionary/{dictionaryName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_13">2.19.1. Parameters</a></li> <li><a href="#_responses_19">2.19.2. Responses</a></li> -<li><a href="#_consumes_6">2.19.3. Consumes</a></li> +<li><a href="#_consumes_7">2.19.3. Consumes</a></li> <li><a href="#_produces_19">2.19.4. Produces</a></li> </ul> </li> -<li><a href="#_route27">2.20. GET /dictionary</a> +<li><a href="#_route83">2.20. GET /dictionary/{dictionaryName}/items</a> <ul class="sectlevel3"> -<li><a href="#_responses_20">2.20.1. Responses</a></li> -<li><a href="#_produces_20">2.20.2. Produces</a></li> +<li><a href="#_parameters_14">2.20.1. Parameters</a></li> +<li><a href="#_responses_20">2.20.2. Responses</a></li> +<li><a href="#_produces_20">2.20.3. Produces</a></li> </ul> </li> -<li><a href="#_route26">2.21. PUT /dictionary/{dictionaryName}</a> +<li><a href="#_route82">2.21. PUT /dictionary/{dictionaryName}/items</a> <ul class="sectlevel3"> -<li><a href="#_parameters_14">2.21.1. Parameters</a></li> +<li><a href="#_parameters_15">2.21.1. Parameters</a></li> <li><a href="#_responses_21">2.21.2. Responses</a></li> -<li><a href="#_consumes_7">2.21.3. Consumes</a></li> +<li><a href="#_consumes_8">2.21.3. Consumes</a></li> <li><a href="#_produces_21">2.21.4. Produces</a></li> </ul> </li> -<li><a href="#_route29">2.22. GET /dictionary/{dictionaryName}/items</a> +<li><a href="#_route60">2.22. GET /healthcheck</a> <ul class="sectlevel3"> -<li><a href="#_parameters_15">2.22.1. Parameters</a></li> -<li><a href="#_responses_22">2.22.2. Responses</a></li> -<li><a href="#_produces_22">2.22.3. Produces</a></li> +<li><a href="#_responses_22">2.22.1. Responses</a></li> +<li><a href="#_produces_22">2.22.2. Produces</a></li> </ul> </li> -<li><a href="#_route28">2.23. PUT /dictionary/{dictionaryName}/items</a> +<li><a href="#_route78">2.23. GET /tosca/models</a> <ul class="sectlevel3"> -<li><a href="#_parameters_16">2.23.1. Parameters</a></li> -<li><a href="#_responses_23">2.23.2. Responses</a></li> -<li><a href="#_consumes_8">2.23.3. Consumes</a></li> -<li><a href="#_produces_23">2.23.4. Produces</a></li> +<li><a href="#_responses_23">2.23.1. Responses</a></li> +<li><a href="#_produces_23">2.23.2. Produces</a></li> </ul> </li> -<li><a href="#_route4">2.24. GET /healthcheck</a> +<li><a href="#_route77">2.24. GET /tosca/models/policyType/{policyType}</a> <ul class="sectlevel3"> -<li><a href="#_responses_24">2.24.1. Responses</a></li> -<li><a href="#_produces_24">2.24.2. Produces</a></li> +<li><a href="#_parameters_16">2.24.1. Parameters</a></li> +<li><a href="#_responses_24">2.24.2. Responses</a></li> +<li><a href="#_produces_24">2.24.3. Produces</a></li> </ul> </li> -<li><a href="#_route24">2.25. GET /tosca/models</a> +<li><a href="#_route79">2.25. GET /tosca/models/{toscaModelName}</a> <ul class="sectlevel3"> -<li><a href="#_responses_25">2.25.1. Responses</a></li> -<li><a href="#_produces_25">2.25.2. Produces</a></li> +<li><a href="#_parameters_17">2.25.1. Parameters</a></li> +<li><a href="#_responses_25">2.25.2. Responses</a></li> +<li><a href="#_produces_25">2.25.3. Produces</a></li> </ul> </li> -<li><a href="#_route23">2.26. GET /tosca/models/policyType/{policyType}</a> +<li><a href="#_route76">2.26. PUT /tosca/models/{toscaModelName}</a> <ul class="sectlevel3"> -<li><a href="#_parameters_17">2.26.1. Parameters</a></li> +<li><a href="#_parameters_18">2.26.1. Parameters</a></li> <li><a href="#_responses_26">2.26.2. Responses</a></li> -<li><a href="#_produces_26">2.26.3. Produces</a></li> +<li><a href="#_consumes_9">2.26.3. Consumes</a></li> +<li><a href="#_produces_26">2.26.4. Produces</a></li> </ul> </li> -<li><a href="#_route25">2.27. GET /tosca/models/{toscaModelName}</a> +<li><a href="#_route84">2.27. GET /user/getUser</a> <ul class="sectlevel3"> -<li><a href="#_parameters_18">2.27.1. Parameters</a></li> -<li><a href="#_responses_27">2.27.2. Responses</a></li> -<li><a href="#_produces_27">2.27.3. Produces</a></li> -</ul> -</li> -<li><a href="#_route22">2.28. PUT /tosca/models/{toscaModelName}</a> -<ul class="sectlevel3"> -<li><a href="#_parameters_19">2.28.1. Parameters</a></li> -<li><a href="#_responses_28">2.28.2. Responses</a></li> -<li><a href="#_consumes_9">2.28.3. Consumes</a></li> -<li><a href="#_produces_28">2.28.4. Produces</a></li> -</ul> -</li> -<li><a href="#_route30">2.29. GET /user/getUser</a> -<ul class="sectlevel3"> -<li><a href="#_responses_29">2.29.1. Responses</a></li> -<li><a href="#_produces_29">2.29.2. Produces</a></li> +<li><a href="#_responses_27">2.27.1. Responses</a></li> +<li><a href="#_produces_27">2.27.2. Produces</a></li> </ul> </li> </ul> @@ -668,7 +655,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <div class="sect2"> <h3 id="_version_information"><a class="anchor" href="#_version_information"></a><a class="link" href="#_version_information">1.1. Version information</a></h3> <div class="paragraph"> -<p><em>Version</em> : 3.0.3-SNAPSHOT</p> +<p><em>Version</em> : 4.0.0-SNAPSHOT</p> </div> </div> <div class="sect2"> @@ -685,7 +672,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <h2 id="_paths"><a class="anchor" href="#_paths"></a><a class="link" href="#_paths">2. Paths</a></h2> <div class="sectionbody"> <div class="sect2"> -<h3 id="_route10"><a class="anchor" href="#_route10"></a><a class="link" href="#_route10">2.1. PUT /clds/action/{action}/{modelName}?test={test}</a></h3> +<h3 id="_route66"><a class="anchor" href="#_route66"></a><a class="link" href="#_route66">2.1. PUT /clds/action/{action}/{modelName}?test={test}</a></h3> <div class="sect3"> <h4 id="_parameters"><a class="anchor" href="#_parameters"></a><a class="link" href="#_parameters">2.1.1. Parameters</a></h4> <table class="tableblock frame-all grid-all spread"> @@ -766,7 +753,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route2"><a class="anchor" href="#_route2"></a><a class="link" href="#_route2">2.2. GET /clds/cldsDetails</a></h3> +<h3 id="_route58"><a class="anchor" href="#_route58"></a><a class="link" href="#_route58">2.2. GET /clds/cldsDetails</a></h3> <div class="sect3"> <h4 id="_responses_2"><a class="anchor" href="#_responses_2"></a><a class="link" href="#_responses_2">2.2.1. Responses</a></h4> <table class="tableblock frame-all grid-all spread"> @@ -803,7 +790,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route3"><a class="anchor" href="#_route3"></a><a class="link" href="#_route3">2.3. GET /clds/cldsInfo</a></h3> +<h3 id="_route59"><a class="anchor" href="#_route59"></a><a class="link" href="#_route59">2.3. GET /clds/cldsInfo</a></h3> <div class="sect3"> <h4 id="_responses_3"><a class="anchor" href="#_responses_3"></a><a class="link" href="#_responses_3">2.3.1. Responses</a></h4> <table class="tableblock frame-all grid-all spread"> @@ -840,7 +827,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route11"><a class="anchor" href="#_route11"></a><a class="link" href="#_route11">2.4. POST /clds/dcae/event?test={test}</a></h3> +<h3 id="_route67"><a class="anchor" href="#_route67"></a><a class="link" href="#_route67">2.4. POST /clds/dcae/event?test={test}</a></h3> <div class="sect3"> <h4 id="_parameters_2"><a class="anchor" href="#_parameters_2"></a><a class="link" href="#_parameters_2">2.4.1. Parameters</a></h4> <table class="tableblock frame-all grid-all spread"> @@ -909,7 +896,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route15"><a class="anchor" href="#_route15"></a><a class="link" href="#_route15">2.5. PUT /clds/deploy/{modelName}</a></h3> +<h3 id="_route69"><a class="anchor" href="#_route69"></a><a class="link" href="#_route69">2.5. PUT /clds/deploy/{modelName}</a></h3> <div class="sect3"> <h4 id="_parameters_3"><a class="anchor" href="#_parameters_3"></a><a class="link" href="#_parameters_3">2.5.1. Parameters</a></h4> <table class="tableblock frame-all grid-all spread"> @@ -984,7 +971,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route9"><a class="anchor" href="#_route9"></a><a class="link" href="#_route9">2.6. GET /clds/model-names</a></h3> +<h3 id="_route65"><a class="anchor" href="#_route65"></a><a class="link" href="#_route65">2.6. GET /clds/model-names</a></h3> <div class="sect3"> <h4 id="_responses_6"><a class="anchor" href="#_responses_6"></a><a class="link" href="#_responses_6">2.6.1. Responses</a></h4> <table class="tableblock frame-all grid-all spread"> @@ -1021,7 +1008,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route5"><a class="anchor" href="#_route5"></a><a class="link" href="#_route5">2.7. GET /clds/model/bpmn/{modelName}</a></h3> +<h3 id="_route61"><a class="anchor" href="#_route61"></a><a class="link" href="#_route61">2.7. GET /clds/model/bpmn/{modelName}</a></h3> <div class="sect3"> <h4 id="_parameters_4"><a class="anchor" href="#_parameters_4"></a><a class="link" href="#_parameters_4">2.7.1. Parameters</a></h4> <table class="tableblock frame-all grid-all spread"> @@ -1080,7 +1067,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route6"><a class="anchor" href="#_route6"></a><a class="link" href="#_route6">2.8. GET /clds/model/image/{modelName}</a></h3> +<h3 id="_route62"><a class="anchor" href="#_route62"></a><a class="link" href="#_route62">2.8. GET /clds/model/image/{modelName}</a></h3> <div class="sect3"> <h4 id="_parameters_5"><a class="anchor" href="#_parameters_5"></a><a class="link" href="#_parameters_5">2.8.1. Parameters</a></h4> <table class="tableblock frame-all grid-all spread"> @@ -1139,7 +1126,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route7"><a class="anchor" href="#_route7"></a><a class="link" href="#_route7">2.9. GET /clds/model/{modelName}</a></h3> +<h3 id="_route63"><a class="anchor" href="#_route63"></a><a class="link" href="#_route63">2.9. GET /clds/model/{modelName}</a></h3> <div class="sect3"> <h4 id="_parameters_6"><a class="anchor" href="#_parameters_6"></a><a class="link" href="#_parameters_6">2.9.1. Parameters</a></h4> <table class="tableblock frame-all grid-all spread"> @@ -1201,7 +1188,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route8"><a class="anchor" href="#_route8"></a><a class="link" href="#_route8">2.10. PUT /clds/model/{modelName}</a></h3> +<h3 id="_route64"><a class="anchor" href="#_route64"></a><a class="link" href="#_route64">2.10. PUT /clds/model/{modelName}</a></h3> <div class="sect3"> <h4 id="_parameters_7"><a class="anchor" href="#_parameters_7"></a><a class="link" href="#_parameters_7">2.10.1. Parameters</a></h4> <table class="tableblock frame-all grid-all spread"> @@ -1279,7 +1266,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route13"><a class="anchor" href="#_route13"></a><a class="link" href="#_route13">2.11. GET /clds/properties</a></h3> +<h3 id="_route68"><a class="anchor" href="#_route68"></a><a class="link" href="#_route68">2.11. GET /clds/properties</a></h3> <div class="sect3"> <h4 id="_responses_11"><a class="anchor" href="#_responses_11"></a><a class="link" href="#_responses_11">2.11.1. Responses</a></h4> <table class="tableblock frame-all grid-all spread"> @@ -1313,7 +1300,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route14"><a class="anchor" href="#_route14"></a><a class="link" href="#_route14">2.12. GET /clds/properties/{serviceInvariantUUID}?refresh={refresh}</a></h3> +<h3 id="_route70"><a class="anchor" href="#_route70"></a><a class="link" href="#_route70">2.12. PUT /clds/undeploy/{modelName}</a></h3> <div class="sect3"> <h4 id="_parameters_8"><a class="anchor" href="#_parameters_8"></a><a class="link" href="#_parameters_8">2.12.1. Parameters</a></h4> <table class="tableblock frame-all grid-all spread"> @@ -1332,99 +1319,6 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <tbody> <tr> <td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Path</strong></p></td> -<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>serviceInvariantUUID}?refresh={refresh</strong><br> -<em>required</em></p></td> -<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td> -</tr> -</tbody> -</table> -</div> -<div class="sect3"> -<h4 id="_responses_12"><a class="anchor" href="#_responses_12"></a><a class="link" href="#_responses_12">2.12.2. Responses</a></h4> -<table class="tableblock frame-all grid-all spread"> -<colgroup> -<col style="width: 33.3333%;"> -<col style="width: 66.6667%;"> -</colgroup> -<thead> -<tr> -<th class="tableblock halign-left valign-middle">HTTP Code</th> -<th class="tableblock halign-left valign-middle">Schema</th> -</tr> -</thead> -<tbody> -<tr> -<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>200</strong></p></td> -<td class="tableblock halign-left valign-middle"><p class="tableblock">No Content</p></td> -</tr> -</tbody> -</table> -</div> -<div class="sect3"> -<h4 id="_produces_12"><a class="anchor" href="#_produces_12"></a><a class="link" href="#_produces_12">2.12.3. Produces</a></h4> -<div class="ulist"> -<ul> -<li> -<p><code>application/json</code></p> -</li> -</ul> -</div> -</div> -</div> -<div class="sect2"> -<h3 id="_route12"><a class="anchor" href="#_route12"></a><a class="link" href="#_route12">2.13. GET /clds/sdc/services</a></h3> -<div class="sect3"> -<h4 id="_responses_13"><a class="anchor" href="#_responses_13"></a><a class="link" href="#_responses_13">2.13.1. Responses</a></h4> -<table class="tableblock frame-all grid-all spread"> -<colgroup> -<col style="width: 33.3333%;"> -<col style="width: 66.6667%;"> -</colgroup> -<thead> -<tr> -<th class="tableblock halign-left valign-middle">HTTP Code</th> -<th class="tableblock halign-left valign-middle">Schema</th> -</tr> -</thead> -<tbody> -<tr> -<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>200</strong></p></td> -<td class="tableblock halign-left valign-middle"><p class="tableblock">No Content</p></td> -</tr> -</tbody> -</table> -</div> -<div class="sect3"> -<h4 id="_produces_13"><a class="anchor" href="#_produces_13"></a><a class="link" href="#_produces_13">2.13.2. Produces</a></h4> -<div class="ulist"> -<ul> -<li> -<p><code>application/json</code></p> -</li> -</ul> -</div> -</div> -</div> -<div class="sect2"> -<h3 id="_route16"><a class="anchor" href="#_route16"></a><a class="link" href="#_route16">2.14. PUT /clds/undeploy/{modelName}</a></h3> -<div class="sect3"> -<h4 id="_parameters_9"><a class="anchor" href="#_parameters_9"></a><a class="link" href="#_parameters_9">2.14.1. Parameters</a></h4> -<table class="tableblock frame-all grid-all spread"> -<colgroup> -<col style="width: 22.2222%;"> -<col style="width: 33.3333%;"> -<col style="width: 44.4445%;"> -</colgroup> -<thead> -<tr> -<th class="tableblock halign-left valign-middle">Type</th> -<th class="tableblock halign-left valign-middle">Name</th> -<th class="tableblock halign-left valign-middle">Schema</th> -</tr> -</thead> -<tbody> -<tr> -<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Path</strong></p></td> <td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>modelName</strong><br> <em>required</em></p></td> <td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td> @@ -1439,7 +1333,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_responses_14"><a class="anchor" href="#_responses_14"></a><a class="link" href="#_responses_14">2.14.2. Responses</a></h4> +<h4 id="_responses_12"><a class="anchor" href="#_responses_12"></a><a class="link" href="#_responses_12">2.12.2. Responses</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 33.3333%;"> @@ -1460,7 +1354,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_consumes_5"><a class="anchor" href="#_consumes_5"></a><a class="link" href="#_consumes_5">2.14.3. Consumes</a></h4> +<h4 id="_consumes_5"><a class="anchor" href="#_consumes_5"></a><a class="link" href="#_consumes_5">2.12.3. Consumes</a></h4> <div class="ulist"> <ul> <li> @@ -1470,7 +1364,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect3"> -<h4 id="_produces_14"><a class="anchor" href="#_produces_14"></a><a class="link" href="#_produces_14">2.14.4. Produces</a></h4> +<h4 id="_produces_12"><a class="anchor" href="#_produces_12"></a><a class="link" href="#_produces_12">2.12.4. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -1481,9 +1375,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route21"><a class="anchor" href="#_route21"></a><a class="link" href="#_route21">2.15. GET /cldsTempate/template-names</a></h3> +<h3 id="_route75"><a class="anchor" href="#_route75"></a><a class="link" href="#_route75">2.13. GET /cldsTempate/template-names</a></h3> <div class="sect3"> -<h4 id="_responses_15"><a class="anchor" href="#_responses_15"></a><a class="link" href="#_responses_15">2.15.1. Responses</a></h4> +<h4 id="_responses_13"><a class="anchor" href="#_responses_13"></a><a class="link" href="#_responses_13">2.13.1. Responses</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 10%;"> @@ -1507,7 +1401,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_produces_15"><a class="anchor" href="#_produces_15"></a><a class="link" href="#_produces_15">2.15.2. Produces</a></h4> +<h4 id="_produces_13"><a class="anchor" href="#_produces_13"></a><a class="link" href="#_produces_13">2.13.2. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -1518,9 +1412,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route17"><a class="anchor" href="#_route17"></a><a class="link" href="#_route17">2.16. GET /cldsTempate/template/bpmn/{templateName}</a></h3> +<h3 id="_route71"><a class="anchor" href="#_route71"></a><a class="link" href="#_route71">2.14. GET /cldsTempate/template/bpmn/{templateName}</a></h3> <div class="sect3"> -<h4 id="_parameters_10"><a class="anchor" href="#_parameters_10"></a><a class="link" href="#_parameters_10">2.16.1. Parameters</a></h4> +<h4 id="_parameters_9"><a class="anchor" href="#_parameters_9"></a><a class="link" href="#_parameters_9">2.14.1. Parameters</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 22.2222%;"> @@ -1545,7 +1439,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_responses_16"><a class="anchor" href="#_responses_16"></a><a class="link" href="#_responses_16">2.16.2. Responses</a></h4> +<h4 id="_responses_14"><a class="anchor" href="#_responses_14"></a><a class="link" href="#_responses_14">2.14.2. Responses</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 33.3333%;"> @@ -1566,7 +1460,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_produces_16"><a class="anchor" href="#_produces_16"></a><a class="link" href="#_produces_16">2.16.3. Produces</a></h4> +<h4 id="_produces_14"><a class="anchor" href="#_produces_14"></a><a class="link" href="#_produces_14">2.14.3. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -1577,9 +1471,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route18"><a class="anchor" href="#_route18"></a><a class="link" href="#_route18">2.17. GET /cldsTempate/template/image/{templateName}</a></h3> +<h3 id="_route72"><a class="anchor" href="#_route72"></a><a class="link" href="#_route72">2.15. GET /cldsTempate/template/image/{templateName}</a></h3> <div class="sect3"> -<h4 id="_parameters_11"><a class="anchor" href="#_parameters_11"></a><a class="link" href="#_parameters_11">2.17.1. Parameters</a></h4> +<h4 id="_parameters_10"><a class="anchor" href="#_parameters_10"></a><a class="link" href="#_parameters_10">2.15.1. Parameters</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 22.2222%;"> @@ -1604,7 +1498,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_responses_17"><a class="anchor" href="#_responses_17"></a><a class="link" href="#_responses_17">2.17.2. Responses</a></h4> +<h4 id="_responses_15"><a class="anchor" href="#_responses_15"></a><a class="link" href="#_responses_15">2.15.2. Responses</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 33.3333%;"> @@ -1625,7 +1519,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_produces_17"><a class="anchor" href="#_produces_17"></a><a class="link" href="#_produces_17">2.17.3. Produces</a></h4> +<h4 id="_produces_15"><a class="anchor" href="#_produces_15"></a><a class="link" href="#_produces_15">2.15.3. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -1636,9 +1530,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route19"><a class="anchor" href="#_route19"></a><a class="link" href="#_route19">2.18. GET /cldsTempate/template/{templateName}</a></h3> +<h3 id="_route73"><a class="anchor" href="#_route73"></a><a class="link" href="#_route73">2.16. GET /cldsTempate/template/{templateName}</a></h3> <div class="sect3"> -<h4 id="_parameters_12"><a class="anchor" href="#_parameters_12"></a><a class="link" href="#_parameters_12">2.18.1. Parameters</a></h4> +<h4 id="_parameters_11"><a class="anchor" href="#_parameters_11"></a><a class="link" href="#_parameters_11">2.16.1. Parameters</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 22.2222%;"> @@ -1663,7 +1557,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_responses_18"><a class="anchor" href="#_responses_18"></a><a class="link" href="#_responses_18">2.18.2. Responses</a></h4> +<h4 id="_responses_16"><a class="anchor" href="#_responses_16"></a><a class="link" href="#_responses_16">2.16.2. Responses</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 10%;"> @@ -1687,7 +1581,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_produces_18"><a class="anchor" href="#_produces_18"></a><a class="link" href="#_produces_18">2.18.3. Produces</a></h4> +<h4 id="_produces_16"><a class="anchor" href="#_produces_16"></a><a class="link" href="#_produces_16">2.16.3. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -1698,9 +1592,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route20"><a class="anchor" href="#_route20"></a><a class="link" href="#_route20">2.19. PUT /cldsTempate/template/{templateName}</a></h3> +<h3 id="_route74"><a class="anchor" href="#_route74"></a><a class="link" href="#_route74">2.17. PUT /cldsTempate/template/{templateName}</a></h3> <div class="sect3"> -<h4 id="_parameters_13"><a class="anchor" href="#_parameters_13"></a><a class="link" href="#_parameters_13">2.19.1. Parameters</a></h4> +<h4 id="_parameters_12"><a class="anchor" href="#_parameters_12"></a><a class="link" href="#_parameters_12">2.17.1. Parameters</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 22.2222%;"> @@ -1731,7 +1625,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_responses_19"><a class="anchor" href="#_responses_19"></a><a class="link" href="#_responses_19">2.19.2. Responses</a></h4> +<h4 id="_responses_17"><a class="anchor" href="#_responses_17"></a><a class="link" href="#_responses_17">2.17.2. Responses</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 10%;"> @@ -1755,7 +1649,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_consumes_6"><a class="anchor" href="#_consumes_6"></a><a class="link" href="#_consumes_6">2.19.3. Consumes</a></h4> +<h4 id="_consumes_6"><a class="anchor" href="#_consumes_6"></a><a class="link" href="#_consumes_6">2.17.3. Consumes</a></h4> <div class="ulist"> <ul> <li> @@ -1765,7 +1659,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect3"> -<h4 id="_produces_19"><a class="anchor" href="#_produces_19"></a><a class="link" href="#_produces_19">2.19.4. Produces</a></h4> +<h4 id="_produces_17"><a class="anchor" href="#_produces_17"></a><a class="link" href="#_produces_17">2.17.4. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -1776,9 +1670,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route27"><a class="anchor" href="#_route27"></a><a class="link" href="#_route27">2.20. GET /dictionary</a></h3> +<h3 id="_route81"><a class="anchor" href="#_route81"></a><a class="link" href="#_route81">2.18. GET /dictionary</a></h3> <div class="sect3"> -<h4 id="_responses_20"><a class="anchor" href="#_responses_20"></a><a class="link" href="#_responses_20">2.20.1. Responses</a></h4> +<h4 id="_responses_18"><a class="anchor" href="#_responses_18"></a><a class="link" href="#_responses_18">2.18.1. Responses</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 10%;"> @@ -1802,7 +1696,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_produces_20"><a class="anchor" href="#_produces_20"></a><a class="link" href="#_produces_20">2.20.2. Produces</a></h4> +<h4 id="_produces_18"><a class="anchor" href="#_produces_18"></a><a class="link" href="#_produces_18">2.18.2. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -1813,9 +1707,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route26"><a class="anchor" href="#_route26"></a><a class="link" href="#_route26">2.21. PUT /dictionary/{dictionaryName}</a></h3> +<h3 id="_route80"><a class="anchor" href="#_route80"></a><a class="link" href="#_route80">2.19. PUT /dictionary/{dictionaryName}</a></h3> <div class="sect3"> -<h4 id="_parameters_14"><a class="anchor" href="#_parameters_14"></a><a class="link" href="#_parameters_14">2.21.1. Parameters</a></h4> +<h4 id="_parameters_13"><a class="anchor" href="#_parameters_13"></a><a class="link" href="#_parameters_13">2.19.1. Parameters</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 22.2222%;"> @@ -1846,7 +1740,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_responses_21"><a class="anchor" href="#_responses_21"></a><a class="link" href="#_responses_21">2.21.2. Responses</a></h4> +<h4 id="_responses_19"><a class="anchor" href="#_responses_19"></a><a class="link" href="#_responses_19">2.19.2. Responses</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 10%;"> @@ -1870,7 +1764,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_consumes_7"><a class="anchor" href="#_consumes_7"></a><a class="link" href="#_consumes_7">2.21.3. Consumes</a></h4> +<h4 id="_consumes_7"><a class="anchor" href="#_consumes_7"></a><a class="link" href="#_consumes_7">2.19.3. Consumes</a></h4> <div class="ulist"> <ul> <li> @@ -1880,7 +1774,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect3"> -<h4 id="_produces_21"><a class="anchor" href="#_produces_21"></a><a class="link" href="#_produces_21">2.21.4. Produces</a></h4> +<h4 id="_produces_19"><a class="anchor" href="#_produces_19"></a><a class="link" href="#_produces_19">2.19.4. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -1891,9 +1785,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route29"><a class="anchor" href="#_route29"></a><a class="link" href="#_route29">2.22. GET /dictionary/{dictionaryName}/items</a></h3> +<h3 id="_route83"><a class="anchor" href="#_route83"></a><a class="link" href="#_route83">2.20. GET /dictionary/{dictionaryName}/items</a></h3> <div class="sect3"> -<h4 id="_parameters_15"><a class="anchor" href="#_parameters_15"></a><a class="link" href="#_parameters_15">2.22.1. Parameters</a></h4> +<h4 id="_parameters_14"><a class="anchor" href="#_parameters_14"></a><a class="link" href="#_parameters_14">2.20.1. Parameters</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 22.2222%;"> @@ -1918,7 +1812,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_responses_22"><a class="anchor" href="#_responses_22"></a><a class="link" href="#_responses_22">2.22.2. Responses</a></h4> +<h4 id="_responses_20"><a class="anchor" href="#_responses_20"></a><a class="link" href="#_responses_20">2.20.2. Responses</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 10%;"> @@ -1942,7 +1836,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_produces_22"><a class="anchor" href="#_produces_22"></a><a class="link" href="#_produces_22">2.22.3. Produces</a></h4> +<h4 id="_produces_20"><a class="anchor" href="#_produces_20"></a><a class="link" href="#_produces_20">2.20.3. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -1953,9 +1847,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route28"><a class="anchor" href="#_route28"></a><a class="link" href="#_route28">2.23. PUT /dictionary/{dictionaryName}/items</a></h3> +<h3 id="_route82"><a class="anchor" href="#_route82"></a><a class="link" href="#_route82">2.21. PUT /dictionary/{dictionaryName}/items</a></h3> <div class="sect3"> -<h4 id="_parameters_16"><a class="anchor" href="#_parameters_16"></a><a class="link" href="#_parameters_16">2.23.1. Parameters</a></h4> +<h4 id="_parameters_15"><a class="anchor" href="#_parameters_15"></a><a class="link" href="#_parameters_15">2.21.1. Parameters</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 22.2222%;"> @@ -1986,7 +1880,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_responses_23"><a class="anchor" href="#_responses_23"></a><a class="link" href="#_responses_23">2.23.2. Responses</a></h4> +<h4 id="_responses_21"><a class="anchor" href="#_responses_21"></a><a class="link" href="#_responses_21">2.21.2. Responses</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 10%;"> @@ -2010,7 +1904,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_consumes_8"><a class="anchor" href="#_consumes_8"></a><a class="link" href="#_consumes_8">2.23.3. Consumes</a></h4> +<h4 id="_consumes_8"><a class="anchor" href="#_consumes_8"></a><a class="link" href="#_consumes_8">2.21.3. Consumes</a></h4> <div class="ulist"> <ul> <li> @@ -2020,7 +1914,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect3"> -<h4 id="_produces_23"><a class="anchor" href="#_produces_23"></a><a class="link" href="#_produces_23">2.23.4. Produces</a></h4> +<h4 id="_produces_21"><a class="anchor" href="#_produces_21"></a><a class="link" href="#_produces_21">2.21.4. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -2031,9 +1925,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route4"><a class="anchor" href="#_route4"></a><a class="link" href="#_route4">2.24. GET /healthcheck</a></h3> +<h3 id="_route60"><a class="anchor" href="#_route60"></a><a class="link" href="#_route60">2.22. GET /healthcheck</a></h3> <div class="sect3"> -<h4 id="_responses_24"><a class="anchor" href="#_responses_24"></a><a class="link" href="#_responses_24">2.24.1. Responses</a></h4> +<h4 id="_responses_22"><a class="anchor" href="#_responses_22"></a><a class="link" href="#_responses_22">2.22.1. Responses</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 33.3333%;"> @@ -2054,7 +1948,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_produces_24"><a class="anchor" href="#_produces_24"></a><a class="link" href="#_produces_24">2.24.2. Produces</a></h4> +<h4 id="_produces_22"><a class="anchor" href="#_produces_22"></a><a class="link" href="#_produces_22">2.22.2. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -2065,9 +1959,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route24"><a class="anchor" href="#_route24"></a><a class="link" href="#_route24">2.25. GET /tosca/models</a></h3> +<h3 id="_route78"><a class="anchor" href="#_route78"></a><a class="link" href="#_route78">2.23. GET /tosca/models</a></h3> <div class="sect3"> -<h4 id="_responses_25"><a class="anchor" href="#_responses_25"></a><a class="link" href="#_responses_25">2.25.1. Responses</a></h4> +<h4 id="_responses_23"><a class="anchor" href="#_responses_23"></a><a class="link" href="#_responses_23">2.23.1. Responses</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 10%;"> @@ -2091,7 +1985,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_produces_25"><a class="anchor" href="#_produces_25"></a><a class="link" href="#_produces_25">2.25.2. Produces</a></h4> +<h4 id="_produces_23"><a class="anchor" href="#_produces_23"></a><a class="link" href="#_produces_23">2.23.2. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -2102,9 +1996,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route23"><a class="anchor" href="#_route23"></a><a class="link" href="#_route23">2.26. GET /tosca/models/policyType/{policyType}</a></h3> +<h3 id="_route77"><a class="anchor" href="#_route77"></a><a class="link" href="#_route77">2.24. GET /tosca/models/policyType/{policyType}</a></h3> <div class="sect3"> -<h4 id="_parameters_17"><a class="anchor" href="#_parameters_17"></a><a class="link" href="#_parameters_17">2.26.1. Parameters</a></h4> +<h4 id="_parameters_16"><a class="anchor" href="#_parameters_16"></a><a class="link" href="#_parameters_16">2.24.1. Parameters</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 22.2222%;"> @@ -2129,7 +2023,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_responses_26"><a class="anchor" href="#_responses_26"></a><a class="link" href="#_responses_26">2.26.2. Responses</a></h4> +<h4 id="_responses_24"><a class="anchor" href="#_responses_24"></a><a class="link" href="#_responses_24">2.24.2. Responses</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 33.3333%;"> @@ -2150,7 +2044,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_produces_26"><a class="anchor" href="#_produces_26"></a><a class="link" href="#_produces_26">2.26.3. Produces</a></h4> +<h4 id="_produces_24"><a class="anchor" href="#_produces_24"></a><a class="link" href="#_produces_24">2.24.3. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -2161,9 +2055,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route25"><a class="anchor" href="#_route25"></a><a class="link" href="#_route25">2.27. GET /tosca/models/{toscaModelName}</a></h3> +<h3 id="_route79"><a class="anchor" href="#_route79"></a><a class="link" href="#_route79">2.25. GET /tosca/models/{toscaModelName}</a></h3> <div class="sect3"> -<h4 id="_parameters_18"><a class="anchor" href="#_parameters_18"></a><a class="link" href="#_parameters_18">2.27.1. Parameters</a></h4> +<h4 id="_parameters_17"><a class="anchor" href="#_parameters_17"></a><a class="link" href="#_parameters_17">2.25.1. Parameters</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 22.2222%;"> @@ -2188,7 +2082,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_responses_27"><a class="anchor" href="#_responses_27"></a><a class="link" href="#_responses_27">2.27.2. Responses</a></h4> +<h4 id="_responses_25"><a class="anchor" href="#_responses_25"></a><a class="link" href="#_responses_25">2.25.2. Responses</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 10%;"> @@ -2212,7 +2106,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_produces_27"><a class="anchor" href="#_produces_27"></a><a class="link" href="#_produces_27">2.27.3. Produces</a></h4> +<h4 id="_produces_25"><a class="anchor" href="#_produces_25"></a><a class="link" href="#_produces_25">2.25.3. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -2223,9 +2117,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route22"><a class="anchor" href="#_route22"></a><a class="link" href="#_route22">2.28. PUT /tosca/models/{toscaModelName}</a></h3> +<h3 id="_route76"><a class="anchor" href="#_route76"></a><a class="link" href="#_route76">2.26. PUT /tosca/models/{toscaModelName}</a></h3> <div class="sect3"> -<h4 id="_parameters_19"><a class="anchor" href="#_parameters_19"></a><a class="link" href="#_parameters_19">2.28.1. Parameters</a></h4> +<h4 id="_parameters_18"><a class="anchor" href="#_parameters_18"></a><a class="link" href="#_parameters_18">2.26.1. Parameters</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 22.2222%;"> @@ -2256,7 +2150,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_responses_28"><a class="anchor" href="#_responses_28"></a><a class="link" href="#_responses_28">2.28.2. Responses</a></h4> +<h4 id="_responses_26"><a class="anchor" href="#_responses_26"></a><a class="link" href="#_responses_26">2.26.2. Responses</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 33.3333%;"> @@ -2277,7 +2171,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_consumes_9"><a class="anchor" href="#_consumes_9"></a><a class="link" href="#_consumes_9">2.28.3. Consumes</a></h4> +<h4 id="_consumes_9"><a class="anchor" href="#_consumes_9"></a><a class="link" href="#_consumes_9">2.26.3. Consumes</a></h4> <div class="ulist"> <ul> <li> @@ -2287,7 +2181,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect3"> -<h4 id="_produces_28"><a class="anchor" href="#_produces_28"></a><a class="link" href="#_produces_28">2.28.4. Produces</a></h4> +<h4 id="_produces_26"><a class="anchor" href="#_produces_26"></a><a class="link" href="#_produces_26">2.26.4. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -2298,9 +2192,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route30"><a class="anchor" href="#_route30"></a><a class="link" href="#_route30">2.29. GET /user/getUser</a></h3> +<h3 id="_route84"><a class="anchor" href="#_route84"></a><a class="link" href="#_route84">2.27. GET /user/getUser</a></h3> <div class="sect3"> -<h4 id="_responses_29"><a class="anchor" href="#_responses_29"></a><a class="link" href="#_responses_29">2.29.1. Responses</a></h4> +<h4 id="_responses_27"><a class="anchor" href="#_responses_27"></a><a class="link" href="#_responses_27">2.27.1. Responses</a></h4> <table class="tableblock frame-all grid-all spread"> <colgroup> <col style="width: 33.3333%;"> @@ -2321,7 +2215,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_produces_29"><a class="anchor" href="#_produces_29"></a><a class="link" href="#_produces_29">2.29.2. Produces</a></h4> +<h4 id="_produces_27"><a class="anchor" href="#_produces_27"></a><a class="link" href="#_produces_27">2.27.2. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -2728,6 +2622,11 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td> </tr> <tr> +<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>modelId</strong><br> +<em>optional</em></p></td> +<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td> +</tr> +<tr> <td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>modelName</strong><br> <em>optional</em></p></td> <td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td> @@ -2988,7 +2887,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> <div id="footer"> <div id="footer-text"> -Last updated 2018-08-27 13:47:59 +02:00 +Last updated 2018-07-05 16:29:36 +02:00 </div> </div> </body> diff --git a/src/main/resources/application-noaaf.properties b/src/main/resources/application-noaaf.properties index 2d34fba7b..4dbcd4592 100644 --- a/src/main/resources/application-noaaf.properties +++ b/src/main/resources/application-noaaf.properties @@ -116,11 +116,6 @@ clamp.config.files.sdcController=classpath:/clds/sdc-controllers-config.json clamp.config.dcae.template=classpath:/clds/templates/dcae-template.json clamp.config.dcae.deployment.template=classpath:/clds/templates/dcae-deployment-template.json # -# SDC request blueprint properties -# -clamp.config.sdc.template=classpath:/clds/templates/sdc-template.json -clamp.config.sdc.decode.service_ids=classpath:/clds/templates/sdc-decode-service_ids.json -# # # Configuration Settings for Policy Engine Components clamp.config.policy.pdpUrl1=http://policy.api.simpledemo.onap.org:8081/pdp/ , testpdp, alpha123 @@ -171,18 +166,6 @@ clamp.config.op.controller=amsterdam clamp.config.op.policy.appc=APPC # # Sdc service properties -clamp.config.sdc.catalog.url=http://sdc.api.simpledemo.onap.org:8080/sdc/v1/catalog/ -clamp.config.sdc.hostUrl=http://sdc.api.simpledemo.onap.org:8080 -clamp.config.sdc.serviceUrl=http://sdc.api.simpledemo.onap.org:8080/sdc/v1/catalog/services -clamp.config.sdc.serviceUsername=clamp -clamp.config.sdc.servicePassword=b7acccda32b98c5bb7acccda32b98c5b05D511BD6D93626E90D18E9D24D9B78CD34C7EE8012F0A189A28763E82271E50A5D4EC10C7D93E06E0A2D27CAE66B981 -clamp.config.sdc.artifactLabel=blueprintclampcockpit -clamp.config.sdc.sdcX-InstanceID=CLAMP -clamp.config.sdc.artifactType=DCAE_INVENTORY_BLUEPRINT -clamp.config.sdc.locationArtifactLabel=locationclampcockpit -clamp.config.sdc.locationArtifactType=DCAE_INVENTORY_JSON -clamp.config.sdc.InstanceID=X-ECOMP-InstanceID -clamp.config.sdc.header.requestId = X-ECOMP-RequestID # clamp.config.sdc.csarFolder = /tmp/sdc-controllers clamp.config.sdc.blueprint.parser.mapping = classpath:/clds/blueprint-parser-mapping.json diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 91a4cab71..9852dc8c8 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -134,11 +134,6 @@ clamp.config.files.sdcController=classpath:/clds/sdc-controllers-config.json clamp.config.dcae.template=classpath:/clds/templates/dcae-template.json clamp.config.dcae.deployment.template=classpath:/clds/templates/dcae-deployment-template.json # -# SDC request blueprint properties -# -clamp.config.sdc.template=classpath:/clds/templates/sdc-template.json -clamp.config.sdc.decode.service_ids=classpath:/clds/templates/sdc-decode-service_ids.json -# # # Configuration Settings for Policy Engine Components clamp.config.policy.pdpUrl1=http://policy.api.simpledemo.onap.org:8081/pdp/ , testpdp, alpha123 @@ -189,19 +184,6 @@ clamp.config.op.controller=amsterdam clamp.config.op.policy.appc=APPC # # Sdc service properties -clamp.config.sdc.catalog.url=http://sdc.api.simpledemo.onap.org:8080/sdc/v1/catalog/ -clamp.config.sdc.hostUrl=http://sdc.api.simpledemo.onap.org:8080 -clamp.config.sdc.serviceUrl=http://sdc.api.simpledemo.onap.org:8080/sdc/v1/catalog/services -clamp.config.sdc.serviceUsername=clamp -clamp.config.sdc.servicePassword=b7acccda32b98c5bb7acccda32b98c5b05D511BD6D93626E90D18E9D24D9B78CD34C7EE8012F0A189A28763E82271E50A5D4EC10C7D93E06E0A2D27CAE66B981 -clamp.config.sdc.artifactLabel=blueprintclampcockpit -clamp.config.sdc.sdcX-InstanceID=CLAMP -clamp.config.sdc.artifactType=DCAE_INVENTORY_BLUEPRINT -clamp.config.sdc.locationArtifactLabel=locationclampcockpit -clamp.config.sdc.locationArtifactType=DCAE_INVENTORY_JSON -clamp.config.sdc.InstanceID=X-ECOMP-InstanceID -clamp.config.sdc.header.requestId = X-ECOMP-RequestID -# clamp.config.sdc.csarFolder = /tmp/sdc-controllers clamp.config.sdc.blueprint.parser.mapping = classpath:/clds/blueprint-parser-mapping.json # diff --git a/src/main/resources/clds/camel/rest/clds-services.xml b/src/main/resources/clds/camel/rest/clds-services.xml index 476816977..e4c4f4cbc 100644 --- a/src/main/resources/clds/camel/rest/clds-services.xml +++ b/src/main/resources/clds/camel/rest/clds-services.xml @@ -56,20 +56,10 @@ <to uri="bean:org.onap.clamp.clds.service.CldsService?method=postDcaeEvent(${header.test},${body})" /> </post> - <get uri="/clds/sdc/services" produces="application/json"> - <to - uri="bean:org.onap.clamp.clds.service.CldsService?method=getSdcServices()" /> - </get> <get uri="/clds/properties" produces="application/json"> <to uri="bean:org.onap.clamp.clds.service.CldsService?method=getSdcProperties()" /> </get> - <get - uri="/clds/properties/{serviceInvariantUUID}?refresh={refresh}" - produces="application/json"> - <to - uri="bean:org.onap.clamp.clds.service.CldsService?method=getSdcPropertiesByServiceUUIDForRefresh(${header.serviceInvariantUUID},${header.refresh})" /> - </get> <put uri="/clds/deploy/{modelName}" type="org.onap.clamp.clds.model.CldsModel" consumes="application/json" produces="application/json"> diff --git a/src/main/resources/clds/templates/sdc-decode-service_ids.json b/src/main/resources/clds/templates/sdc-decode-service_ids.json deleted file mode 100644 index 9e26dfeeb..000000000 --- a/src/main/resources/clds/templates/sdc-decode-service_ids.json +++ /dev/null @@ -1 +0,0 @@ -{}
\ No newline at end of file diff --git a/src/main/resources/clds/templates/sdc-template.json b/src/main/resources/clds/templates/sdc-template.json deleted file mode 100644 index 9e26dfeeb..000000000 --- a/src/main/resources/clds/templates/sdc-template.json +++ /dev/null @@ -1 +0,0 @@ -{}
\ No newline at end of file diff --git a/src/test/java/org/onap/clamp/clds/it/CldsDaoItCase.java b/src/test/java/org/onap/clamp/clds/it/CldsDaoItCase.java index 12fa2932c..d4172c244 100644 --- a/src/test/java/org/onap/clamp/clds/it/CldsDaoItCase.java +++ b/src/test/java/org/onap/clamp/clds/it/CldsDaoItCase.java @@ -25,30 +25,24 @@ package org.onap.clamp.clds.it; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import java.io.IOException; -import java.security.GeneralSecurityException; import java.util.ArrayList; import java.util.List; import javax.ws.rs.NotFoundException; -import org.apache.commons.codec.DecoderException; import org.apache.commons.lang3.RandomStringUtils; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.clamp.clds.client.req.sdc.SdcCatalogServices; import org.onap.clamp.clds.dao.CldsDao; -import org.onap.clamp.clds.model.CldsDbServiceCache; import org.onap.clamp.clds.model.CldsEvent; import org.onap.clamp.clds.model.CldsModel; import org.onap.clamp.clds.model.CldsMonitoringDetails; -import org.onap.clamp.clds.model.CldsServiceData; import org.onap.clamp.clds.model.CldsTemplate; import org.onap.clamp.clds.util.ResourceFileUtil; import org.springframework.beans.factory.annotation.Autowired; @@ -69,8 +63,6 @@ public class CldsDaoItCase { private String bpmnText; private String imageText; private String bpmnPropText; - @Autowired - private SdcCatalogServices sdcCatalogServices; /** * Setup the variable before the tests execution. @@ -165,30 +157,4 @@ public class CldsDaoItCase { }); } - @Test - public void testCldsServiceCache() throws GeneralSecurityException, DecoderException, IOException { - CldsServiceData cldsServiceData = sdcCatalogServices - .getCldsServiceDataWithAlarmConditions("4cc5b45a-1f63-4194-8100-cd8e14248c92"); - // Test not in cache so should be null - CldsServiceData cldsServiceDataCache = cldsDao.getCldsServiceCache("4cc5b45a-1f63-4194-8100-cd8e14248c92"); - assertNull(cldsServiceDataCache); - cldsDao.setCldsServiceCache(new CldsDbServiceCache(cldsServiceData)); - cldsServiceDataCache = cldsDao.getCldsServiceCache("4cc5b45a-1f63-4194-8100-cd8e14248c92"); - assertNotNull(cldsServiceDataCache); - assertEquals("56441b4b-0467-41dc-9a0e-e68613838219", cldsServiceDataCache.getServiceUUID()); - assertEquals("4cc5b45a-1f63-4194-8100-cd8e14248c92", cldsServiceDataCache.getServiceInvariantUUID()); - assertEquals(2, cldsServiceDataCache.getCldsVfs().size()); - assertNotNull(cldsServiceDataCache.getAgeOfRecord()); - assertEquals(4, cldsServiceDataCache.getCldsVfs().get(0).getCldsVfcs().size()); - assertEquals("07e266fc-49ab-4cd7-8378-ca4676f1b9ec", - cldsServiceDataCache.getCldsVfs().get(0).getVfInvariantResourceUUID()); - assertEquals(0, cldsServiceDataCache.getCldsVfs().get(0).getCldsKPIList().size()); - // Second update - cldsServiceData.setCldsVfs(null); - cldsDao.setCldsServiceCache(new CldsDbServiceCache(cldsServiceData)); - cldsServiceDataCache = cldsDao.getCldsServiceCache("4cc5b45a-1f63-4194-8100-cd8e14248c92"); - assertNotNull(cldsServiceDataCache); - assertNull(cldsServiceDataCache.getCldsVfs()); - cldsDao.clearServiceCache(); - } } diff --git a/src/test/java/org/onap/clamp/clds/it/CldsServiceItCase.java b/src/test/java/org/onap/clamp/clds/it/CldsServiceItCase.java index 6ab800b36..347de4a78 100644 --- a/src/test/java/org/onap/clamp/clds/it/CldsServiceItCase.java +++ b/src/test/java/org/onap/clamp/clds/it/CldsServiceItCase.java @@ -26,12 +26,10 @@ package org.onap.clamp.clds.it; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import java.io.IOException; import java.io.InputStream; -import java.security.GeneralSecurityException; import java.util.LinkedList; import java.util.List; import java.util.Properties; @@ -40,9 +38,7 @@ import javax.servlet.http.HttpServletRequest; import javax.ws.rs.NotFoundException; import javax.xml.transform.TransformerException; -import org.apache.commons.codec.DecoderException; import org.apache.commons.lang3.RandomStringUtils; -import org.json.JSONException; import org.json.simple.parser.ParseException; import org.junit.Before; import org.junit.Test; @@ -54,7 +50,6 @@ import org.onap.clamp.clds.model.CldsEvent; import org.onap.clamp.clds.model.CldsInfo; import org.onap.clamp.clds.model.CldsModel; import org.onap.clamp.clds.model.CldsMonitoringDetails; -import org.onap.clamp.clds.model.CldsServiceData; import org.onap.clamp.clds.model.CldsTemplate; import org.onap.clamp.clds.model.DcaeEvent; import org.onap.clamp.clds.service.CldsService; @@ -281,35 +276,4 @@ public class CldsServiceItCase { ResourceFileUtil.getResourceAsString("example/sdc/expected-result/sdc-properties-global.json"), cldsService.getSdcProperties(), true); } - - @Test - public void testGetSdcServices() throws GeneralSecurityException, DecoderException, JSONException, IOException { - String result = cldsService.getSdcServices(); - JSONAssert.assertEquals( - ResourceFileUtil.getResourceAsString("example/sdc/expected-result/all-sdc-services.json"), result, true); - } - - @Test - public void testGetSdcPropertiesByServiceUuidForRefresh() - throws GeneralSecurityException, DecoderException, JSONException, IOException { - SecurityContext securityContext = Mockito.mock(SecurityContext.class); - Mockito.when(securityContext.getAuthentication()).thenReturn(authentication); - - cldsService.setSecurityContext(securityContext); - // Test basic functionalities - String result = cldsService.getSdcPropertiesByServiceUUIDForRefresh("4cc5b45a-1f63-4194-8100-cd8e14248c92", - false); - JSONAssert.assertEquals( - ResourceFileUtil.getResourceAsString("example/sdc/expected-result/sdc-properties-4cc5b45a.json"), result, - true); - // Now test the Cache effect - CldsServiceData cldsServiceDataCache = cldsDao.getCldsServiceCache("c95b0e7c-c1f0-4287-9928-7964c5377a46"); - // Should not be there, so should be null - assertNull(cldsServiceDataCache); - cldsService.getSdcPropertiesByServiceUUIDForRefresh("c95b0e7c-c1f0-4287-9928-7964c5377a46", true); - // Should be there now, so should NOT be null - cldsServiceDataCache = cldsDao.getCldsServiceCache("c95b0e7c-c1f0-4287-9928-7964c5377a46"); - assertNotNull(cldsServiceDataCache); - cldsDao.clearServiceCache(); - } } diff --git a/src/test/java/org/onap/clamp/clds/it/SdcCatalogServicesItCase.java b/src/test/java/org/onap/clamp/clds/it/SdcCatalogServicesItCase.java deleted file mode 100644 index d36e14c2b..000000000 --- a/src/test/java/org/onap/clamp/clds/it/SdcCatalogServicesItCase.java +++ /dev/null @@ -1,305 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP CLAMP - * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END============================================ - * Modifications copyright (c) 2018 Nokia - * =================================================================== - * - */ - -package org.onap.clamp.clds.it; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertTrue; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -import org.apache.commons.io.IOUtils; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mockito; -import org.onap.clamp.clds.client.req.sdc.SdcCatalogServices; -import org.onap.clamp.clds.config.ClampProperties; -import org.onap.clamp.clds.model.CldsAlarmCondition; -import org.onap.clamp.clds.model.CldsServiceData; -import org.onap.clamp.clds.model.sdc.SdcResource; -import org.onap.clamp.clds.model.sdc.SdcResourceBasicInfo; -import org.onap.clamp.clds.model.sdc.SdcServiceInfo; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -/** - * Test SDC Catalog Service class by mocking the SDC answers. - */ -@RunWith(SpringRunner.class) -@SpringBootTest -public class SdcCatalogServicesItCase { - - @Autowired - private ClampProperties refProp; - @Autowired - private SdcCatalogServices sdcCatalogWired = new SdcCatalogServices(); - - @Test - public void removeDuplicateServicesTest() { - SdcServiceInfo service1a = new SdcServiceInfo(); - service1a.setName("service1"); - service1a.setVersion("1.0"); - service1a.setInvariantUUID("invariantUUID1.0"); - List<SdcServiceInfo> rawCldsSdcServiceList = new LinkedList<>(); - rawCldsSdcServiceList.add(service1a); - rawCldsSdcServiceList.add(service1a); - SdcServiceInfo service1b = new SdcServiceInfo(); - service1b.setName("service1"); - service1b.setVersion("1.1"); - service1b.setInvariantUUID("invariantUUID1.1"); - rawCldsSdcServiceList.add(service1b); - SdcServiceInfo service1c = new SdcServiceInfo(); - service1c.setName("service1"); - service1c.setVersion("1.2"); - service1c.setInvariantUUID("invariantUUID1.2"); - rawCldsSdcServiceList.add(service1c); - SdcServiceInfo service2 = new SdcServiceInfo(); - service2.setName("service2"); - service2.setVersion("1.0"); - service2.setInvariantUUID("invariantUUID2.0"); - rawCldsSdcServiceList.add(service2); - SdcCatalogServices catalogServices = new SdcCatalogServices(); - List<SdcServiceInfo> resultList = catalogServices.removeDuplicateServices(rawCldsSdcServiceList); - assertTrue(resultList.size() == 2); - SdcServiceInfo res1; - SdcServiceInfo res2; - if ("service1".equals(resultList.get(0).getName())) { - res1 = resultList.get(0); - res2 = resultList.get(1); - } else { - res1 = resultList.get(1); - res2 = resultList.get(0); - } - assertTrue("service1".equals(res1.getName())); - assertTrue("1.2".equals(res1.getVersion())); - assertTrue("service2".equals(res2.getName())); - assertTrue("1.0".equals(res2.getVersion())); - } - - @Test - public void removeDuplicateSdcResourceInstancesTest() { - List<SdcResource> rawCldsSdcResourceList = new LinkedList<>(); - SdcResource sdcResource1a = new SdcResource(); - sdcResource1a.setResourceInstanceName("resource1"); - sdcResource1a.setResourceVersion("1.0"); - rawCldsSdcResourceList.add(sdcResource1a); - SdcResource sdcResource1b = new SdcResource(); - sdcResource1b.setResourceInstanceName("resource1"); - sdcResource1b.setResourceVersion("1.1"); - rawCldsSdcResourceList.add(sdcResource1b); - SdcResource sdcResource1c = new SdcResource(); - sdcResource1c.setResourceInstanceName("resource1"); - sdcResource1c.setResourceVersion("1.2"); - rawCldsSdcResourceList.add(sdcResource1c); - SdcResource sdcResource2 = new SdcResource(); - sdcResource2.setResourceInstanceName("resource2"); - sdcResource2.setResourceVersion("1.0"); - rawCldsSdcResourceList.add(sdcResource2); - SdcCatalogServices catalogServices = new SdcCatalogServices(); - List<SdcResource> resultList = catalogServices.removeDuplicateSdcResourceInstances(rawCldsSdcResourceList); - SdcResource res1; - SdcResource res2; - if ("resource1".equals(resultList.get(0).getResourceInstanceName())) { - res1 = resultList.get(0); - res2 = resultList.get(1); - } else { - res1 = resultList.get(1); - res2 = resultList.get(0); - } - assertTrue("resource1".equals(res1.getResourceInstanceName())); - assertTrue("1.2".equals(res1.getResourceVersion())); - assertTrue("resource2".equals(res2.getResourceInstanceName())); - assertTrue("1.0".equals(res2.getResourceVersion())); - } - - @Test - public void removeDuplicateSdcResourceBasicInfoTest() { - List<SdcResourceBasicInfo> rawCldsSdcResourceList = new LinkedList<>(); - SdcResourceBasicInfo sdcResource1a = new SdcResourceBasicInfo(); - sdcResource1a.setName("resource1"); - sdcResource1a.setVersion("1.0"); - rawCldsSdcResourceList.add(sdcResource1a); - SdcResourceBasicInfo sdcResource1b = new SdcResourceBasicInfo(); - sdcResource1b.setName("resource1"); - sdcResource1b.setVersion("1.1"); - rawCldsSdcResourceList.add(sdcResource1b); - SdcResourceBasicInfo sdcResource1c = new SdcResourceBasicInfo(); - sdcResource1c.setName("resource1"); - sdcResource1c.setVersion("1.2"); - rawCldsSdcResourceList.add(sdcResource1c); - SdcResourceBasicInfo sdcResource2 = new SdcResourceBasicInfo(); - sdcResource2.setName("resource2"); - sdcResource2.setVersion("1.0"); - rawCldsSdcResourceList.add(sdcResource2); - SdcCatalogServices catalogServices = new SdcCatalogServices(); - List<SdcResourceBasicInfo> resultList = catalogServices - .removeDuplicateSdcResourceBasicInfo(rawCldsSdcResourceList); - SdcResourceBasicInfo res1; - SdcResourceBasicInfo res2; - if ("resource1".equals(resultList.get(0).getName())) { - res1 = resultList.get(0); - res2 = resultList.get(1); - } else { - res1 = resultList.get(1); - res2 = resultList.get(0); - } - assertTrue("resource1".equals(res1.getName())); - assertTrue("1.2".equals(res1.getVersion())); - assertTrue("resource2".equals(res2.getName())); - assertTrue("1.0".equals(res2.getVersion())); - } - - @Test - public void removeDuplicateSdcFunctionShouldNotReturnNull() { - // given - SdcCatalogServices catalogServices = new SdcCatalogServices(); - - // when - List<SdcResourceBasicInfo> firstResult = catalogServices.removeDuplicateSdcResourceBasicInfo(null); - List<SdcResourceBasicInfo> secondResult = catalogServices - .removeDuplicateSdcResourceBasicInfo(new ArrayList<>()); - - // then - assertThat(firstResult).isEmpty(); - assertThat(secondResult).isEmpty(); - } - - @Test - public void getServiceUuidFromServiceInvariantIdTest() throws Exception { - SdcCatalogServices spy = Mockito.spy(sdcCatalogWired); - Mockito.doReturn(IOUtils.toString( - SdcCatalogServicesItCase.class.getResourceAsStream("/example/sdc/sdcServicesListExample.json"), "UTF-8")) - .when(spy).getSdcServicesInformation(null); - // Try the vcts4 version 1.0, this one should be replaced by 1.1 so it - // should not exist, returning empty string - String resUuidVcts4Null = spy.getServiceUuidFromServiceInvariantId("a33ed748-3477-4434-b3f3-b5560f5e7d9b"); - assertTrue("".equals(resUuidVcts4Null)); - // Try the vcts4 version 1.1, this one should be there as it replaces - // the vcts4 v1.0 - String resUuidVcts4Latest = spy.getServiceUuidFromServiceInvariantId("a33ed748-3477-4434-b3f3-b5560f5e7d9c"); - assertTrue("29018914-966c-442d-9d08-251b9dc45b8f".equals(resUuidVcts4Latest)); - // Try the vcts5 version 1.0, this one should be there - String resUuidVcts5 = spy.getServiceUuidFromServiceInvariantId("a33ed748-3477-4434-b3f3-b5560f5e7d8c"); - assertTrue("29018914-966c-442d-9d08-251b9dc45b7f".equals(resUuidVcts5)); - // try one that does not exist at all - String resUuidUnknown = spy.getServiceUuidFromServiceInvariantId("testuuid"); - assertTrue("".equals(resUuidUnknown)); - } - - @Test - public void getCldsServiceDataWithAlarmConditionsTest() throws Exception { - SdcCatalogServices spy = Mockito.spy(sdcCatalogWired); - Mockito.doReturn(IOUtils.toString( - SdcCatalogServicesItCase.class.getResourceAsStream("/example/sdc/sdcServicesListExample.json"), "UTF-8")) - .when(spy).getSdcServicesInformation(null); - // This invariant uuid is the one from vcts4 v1.1 - String serviceResourceDetailUrl = refProp.getStringValue("sdc.serviceUrl") - + "/29018914-966c-442d-9d08-251b9dc45b8f/metadata"; - Mockito.doReturn(IOUtils.toString( - SdcCatalogServicesItCase.class.getResourceAsStream("/example/sdc/sdcServiceDetailsExample.json"), "UTF-8")) - .when(spy).getCldsServicesOrResourcesBasedOnURL(serviceResourceDetailUrl); - String resourceDetailUrl = refProp.getStringValue("sdc.catalog.url") - + "resources/585822c7-4027-4f84-ba50-e9248606f136/metadata"; - Mockito.doReturn(IOUtils.toString( - SdcCatalogServicesItCase.class.getResourceAsStream("/example/sdc/sdcResourceDetailsExample.json"), "UTF-8")) - .when(spy).getCldsServicesOrResourcesBasedOnURL(resourceDetailUrl); - String securityRulesDetailUrl = refProp.getStringValue("sdc.catalog.url") - + "resources/d57e57d2-e3c6-470d-8d16-e6ea05f536c5/metadata"; - Mockito - .doReturn(IOUtils.toString( - SdcCatalogServicesItCase.class.getResourceAsStream("/example/sdc/sdcSecurityRules.json"), "UTF-8")) - .when(spy).getCldsServicesOrResourcesBasedOnURL(securityRulesDetailUrl); - String cinderVolumeDetailUrl = refProp.getStringValue("sdc.catalog.url") - + "resources/b4288e07-597a-44a2-aa98-ad36e551a39d/metadata"; - Mockito - .doReturn(IOUtils.toString( - SdcCatalogServicesItCase.class.getResourceAsStream("/example/sdc/sdcCinderVolume.json"), "UTF-8")) - .when(spy).getCldsServicesOrResourcesBasedOnURL(cinderVolumeDetailUrl); - String vfcGenericDetailUrl = refProp.getStringValue("sdc.catalog.url") - + "resources/2c8f1219-8000-4001-aa13-496a0396d40f/metadata"; - Mockito.doReturn(IOUtils.toString( - SdcCatalogServicesItCase.class.getResourceAsStream("/example/sdc/sdcVFCGenericWithAlarms.json"), "UTF-8")) - .when(spy).getCldsServicesOrResourcesBasedOnURL(vfcGenericDetailUrl); - String csvAlarmsDetailUrl = refProp.getStringValue("sdc.catalog.url") - + "resources/2c8f1219-8000-4001-aa13-496a0396d40f/resourceInstances/virc_fe_be/" - + "artifacts/5138e316-0237-49aa-817a-b3d8eaf77392"; - Mockito - .doReturn(IOUtils.toString( - SdcCatalogServicesItCase.class.getResourceAsStream("/example/sdc/sdcAlarmsList.csv"), "UTF-8")) - .when(spy).getCldsServicesOrResourcesBasedOnURL(csvAlarmsDetailUrl); - Mockito - .doReturn(IOUtils.toString( - SdcCatalogServicesItCase.class.getResourceAsStream("/example/sdc/sdcAlarmsList.csv"), "UTF-8")) - .when(spy).getCldsServicesOrResourcesBasedOnURL(csvAlarmsDetailUrl); - String csvAlarmsDetailUrl2 = refProp.getStringValue("sdc.catalog.url") - + "resources/d7646638-2572-4a94-b497-c028ac15f9ca/artifacts/5138e316-0237-49aa-817a-b3d8eaf77392"; - Mockito - .doReturn(IOUtils.toString( - SdcCatalogServicesItCase.class.getResourceAsStream("/example/sdc/sdcAlarmsList.csv"), "UTF-8")) - .when(spy).getCldsServicesOrResourcesBasedOnURL(csvAlarmsDetailUrl2); - String allVfResourcesDetailUrl = refProp.getStringValue("sdc.catalog.url") + "resources?resourceType=VF"; - Mockito - .doReturn(IOUtils.toString( - SdcCatalogServicesItCase.class.getResourceAsStream("/example/sdc/sdcVFResources.json"), "UTF-8")) - .when(spy).getCldsServicesOrResourcesBasedOnURL(allVfResourcesDetailUrl); - String vfcResourcesDetailUrl = refProp.getStringValue("sdc.catalog.url") - + "resources/a0475018-1e7e-4ddd-8bee-33cbf958c2e6/metadata"; - Mockito.doReturn(IOUtils.toString( - SdcCatalogServicesItCase.class.getResourceAsStream("/example/sdc/sdcCVFCResourceExample.json"), "UTF-8")) - .when(spy).getCldsServicesOrResourcesBasedOnURL(vfcResourcesDetailUrl); - String allVfcResourcesDetailUrl = refProp.getStringValue("sdc.catalog.url") + "resources?resourceType=VFC"; - Mockito - .doReturn(IOUtils.toString( - SdcCatalogServicesItCase.class.getResourceAsStream("/example/sdc/sdcVFCResources.json"), "UTF-8")) - .when(spy).getCldsServicesOrResourcesBasedOnURL(allVfcResourcesDetailUrl); - String allCvfcResourcesDetailUrl = refProp.getStringValue("sdc.catalog.url") + "resources?resourceType=CVFC"; - Mockito - .doReturn(IOUtils.toString( - SdcCatalogServicesItCase.class.getResourceAsStream("/example/sdc/sdcCVFCResources.json"), "UTF-8")) - .when(spy).getCldsServicesOrResourcesBasedOnURL(allCvfcResourcesDetailUrl); - String allVfAlarms = refProp.getStringValue("sdc.catalog.url") - + "resources/84855843-5247-4e97-a2bd-5395a510253b/artifacts/d57ac7ec-f3c3-4793-983a-c75ac3a43153"; - Mockito - .doReturn(IOUtils.toString( - SdcCatalogServicesItCase.class.getResourceAsStream("/example/sdc/sdcMeasurementsList.csv"), "UTF-8")) - .when(spy).getCldsServicesOrResourcesBasedOnURL(allVfAlarms); - String vfcResourceExample = refProp.getStringValue("sdc.catalog.url") - + "resources/d7646638-2572-4a94-b497-c028ac15f9ca/metadata"; - Mockito - .doReturn(IOUtils.toString( - SdcCatalogServicesItCase.class.getResourceAsStream("/example/sdc/sdcVFCResourceExample.json"), "UTF-8")) - .when(spy).getCldsServicesOrResourcesBasedOnURL(vfcResourceExample); - CldsServiceData cldsServiceData = spy - .getCldsServiceDataWithAlarmConditions("a33ed748-3477-4434-b3f3-b5560f5e7d9c"); - assertTrue("a33ed748-3477-4434-b3f3-b5560f5e7d9c".equals(cldsServiceData.getServiceInvariantUUID())); - assertTrue("29018914-966c-442d-9d08-251b9dc45b8f".equals(cldsServiceData.getServiceUUID())); - assertTrue(cldsServiceData.getCldsVfs().size() == 1); - List<CldsAlarmCondition> alarmsList = spy.getAllAlarmConditionsFromCldsServiceData(cldsServiceData, - "alarmCondition"); - assertTrue(alarmsList.size() == 12); - } -} diff --git a/src/test/java/org/onap/clamp/clds/it/SdcReqItCase.java b/src/test/java/org/onap/clamp/clds/it/SdcReqItCase.java deleted file mode 100644 index 971b36f6f..000000000 --- a/src/test/java/org/onap/clamp/clds/it/SdcReqItCase.java +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP CLAMP - * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END============================================ - * =================================================================== - * - */ - -package org.onap.clamp.clds.it; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.io.IOException; -import java.security.GeneralSecurityException; -import java.util.List; - -import org.apache.commons.codec.DecoderException; -import org.json.JSONException; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.onap.clamp.clds.client.req.sdc.SdcRequests; -import org.onap.clamp.clds.model.CldsEvent; -import org.onap.clamp.clds.model.properties.ModelProperties; -import org.onap.clamp.clds.util.ResourceFileUtil; -import org.skyscreamer.jsonassert.JSONAssert; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest -public class SdcReqItCase { - - @Autowired - private SdcRequests sdcReq; - private String modelBpmnProp; - private String modelBpmn; - private String modelName; - private String controlName; - private ModelProperties modelProperties; - private String jsonWithYamlInside; - - /** - * Initialize Test. - */ - @Before - public void setUp() throws IOException { - modelBpmnProp = ResourceFileUtil.getResourceAsString("example/model-properties/tca/modelBpmnProperties.json"); - modelBpmn = ResourceFileUtil.getResourceAsString("example/model-properties/tca/modelBpmn.json"); - modelName = "example-model01"; - controlName = "ClosedLoop_FRWL_SIG_fad4dcae_e498_11e6_852e_0050568c4ccf"; - modelProperties = new ModelProperties(modelName, controlName, CldsEvent.ACTION_SUBMIT, false, modelBpmn, - modelBpmnProp); - jsonWithYamlInside = ResourceFileUtil.getResourceAsString("example/tca-policy-req/prop-text.json"); - } - - @Test - public void formatBlueprintTest() throws IOException { - String blueprintFormatted = sdcReq.formatBlueprint(modelProperties, jsonWithYamlInside); - assertEquals(ResourceFileUtil.getResourceAsString("example/tca-policy-req/blueprint-expected.yaml"), - blueprintFormatted); - } - - @Test - public void formatSdcLocationsReqTest() { - String blueprintFormatted = sdcReq.formatSdcLocationsReq(modelProperties, "testos"); - assertEquals( - "{\"artifactName\":\"testos\",\"locations\":[\"SNDGCA64\",\"ALPRGAED\",\"LSLEILAA\",\"MDTWNJC1\"]}", - blueprintFormatted); - } - - @Test - public void formatSdcReqTest() throws JSONException { - String jsonResult = sdcReq.formatSdcReq("payload", "artifactName", "artifactLabel", "artifactType"); - JSONAssert.assertEquals("{\"payloadData\" : \"cGF5bG9hZA==\",\"artifactLabel\" : \"artifactLabel\"," - + "\"artifactName\" :\"artifactName\",\"artifactType\" : \"artifactType\"," - + "\"artifactGroupType\" : \"DEPLOYMENT\",\"description\" : \"from CLAMP Cockpit\"}", jsonResult, true); - } - - @Test - public void getSdcReqUrlsListTest() throws GeneralSecurityException, DecoderException { - List<String> listUrls = sdcReq.getSdcReqUrlsList(modelProperties); - assertNotNull(listUrls); - assertTrue(listUrls.size() == 1); - assertTrue(listUrls.get(0).contains( - "/sdc/v1/catalog/services/56441b4b-0467-41dc-9a0e-e68613838219/resourceInstances/vpacketgen0/artifacts")); - } -} diff --git a/src/test/java/org/onap/clamp/clds/it/config/CldsReferencePropertiesItCase.java b/src/test/java/org/onap/clamp/clds/it/config/CldsReferencePropertiesItCase.java index 630e8c028..65aa9b44f 100644 --- a/src/test/java/org/onap/clamp/clds/it/config/CldsReferencePropertiesItCase.java +++ b/src/test/java/org/onap/clamp/clds/it/config/CldsReferencePropertiesItCase.java @@ -101,11 +101,12 @@ public class CldsReferencePropertiesItCase { */ @Test public void testGetFileContent() throws IOException { - String content = refProp.getFileContent("sdc.decode.service_ids"); - assertEquals("{}", content); + String location = "{\n\t\"DC1\": \"Data Center 1\",\n\t\"DC2\": \"Data Center 2\",\n\t\"DC3\": \"Data Center 3\"\n}\n"; + String content = refProp.getFileContent("ui.location.default"); + assertEquals(location, content); // Test composite key - content = refProp.getFileContent("sdc.decode", "service_ids"); - assertEquals("{}", content); + content = refProp.getFileContent("ui.location", "default"); + assertEquals(location, content); } @Test diff --git a/src/test/resources/application.properties b/src/test/resources/application.properties index d75c60869..f41b68dfb 100644 --- a/src/test/resources/application.properties +++ b/src/test/resources/application.properties @@ -124,11 +124,6 @@ clamp.config.files.sdcController=classpath:/clds/sdc-controllers-config.json clamp.config.dcae.template=classpath:/clds/templates/dcae-template.json
clamp.config.dcae.deployment.template=classpath:/clds/templates/dcae-deployment-template.json
#
-# SDC request blueprint properties
-#
-clamp.config.sdc.template=classpath:/clds/templates/sdc-template.json
-clamp.config.sdc.decode.service_ids=classpath:/clds/templates/sdc-decode-service_ids.json
-#
#
# Configuration Settings for Policy Engine Components
clamp.config.policy.pdpUrl1=http://localhost:${docker.http-cache.port.host}/pdp/ , testpdp, alpha123
@@ -178,18 +173,6 @@ clamp.config.op.controller=amsterdam clamp.config.op.policy.appc=APPC
#
# Sdc service properties
-clamp.config.sdc.catalog.url=http://localhost:${docker.http-cache.port.host}/sdc/v1/catalog/
-clamp.config.sdc.hostUrl=http://localhost:${docker.http-cache.port.host}
-clamp.config.sdc.serviceUrl=http://localhost:${docker.http-cache.port.host}/sdc/v1/catalog/services
-clamp.config.sdc.serviceUsername=clamp
-clamp.config.sdc.servicePassword=b7acccda32b98c5bb7acccda32b98c5b05D511BD6D93626E90D18E9D24D9B78CD34C7EE8012F0A189A28763E82271E50A5D4EC10C7D93E06E0A2D27CAE66B981
-clamp.config.sdc.artifactLabel=blueprintclampcockpit
-clamp.config.sdc.sdcX-InstanceID=CLAMP
-clamp.config.sdc.artifactType=DCAE_INVENTORY_BLUEPRINT
-clamp.config.sdc.locationArtifactLabel=locationclampcockpit
-clamp.config.sdc.locationArtifactType=DCAE_INVENTORY_JSON
-clamp.config.sdc.InstanceID=X-ECOMP-InstanceID
-clamp.config.sdc.header.requestId = X-ECOMP-RequestID
#
clamp.config.sdc.csarFolder = ${project.build.directory}/sdc-tests
clamp.config.sdc.blueprint.parser.mapping = classpath:/clds/blueprint-parser-mapping.json
|