Component Questionnaire data retention bugfix

Change-Id: I0a8254c21f94db356b73e1f713b304f884225680
Issue-ID: SDC-1419
Signed-off-by: ayalaben <ayala.benzvi@amdocs.com>
diff --git a/openecomp-be/tools/install/database/init_schemas.cql b/openecomp-be/tools/install/database/init_schemas.cql
index 18babeb..9ffea66 100644
--- a/openecomp-be/tools/install/database/init_schemas.cql
+++ b/openecomp-be/tools/install/database/init_schemas.cql
@@ -26,13 +26,13 @@
 CREATE TABLE IF NOT EXISTS last_notification (owner_id text PRIMARY KEY, event_id timeuuid);
 CREATE TABLE IF NOT EXISTS notifications (owner_id text, event_id timeuuid, read boolean, originator_id text, event_type text, event_attributes text, PRIMARY KEY (owner_id, event_id)) WITH CLUSTERING ORDER BY (event_id DESC);
 CREATE TABLE IF NOT EXISTS vsp_merge_hint (space text, item_id text, version_id text, model_id text, model_resolution text, PRIMARY KEY ((space, item_id, version_id)));
-INSERT INTO application_config (namespace,key,value) VALUES ('vsp.schemaTemplates', 'composition.component', '{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "name": { "type": "string"<#if !manual>, "enum": [ "${component.name}" ], "default": "${component.name}"</#if> }, "displayName": { "type": "string"<#if !manual && component.displayName??>, "enum": [ "${component.displayName}" ], "default": "${component.displayName}"</#if> }, "vfcCode": { "type": "string" }, "nfcCode": { "type": "string" }, "nfcFunction": { "type": "string" }, "description": { "type": "string" } }, "additionalProperties": false, "required": [ "name"<#if !manual && component.displayName??>, "displayName"</#if> ] }');
+INSERT INTO application_config (namespace,key,value) VALUES ('vsp.schemaTemplates', 'composition.component', '{ "$schema": "http://json-schema.org/draft-04/schema#",  "type": "object",  "properties": {    "name": { "type": "string"<#if !manual>, "enum": [   "${component.name}" ], "default": "${component.name}"</#if>    },    "displayName": { "type": "string"<#if !manual && component.displayName??>, "enum": [   "${component.displayName}" ], "default": "${component.displayName}"</#if>},"description": {"type": "string"}},"additionalProperties": false,"required": ["name"<#if !manual && component.displayName??>,"displayName"</#if>]}');
 INSERT INTO application_config (namespace,key,value) VALUES ('vsp.schemaTemplates', 'composition.compute', '{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "name": { "type": "string" <#if !manual>, "enum": [ "${compute.name}" ], "default": "${compute.name}"</#if> }, "description": { "type": "string", "maxLength": 300 } } }');
 INSERT INTO application_config (namespace,key,value) VALUES ('vsp.schemaTemplates', 'composition.deployment', '{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "model": { "type": "string", "maxLength": 30 }, "description": { "type": "string", "maxLength": 300 }, "featureGroupId":{ "type": "string", "enum": [<#if featureGroupIds??> <#list featureGroupIds as featureGroupId> "${featureGroupId}"<#sep>,</#list> </#if> ] }, "componentComputeAssociations": { "type": "array", "properties": { "vfcid": { "type": "string" }, "computeFlavorid": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false, "required": [ "model" ] }');
 INSERT INTO application_config (namespace,key,value) VALUES ('vsp.schemaTemplates', 'composition.image', '{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "fileName": { "type": "string" }, "description": { "type": "string" } }, "additionalProperties": false }');
 INSERT INTO application_config (namespace,key,value) VALUES ('vsp.schemaTemplates', 'composition.network', '{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "name": { "type": "string"<#if !manual>, "enum": [ "${network.name}" ], "default": "${network.name}"</#if> }, "dhcp": { "type": "boolean"<#if !manual>, "enum": [ ${network.dhcp?c} ], "default": ${network.dhcp?c}</#if> } }, "additionalProperties": false, "required": [ "name", "dhcp" ] }');
 INSERT INTO application_config (namespace,key,value) VALUES ('vsp.schemaTemplates', 'composition.nic', '{  "$schema": "http://json-schema.org/draft-04/schema#",  "type": "object",  "properties":{ "name": {  "type": "string", <#if manual> "pattern":"^[a-zA-Z0-9_]*$" <#else>"enum": [ "${nic.name}"],"default": "${nic.name}" </#if> }, "description": { "type": "string" }<#if !manual><#if nic.networkId??>, "networkId": { "type": "string", "enum": [ "${nic.networkId}" ], "default": "${nic.networkId}" }  </#if>  <#elseif manual><#if nic.networkId??>, "networkId": { "type": "string",  "enum": [ "${nic.networkId}" ], "default": "${nic.networkId}" } </#if><#else>, "networkId": { "type": "string", "enum": [<#list networkIds as networkId> "${networkId}"<#sep>,</#list> ] } </#if>, "networkDescription": { "type": "string" }, "networkType": { "type": "string", "enum": [ "${nic.networkType}" ], "default": "${nic.networkType}" } }, "additionalProperties": false, "required": [ "name" ]}');
-INSERT INTO application_config (namespace,key,value) VALUES ('vsp.schemaTemplates', 'questionnaire.component', '{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "general": { "type": "object", "properties": { "hypervisor": { "type": "object", "properties": { "hypervisor": { "type": "string", "enum": [ "KVM", "VMWare ESXi" ], "default": "KVM" }, "drivers": { "type": "string", "maxLength": 300, "pattern": "^[A-Za-z0-9_,-]*$" }, "containerFeaturesDescription": { "type": "string", "maxLength": 1000, "pattern": "^[A-Za-z0-9_, -]*$" } }, "additionalProperties": false }, "image": { "type": "object", "properties": { "providedBy": { "type": "string", "enum": [ "AIC", "Vendor" ], "default": "AIC" } }, "additionalProperties": false }, "disk": { "type": "object" , "properties": { "bootDiskSizePerVM": { "type": "number", "maximum": 100 }, "ephemeralDiskSizePerVM": { "type": "number", "maximum": 400 } }, "additionalProperties": false }, "recovery": { "type": "object", "properties": { "pointObjective": { "type": "number", "minimum": 0, "exclusiveMinimum": true, "maximum": 15, "exclusiveMaximum ": true }, "timeObjective": { "type": "number", "minimum": 0, "exclusiveMinimum": true, "maximum": 300, "exclusiveMaximum ": true }, "vmProcessFailuresHandling": { "type": "string" } }, "additionalProperties": false }, "dnsConfiguration": { "type": "string" }, "vmCloneUsage": { "type": "string", "maxLength": 300 } }, "additionalProperties": false }, "compute": { "type": "object", "properties": { "numOfVMs": { "type": "object", "properties": { "minimum": { "type": "number", "minimum": 0, "maximum": 100 }, "maximum": { "type": "number", "minimum": <#if (componentQuestionnaireData.compute.numOfVMs.minimum)?? && (componentQuestionnaireData.compute.numOfVMs.minimum)?is_number && ((componentQuestionnaireData.compute.numOfVMs.minimum) > 0 && (componentQuestionnaireData.compute.numOfVMs.minimum) <= 100)> ${componentQuestionnaireData.compute.numOfVMs.minimum}<#else> 0</#if> , "exclusiveMinimum": true, "maximum": 100 } }, "additionalProperties": false }, "guestOS": { "type": "object", "properties": { "name": { "type": "string", "maxLength": 50 }, "bitSize": { "type": "number", "enum": [ 64, 32 ], "default": 64 }, "tools": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "highAvailabilityAndLoadBalancing": { "type": "object", "properties": { "isComponentMandatory": { "type": "string", "enum": ["","YES", "NO"], "default": "" }, "highAvailabilityMode": { "type": "string", "enum": ["","geo-activeactive", "geo-activestandby", "local-activeactive", "local-activestandby"], "default": "" }, "failureLoadDistribution": { "type": "string", "maxLength": 1000 }, "nkModelImplementation": { "type": "string", "maxLength": 1000 }, "architectureChoice": { "type": "string", "maxLength": 1000 }, "slaRequirements": { "type": "string", "maxLength": 1000 }, "horizontalScaling": { "type": "string", "maxLength": 1000 }, "loadDistributionMechanism": { "type": "string", "maxLength": 1000 } }, "additionalProperties": false }, "network": { "type": "object", "properties": { "networkCapacity": { "type": "object", "properties": { "protocolWithHighestTrafficProfileAcrossAllNICs": { "type": "string", "enum": [ "", "TCP", "UDP", "SCTP", "IPsec" ], "default": "" }, "networkTransactionsPerSecond": { "type": "number" } }, "additionalProperties": false } }, "additionalProperties": false }, "storage": { "type": "object", "properties": { "backup": { "type": "object", "properties": { "backupType": { "type": "string", "enum": [ "On Site", "Off Site" ], "default": "On Site" }, "backupStorageSize": { "type": "number" }, "backupSolution": { "type": "string" }, "backupNIC": { "type": "string", "enum": [ ""<#if nicNames??><#list nicNames as nicName> , "${nicName}"</#list></#if> ], "default": "" } }, "additionalProperties": false }, "snapshotBackup": { "type": "object", "properties": { "snapshotFrequency": { "type": "number", "default": 24, "minimum": 1, "exclusiveMinimum": true } }, "additionalProperties": false }, "logBackup": { "type": "object", "properties": { "sizeOfLogFiles": { "type": "number", "maximum": 5, "exclusiveMaximum": true }, "logBackupFrequency": { "type": "number", "maximum": 4, "exclusiveMaximum": true }, "logRetentionPeriod": { "type": "number", "maximum": 15, "exclusiveMaximum": true }, "logFileLocation": { "type": "string", "maxLength": 300 } }, "additionalProperties": false } }, "additionalProperties": false } }, "additionalProperties": false }');
+INSERT INTO application_config (namespace,key,value) VALUES ('vsp.schemaTemplates', 'questionnaire.component', '{ "$schema": "http://json-schema.org/draft-04/schema#",  "type": "object",  "properties": {    "general": { "type": "object", "properties": {   "nfcNamingCode": {     "type": "string",     "maxLength": 1000<#if componentDisplayName??>,     "default": "${componentDisplayName}"</#if>   },   "nfcFunction": {     "type": "string"   },   "hypervisor": {     "type": "object",     "properties": {  "hypervisor": {    "type": "string",    "enum": [ "KVM", "VMWare ESXi"    ],    "default": "KVM"  },  "drivers": {    "type": "string",    "maxLength": 300,    "pattern": "^[A-Za-z0-9_,-]*$"  },  "containerFeaturesDescription": {    "type": "string",    "maxLength": 1000,    "pattern": "^[A-Za-z0-9_, -]*$"  }     },     "additionalProperties": false   },   "image": {     "type": "object",     "properties": {  "providedBy": {    "type": "string",    "enum": [ "AIC", "Vendor"    ],    "default": "AIC"  }     },     "additionalProperties": false   },   "disk": {     "type": "object" ,     "properties": {    "bootDiskSizePerVM": { "type": "number", "minimum": 0, "maximum": 100    },   "ephemeralDiskSizePerVM": {     "type": "number",     "minimum": 0,     "maximum": 400    } }, "additionalProperties": false    },   "recovery": {     "type": "object",     "properties": {  "pointObjective": {    "type": "number",    "minimum": 0,    "exclusiveMinimum": true,    "maximum": 15,    "exclusiveMaximum ": true  },  "timeObjective": {    "type": "number",    "minimum": 0,    "exclusiveMinimum": true,    "maximum": 300,    "exclusiveMaximum ": true  },  "vmProcessFailuresHandling": {    "type": "string"  }     },     "additionalProperties": false   },   "dnsConfiguration": {     "type": "string"   },   "vmCloneUsage": {     "type": "string",     "maxLength": 300   } }, "additionalProperties": false    },    "compute": { "type": "object", "properties": {   "numOfVMs": {     "type": "object",     "properties": {  "minimum": {    "type": "number",    "minimum": 0,    "maximum": 100  },  "maximum": {    "type": "number",  "minimum": <#if (componentQuestionnaireData.compute.numOfVMs.minimum)??&& (componentQuestionnaireData.compute.numOfVMs.minimum)?is_number&& ((componentQuestionnaireData.compute.numOfVMs.minimum) > 0&& (componentQuestionnaireData.compute.numOfVMs.minimum) <= 100)>    ${componentQuestionnaireData.compute.numOfVMs.minimum}<#else>  0</#if> ,    "exclusiveMinimum": true,    "maximum": 100  }     },     "additionalProperties": false   },   "guestOS": {     "type": "object",     "properties": {  "name": {    "type": "string",    "maxLength": 50  },  "bitSize": {    "type": "number",    "enum": [ 64, 32    ],    "default": 64  },  "tools": {    "type": "string"  }     },     "additionalProperties": false   } }, "additionalProperties": false    },    "highAvailabilityAndLoadBalancing": { "type": "object", "properties": {   "isComponentMandatory": {     "type": "string",     "enum": ["","YES", "NO"],     "default": ""   },   "highAvailabilityMode": {     "type": "string",     "enum": ["","geo-activeactive", "geo-activestandby", "local-activeactive", "local-activestandby"],     "default": ""   },   "failureLoadDistribution": {     "type": "string",     "maxLength": 1000   },   "nkModelImplementation": {     "type": "string",     "maxLength": 1000   },   "architectureChoice": {     "type": "string",     "maxLength": 1000   },   "slaRequirements": {     "type": "string",     "maxLength": 1000   },   "horizontalScaling": {     "type": "string",     "maxLength": 1000   },   "loadDistributionMechanism": {     "type": "string",     "maxLength": 1000   } }, "additionalProperties": false    },    "network": { "type": "object", "properties": {   "networkCapacity": {     "type": "object",     "properties": {  "protocolWithHighestTrafficProfileAcrossAllNICs": {    "type": "string",    "enum": [ "", "TCP", "UDP", "SCTP", "IPsec"    ],    "default": ""  },  "networkTransactionsPerSecond": {    "type": "number",    "minimum": 0  }     },     "additionalProperties": false   } }, "additionalProperties": false    },    "storage": { "type": "object", "properties": {   "backup": {     "type": "object",     "properties": {  "backupType": {    "type": "string",    "enum": [ "On Site", "Off Site"    ],    "default": "On Site"  },  "backupStorageSize": {    "type": "number",    "minimum": 0  },  "backupSolution": {    "type": "string"  },  "backupNIC": {    "type": "string",    "enum": [ ""<#if nicNames??><#list nicNames as nicName> , "${nicName}"</#list></#if>    ],    "default": ""  }     },     "additionalProperties": false   },   "snapshotBackup": {     "type": "object",     "properties": {  "snapshotFrequency": {    "type": "number",    "default": 24,    "minimum": 1,    "exclusiveMinimum": true  }     },     "additionalProperties": false   },   "logBackup": {     "type": "object",     "properties": {  "sizeOfLogFiles": {    "type": "integer",    "minimum": 0,    "maximum": 5,    "exclusiveMaximum": true  },  "logBackupFrequency": {    "type": "integer",    "minimum": 0,    "maximum": 4,    "exclusiveMaximum": true  },  "logRetentionPeriod": {    "type": "integer",    "minimum": 0,    "maximum": 15,    "exclusiveMaximum": true  },  "logFileLocation": {    "type": "string",    "maxLength": 300  }     },     "additionalProperties": false   } }, "additionalProperties": false    }  },  "additionalProperties": false}');
 INSERT INTO application_config (namespace,key,value) VALUES ('vsp.schemaTemplates', 'questionnaire.compute', '{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "vmSizing": { "type": "object", "properties": { "numOfCPUs": { "type": "number", "minimum": 0, "exclusiveMinimum": true, "maximum": 16, "default": 2 }, "fileSystemSizeGB": { "type": "number", "minimum": 0, "exclusiveMinimum": true, "default": 5 }, "persistentStorageVolumeSize": { "type": "number", "minimum": 0, "exclusiveMinimum": true }, "ioOperationsPerSec": { "type": "number", "minimum": 0, "exclusiveMinimum": true }, "cpuOverSubscriptionRatio": { "type": "string", "enum": [ "1:1", "4:1", "16:1" ], "default": "4:1" }, "memoryRAM": { "type": "string", "enum": [ "1 GB", "2 GB", "3 GB", "4 GB", "5 GB", "6 GB", "7 GB", "8 GB", "9 GB", "10 GB", "11 GB", "12 GB", "13 GB", "14 GB", "15 GB", "16 GB", "17 GB", "18 GB", "19 GB", "20 GB", "21 GB", "22 GB", "23 GB", "24 GB", "25 GB", "26 GB", "27 GB", "28 GB", "29 GB", "30 GB", "31 GB", "32 GB" ], "default": "1 GB" } }, "additionalProperties": false } } }');
 INSERT INTO application_config (namespace,key,value) VALUES ('vsp.schemaTemplates', 'questionnaire.image', '{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "format": { "type": "string", "enum": [ "aki","ami","ari","iso","qcow2","raw", "vdi","vhd","vmdk" ] }, "version": { "type": "string", "minLength": 1 }, "md5": { "type": "string", "maxLength": 32 } }, "additionalProperties": false, "required": [ "version" ] }');
 INSERT INTO application_config (namespace,key,value) VALUES ('vsp.schemaTemplates', 'questionnaire.nic', '{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "protocols": { "type": "object", "properties": { "protocols": { "type": "array", "items": { "type": "string", "enum": [ "", "TCP", "UDP", "SCTP", "IPsec" ], "default": "" }, "minItems": 1 }, "protocolWithHighestTrafficProfile": { "$ref": "#/properties/protocols/properties/protocols/items" } }, "additionalProperties": false }, "ipConfiguration": { "type": "object", "properties": { "ipv4Required": { "type": "boolean", "default": true }, "ipv6Required": { "type": "boolean", "default": false } }, "additionalProperties": false }, "network": { "type": "object", "properties": { "networkDescription": { "type": "string", "pattern": "[A-Za-z]+", "maxLength": 300 } }, "additionalProperties": false }, "sizing": { "type": "object", "definitions": { "peakAndAvg": { "type": "object", "properties": { "peak": { "type": "number" }, "avg": { "type": "number" } }, "additionalProperties": false }, "packetsAndBytes": { "type": "object", "properties": { "packets": { "$ref": "#/properties/sizing/definitions/peakAndAvg" }, "bytes": { "$ref": "#/properties/sizing/definitions/peakAndAvg" } }, "additionalProperties": false } }, "properties": { "describeQualityOfService": { "type": "string" }, "inflowTrafficPerSecond": { "$ref": "#/properties/sizing/definitions/packetsAndBytes" }, "outflowTrafficPerSecond": { "$ref": "#/properties/sizing/definitions/packetsAndBytes" }, "flowLength": { "$ref": "#/properties/sizing/definitions/packetsAndBytes" }, "acceptableJitter": { "type": "object", "properties": { "mean": { "type": "number" }, "max": { "type": "number" }, "variable": { "type": "number" } }, "additionalProperties": false }, "acceptablePacketLoss": { "type": "number", "minimum": 0, "maximum": 100 } }, "additionalProperties": false } }, "additionalProperties": false }');