Details
-
Bug
-
Status: Closed
-
Medium
-
Resolution: Won't Do
-
Beijing Release
-
None
-
in Integration-lab,
project: Integration-SB-07
URL: http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/applicationsHome
Policy Editor to create a new Policy:
Policy Type: Config
Config Policy Type: Optimization.
Optimization Model: hpaPolicy
Optimization Model Version: CSIT
Description
Per the description in https://wiki.onap.org/display/DW/Policy+Specification+and+Retrieval+for+OOF , the format/schema of flavorProperties should as follows:
"flavorFeatures": [
{
"flavorLabel": "
",
"flavorProperties":[
{
"hpa-feature" : "
",
"mandatory" : "
",
"score" : "
"
"architecture": "
",
"hpa-version": "
",
"hpa-feature-attributes": [
{
"hpa-attribute-key": "
",
"hpa-attribute-value": "
",
"operator": "
",
"unit": "
"}
]
}
]
But in the GUI and currently implementation in Policy, it seems like as below, there are some mismatch with yellow color marked:
"flavorFeatures": [
{
"flavorLabel": "flavor3",
"flavorProperties": [
{
"score": "7",
"featureAttributes": [
],
"mandatory": "True",
"hpaFeature": "hugePages",
"architecture": "generic"
},
After checking the code engine/packages/base/src/files/install/mysql/data/180601_upgrade_script.sql, it seems to be caused by below sql statements:
INSERT INTO `onap_sdk`.`optimizationmodels` (`modelname`, `description`, `dependency`, `imported_by`, `attributes`, `ref_attributes`, `sub_attributes`, `version`, `annotation`, `enumValues`, `dataOrderInfo`) VALUES ('hpaPolicy', 'CSIT Tests Model', '[]', 'demo', 'identity=string:defaultValue-null:required-true:MANY-false,resources=string:defaultValue-null:required-true:MANY-false', 'policyScope=MANY-true,policyType=POLICYTYPE:MANY-false,flavorFeatures=flavorFeatures-properties:MANY-true', '{\"flavorProperties-properties\":
,\"flavorFeatures-properties\":
{\"flavorProperties\":\"flavorProperties-properties:required-false:MANY-true\",\"flavorLabel\":\"string:defaultValue-null:required-true:MANY-false\"},\"featureAttributes-properties\":{\"unit\":\"string:defaultValue-null:required-true:MANY-false\",\"attribute\":\"string:defaultValue-null:required-true:MANY-false\",\"value\":\"string:defaultValue-null:required-true:MANY-false\",\"operator\":\"OPERATOR:required-true:MANY-false\"}}\n', 'CSIT', 'policyScope=matching-true', 'OPERATOR=[<,<equal-sign,>,>equal-sign,equal-sign,!equal-sign,any,all,subset,], POLICYTYPE=[hpaPolicy,]', '\"[resources,identity,policyScope,policyType,flavorFeatures,flavorLabel,flavorProperties,architecture,hpaFeature,mandatory,score,featureAttributes,attribute,operator,unit,value]\"');