// Set Policy Type
policyParameters.setPolicyConfigType(PolicyConfigType.MicroService);
- policyParameters.setEcompName(refProp.getStringValue("policy.ecomp.name"));
+ policyParameters.setEcompName(refProp.getStringValue("policy.onap.name"));
policyParameters.setPolicyName(prop.getCurrentPolicyScopeAndPolicyName());
policyParameters.setConfigBody(policyJson);
/**
* Perform send of base policy in OTHER type.
- *
+ *
* @param configBody
* The config policy string body
+ * @param configPolicyName
+ * The config policy name of the component that has been pre-deployed in DCAE
* @param prop
* The ModelProperties
* @param policyRequestUuid
* The policy request UUID
* @return The answer from policy call
*/
- public String sendBasePolicyInOther(String configBody, ModelProperties prop, String policyRequestUuid) {
+ public String sendBasePolicyInOther(String configBody, String configPolicyName, ModelProperties prop, String policyRequestUuid) {
PolicyParameters policyParameters = new PolicyParameters();
// Set Policy Type
policyParameters.setPolicyConfigType(PolicyConfigType.Base);
- policyParameters.setEcompName(refProp.getStringValue("policy.ecomp.name"));
+ policyParameters.setEcompName(refProp.getStringValue("policy.onap.name"));
policyParameters.setPolicyName(prop.getCurrentPolicyScopeAndPolicyName());
policyParameters.setConfigBody(configBody);
policyParameters.setConfigBodyType(PolicyType.OTHER);
policyParameters.setConfigName("HolmesPolicy");
+ policyParameters.setPolicyName(configPolicyName);
policyParameters.setRequestID(UUID.fromString(policyRequestUuid));
return rtnMsg;
}
+ /**
+ * Perform send of Microservice policy in OTHER type.
+ *
+ * @param configBody
+ * The config policy string body
+ * @param prop
+ * The ModelProperties
+ * @param policyRequestUuid
+ * The policy request UUID
+ * @return The answer from policy call
+ */
+ public String sendMicroServiceInOther(String configBody, ModelProperties prop, String policyRequestUuid) {
+
+ PolicyParameters policyParameters = new PolicyParameters();
+
+ // Set Policy Type
+ policyParameters.setPolicyConfigType(PolicyConfigType.MicroService);
+ policyParameters.setEcompName(refProp.getStringValue("policy.onap.name"));
+ policyParameters.setPolicyName(prop.getCurrentPolicyScopeAndPolicyName());
+
+ policyParameters.setConfigBody(configBody);
+ policyParameters.setConfigBodyType(PolicyType.OTHER);
+
+ policyParameters.setRequestID(UUID.fromString(policyRequestUuid));
+ String policyNamePrefix = refProp.getStringValue("policy.ms.policyNamePrefix");
+
+ // Adding this line to clear the policy id from policy name while
+ // pushing to policy engine
+ prop.setPolicyUniqueId("");
+
+ String rtnMsg = send(policyParameters, prop, policyNamePrefix);
+ String policyType = refProp.getStringValue("policy.ms.type");
+ push(policyType, prop);
+
+ return rtnMsg;
+ }
+
/**
* Perform send of policy.
*