aboutsummaryrefslogtreecommitdiffstats
path: root/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/policycontroller/PolicyCreation.java
diff options
context:
space:
mode:
Diffstat (limited to 'ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/policycontroller/PolicyCreation.java')
-rw-r--r--ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/policycontroller/PolicyCreation.java11
1 files changed, 10 insertions, 1 deletions
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<String>(body, status);
+ return new ResponseEntity<>(body, status);
}
@ExceptionHandler({ HttpMessageNotReadableException.class })