X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ECOMP-PAP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fpolicy%2Fpap%2Fxacml%2Frest%2Fpolicycontroller%2FPolicyCreation.java;h=e6f322a7245d36a1ceb96433d363aa97eb29d387;hb=e92ff832cf993db876f22b2d27562fedf59f5043;hp=0d84519d3de8d878d895e3c0cd62c0a07824b7d9;hpb=570290dc6ba8198e653022c2f6f8e5d01cfa8d1b;p=policy%2Fengine.git diff --git a/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/policycontroller/PolicyCreation.java b/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/policycontroller/PolicyCreation.java index 0d84519d3..e6f322a72 100644 --- a/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/policycontroller/PolicyCreation.java +++ b/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/policycontroller/PolicyCreation.java @@ -379,14 +379,20 @@ public class PolicyCreation extends AbstractPolicyCreation{ && policyData.getYamlparams()!=null){ attributeMap.put("actor", policyData.getYamlparams().getActor()); attributeMap.put("recipe", policyData.getYamlparams().getRecipe()); + attributeMap.put("clname", policyData.getYamlparams().getClname()); attributeMap.put("limit", policyData.getYamlparams().getLimit()); attributeMap.put("timeWindow", policyData.getYamlparams().getTimeWindow()); + attributeMap.put("timeUnits", policyData.getYamlparams().getTimeUnits()); attributeMap.put("guardActiveStart", policyData.getYamlparams().getGuardActiveStart()); attributeMap.put("guardActiveEnd", policyData.getYamlparams().getGuardActiveEnd()); if(policyData.getYamlparams().getBlackList()!=null){ String blackList = StringUtils.join(policyData.getYamlparams().getBlackList(), ","); attributeMap.put("blackList", blackList); } + if(policyData.getYamlparams().getTargets()!=null){ + String targets = StringUtils.join(policyData.getYamlparams().getTargets(),","); + attributeMap.put("targets", targets); + } } if(policyData.getRuleProvider()!=null && policyData.getRuleProvider().equals(DecisionPolicy.RAINY_DAY)){ attributeMap.put("ServiceType", policyData.getRainyday().getServiceType()); @@ -513,8 +519,11 @@ public class PolicyCreation extends AbstractPolicyCreation{ } catch (Exception e){ LOGGER.error("Exception Occured : "+e); + body = "error"; + response.addHeader("error", e.getMessage()); + response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } - return new ResponseEntity(body, status); + return new ResponseEntity<>(body, status); } @ExceptionHandler({ HttpMessageNotReadableException.class })