From: Sébastien Determe Date: Wed, 23 May 2018 15:52:30 +0000 (+0000) Subject: Merge "Generate API documents" X-Git-Tag: v2.0.1~15 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=2206cf470405b527b5d666cf657f011eac6e0b80;hp=2aad6d681dcbea5564425648375f7ddca2080940;p=clamp.git Merge "Generate API documents" --- diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 2e6fd479..fa5d8b6a 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -5,7 +5,7 @@ Release Notes ============= -Version: 2.0.0 +Version: 2.0.1 -------------- :Release Date: 2018-06-25 diff --git a/pom.xml b/pom.xml index dcfbcb7e..4beb6d67 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ 4.0.0 org.onap.clamp clds - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT clamp diff --git a/src/main/java/org/onap/clamp/clds/client/req/tca/TcaRequestFormatter.java b/src/main/java/org/onap/clamp/clds/client/req/tca/TcaRequestFormatter.java index 35c438d9..1478342c 100644 --- a/src/main/java/org/onap/clamp/clds/client/req/tca/TcaRequestFormatter.java +++ b/src/main/java/org/onap/clamp/clds/client/req/tca/TcaRequestFormatter.java @@ -157,10 +157,9 @@ public class TcaRequestFormatter { private static void addThresholds(ClampProperties refProp, String service, ObjectNode appendToNode, TcaItem tcaItem, ModelProperties modelProperties) { ArrayNode tcaNodes = appendToNode.withArray("thresholds"); - ObjectNode tcaNode; try { - tcaNode = (ObjectNode) refProp.getJsonTemplate("tca.thresholds.template", service); for (TcaThreshold tcaThreshold : tcaItem.getTcaThresholds()) { + ObjectNode tcaNode = (ObjectNode) refProp.getJsonTemplate("tca.thresholds.template", service); tcaNode.put("closedLoopControlName", modelProperties.getControlNameAndPolicyUniqueId()); tcaNode.put("fieldPath", tcaThreshold.getFieldPath()); tcaNode.put("thresholdValue", tcaThreshold.getThreshold()); diff --git a/src/main/java/org/onap/clamp/clds/model/properties/PolicyItem.java b/src/main/java/org/onap/clamp/clds/model/properties/PolicyItem.java index bb14b235..337a9763 100644 --- a/src/main/java/org/onap/clamp/clds/model/properties/PolicyItem.java +++ b/src/main/java/org/onap/clamp/clds/model/properties/PolicyItem.java @@ -48,17 +48,17 @@ import java.util.List; * "targetResourceId","value":["Eace933104d443b496b8.nodes.heat.vpg"]}]]}] */ public class PolicyItem implements Cloneable { - protected static final EELFLogger logger = EELFManager.getInstance().getLogger(PolicyItem.class); - protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger(); - private String id; - private String recipe; - private int maxRetries; - private int retryTimeLimit; - private String parentPolicy; - private List parentPolicyConditions; - private String actor; - private String targetResourceId; + protected static final EELFLogger logger = EELFManager.getInstance().getLogger(PolicyItem.class); + protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger(); + private String id; + private String recipe; + private int maxRetries; + private int retryTimeLimit; + private String parentPolicy; + private List parentPolicyConditions; + private String actor; + private String targetResourceId; /** * Parse Policy given json node. @@ -73,7 +73,9 @@ public class PolicyItem implements Cloneable { parentPolicy = AbstractModelElement.getValueByName(node, "parentPolicy"); parentPolicyConditions = AbstractModelElement.getValuesByName(node, "parentPolicyConditions"); targetResourceId = AbstractModelElement.getValueByName(node, "targetResourceId"); - + if (targetResourceId != null && targetResourceId.isEmpty()) { + this.setTargetResourceId(null); + } } /** 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 888b782e..9b68845c 100644 --- a/src/main/java/org/onap/clamp/clds/service/CldsService.java +++ b/src/main/java/org/onap/clamp/clds/service/CldsService.java @@ -835,6 +835,10 @@ public class CldsService extends SecureServiceBase { fillInCldsModel(model); String bpmnJson = cldsBpmnTransformer.doXslTransformToString(model.getBpmnText()); logger.info("PUT bpmnJson={}", bpmnJson); + SecureServicePermission permisionManage = SecureServicePermission.create(cldsPermissionTypeClManage, + cldsPermissionInstance, CldsEvent.ACTION_DEPLOY); + isAuthorized(permisionManage); + isAuthorizedForVf(model); ModelProperties modelProp = new ModelProperties(modelName, model.getControlName(), CldsEvent.ACTION_DEPLOY, false, bpmnJson, model.getPropText()); checkForDuplicateServiceVf(modelName, model.getPropText()); @@ -890,6 +894,10 @@ public class CldsService extends SecureServiceBase { LoggingUtils.setRequestContext("CldsService: Undeploy model", getPrincipalName()); Boolean errorCase = false; try { + SecureServicePermission permisionManage = SecureServicePermission.create(cldsPermissionTypeClManage, + cldsPermissionInstance, CldsEvent.ACTION_UNDEPLOY); + isAuthorized(permisionManage); + isAuthorizedForVf(model); String operationStatusUndeployUrl = dcaeDispatcherServices.deleteExistingDeployment(model.getDeploymentId(), model.getTypeId()); String operationStatus = dcaeDispatcherServices.getOperationStatusWithRetry(operationStatusUndeployUrl); diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html index 7dd2c4dd..83fb337d 100644 --- a/src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html +++ b/src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html @@ -286,9 +286,13 @@ label {
- +
+ @@ -304,6 +308,22 @@ label {