aboutsummaryrefslogtreecommitdiffstats
path: root/models-tosca
AgeCommit message (Collapse)AuthorFilesLines
2019-09-10Bump versions for models masterJim Hahn1-1/+1
Change-Id: I351d1a0ebd3c7cfa76d57297ce44ef6a6fa8c753 Issue-ID: POLICY-2045 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-09-09Add metadata to propertiesPamela Dragosh4-0/+260
Properties should support metadata - adding it in. Added junit tests for the new metadata field. Issue-ID: POLICY-2060 Change-Id: I2e1933ca4260fe5989f36a098108893a366f657a Signed-off-by: Pamela Dragosh <pdragosh@research.att.com> Signed-off-by: Jim Hahn <jrh3@att.com>
2019-09-05Repair policy types in TOSCA service templateliamfallon6-56/+115
Changed policy types from a list of maps to a map. Changed data types from a list of maps to a map. Made all knock on changes to adapters and tests. Updated Issue ID. Added onap.policies.controlloop.guard.coordination.FirstBlocksSecond.yaml policy type that is required to be preloaded in policy-api. Issue-ID: POLICY-2047 Change-Id: Ic8e809eab248fd7242f0e565fa2e3da75bcfbdeb Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-08-27Replace copyTo methods with copy constructorsJim Hahn24-348/+91
Deleted the copyTo() method from PfConcepts and replaced uses with deep-copy constructors. Also added mapMap() and makeCopy() methods to PfUtils to facilitate. Change-Id: Id6391bb806ef0dfab6c1089278bf2b514c7e303e Issue-ID: POLICY-1600 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-08-07replace hashCode function with compareToHenry.Sun13-13/+13
Issue-ID: POLICY-1600 Change-Id: If660cbe84424e492b6db3ab11ef97b37f046b3aa Signed-off-by: Henry.Sun <henry.a.sun@est.tech>
2019-08-06Bump version in policy/modelsJim Hahn1-1/+1
Change-Id: Ie8761ccbd05edc80af51e0ae5e8c90a4dfaf7715 Issue-ID: POLICY-1965 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-08-05Bump versions to 2.1.2jhh1-1/+1
self-release process need to generate partial releases with some jars missing. Workaround is to bump versions an additional patch number. Issue-ID: POLICY-1953 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I4b8fa38f082d8f06c7fe56a26f8c55db91cd1d9e Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2019-06-27Use ToStringTester from utils-testramverma3-3/+5
Changing ToStringTester from utils to utils-test Bump up common to 1.5.1-SNAPSHOT Change-Id: I7427673c73bd1cc52d5f24a0542e89eb33a39ae8 Issue-ID: POLICY-1746 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-06-21Bump models to 2.1.1 SNAPSHOTPamela Dragosh1-1/+1
Released 2.1.0 Issue-ID: POLICY-1737 Change-Id: I2bc12dd4a9cdad7a867e3d710bb427493de6c7f4 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-06-19Merge "Change getCanonicalName to getName in models"Pamela Dragosh6-6/+6
2019-06-18Change getCanonicalName to getName in modelsJim Hahn6-6/+6
Per javadocs, getName() should generally be used instead of Class.getCanonicalName(). This change only applies to classes; it does not apply to File objects. Note: this impacts the output from PfValidationMessage, as it will now list the names of embedded classes with a "$" separator instead of a ".". Change-Id: I2cd64bc0281dd324bf80eac57335a7299a516447 Issue-ID: POLICY-1646 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-18Removed unused imports from modelsJim Hahn1-3/+0
Change-Id: I1f64127e1d783a962304c0add1524a57d6c24e4b Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-18Merge "Fix the bug of cannot return multiple versions of particular tosca ↵Pamela Dragosh2-5/+7
policy and policy type"
2019-06-17Fix the bug of cannot return multiple versions of particular tosca policy ↵Chenfei Gao2-5/+7
and policy type Issue-ID: POLICY-1807 Change-Id: I831c720993930a911d301a82b59a74cda7cb0c50 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-06-17Fix simple sonar issues in models-toscaJim Hahn33-1088/+787
Change-Id: I36a91fbbd95df7aff2656a97dd09b778cdbb798f Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-17Merge "Allow multiple versions of entities to be returned"Jorge Hernandez8-9/+146
2019-06-14Allow multiple versions of entities to be returnedliamfallon8-9/+146
Fix .gitreviw file to point at "master" rather than "dublin" Allow return of multiple versions of policy types and data types in TOSCA service templates and multiple policies in TOSCA topology templates. Because the return type is a list of singleton maps, utility methods were added to return flat maps of poliicy types, data types, and policies keyed by a compound ToscaEntityKey name/version key. Issue-ID: POLICY-1807 Change-Id: I355038aaca26f41064d0e3cb3b45b1de2294cf5f Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-06-13Remove isNullVersion from identifier classJim Hahn2-15/+0
ToscaPolicyIdentifierOptVersion had an isNullVersion() method which is not being used. Removed this version, thus eliminating the need to include a jackson @JsonIgnore annotation. Change-Id: I03309099a1173591736f69b82b549ebce7994169 Issue-ID: POLICY-1653 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-07Fix version field to represent policy version instead of type versionChenfei Gao2-11/+16
Added changes to make version field in return of GET guard policy call represent the version of guard policy instead of its type version. Issue-ID: POLICY-1809 Change-Id: Ie8db6e89d8439576ee5f6ee99c3222386775b195 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-05-29Change version to 2.1.0Pamela Dragosh1-1/+1
Bump for El Alto Issue-ID: POLICY-1747 Change-Id: I72ec2583715744e9e6debe84b75d0c1d3ffab997 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-05-23Bump to 2.0.2-SNAPSHOTPamela Dragosh1-1/+1
Released 2.0.1 Issue-ID: POLICY-1700 Change-Id: I0f40470e9a8bfb7f8136d34b65977b1b4c54e10e Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-05-23Add logging to model providersliamfallon3-27/+166
Issue-ID: POLICY-1777 Change-Id: I67bf56a7848bbb0495d9e8c215b665fde5c67f1d Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-05-22Fix name/version regexp in model keysliamfallon2-4/+4
The regular expressions for checking names and versions in policy key names and versions were not expressive enough to restrict all error names and versions. Issue-ID: POLICY-1777 Change-Id: I037eca051f6c7a9f1e7182150d40d8b8d906a75c Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-05-21Add version on legacy get/deleteliamfallon4-147/+190
Issue-ID: POLICY-1777 Change-Id: I5b07ad1acdb4a614a50cb15978130c19bc5786f7 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-05-16Allow policy type prefix on policy guard policy idliamfallon2-5/+49
In order to identify the policy type of a guard policy, we need to have the first part of the policy id as the policy type identifier prefix. Issue-ID: POLICY-1776 Change-Id: I1d6a3c4b122d978ff7ef40ce76ced7f160ebd4fa Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-05-15Step snapshot version of policy modelsliamfallon1-1/+1
Issue-ID: POLICY-1630 Change-Id: I163b4566030f9beebdbb546814b1a7a777ce1205 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-05-14Remove sonar issue in simple providerliamfallon1-6/+7
Issue-ID: POLICY-1738 Change-Id: Id85d710154727c7c535db7cc50af88f52114a358 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-05-09Store legacy op policy properties as plain stringsliamfallon1-18/+2
THe properties of legacy operational policies are already encoded and should not be stored in JSON format. Issue-ID: POLICY-1759 Change-Id: I3e2a69f216348c02c2ef9c23282f87da52a7f390 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-05-09Store policy type version in policy before DB writeliamfallon1-1/+2
The policy type version must be updated on a policy before it is stored to the database, otherwise the database value is incorrect. Issue-ID: POLICY-1738 Change-Id: I0a7f2da3837497dd999141f40466d6507c26159b Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-05-08Add JSON encoding to legacy policy propertiesliamfallon4-21/+61
Now that all properties on policies are stored as JSON, the properties on legacy policies must also be stored as JSON in the database. Issue-ID: POLICY-1753 Change-Id: Ia75a02c8d6f595ce0fb68ac1fa2f2399fbc08f6e Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-05-07Set default and check existance of Policy Typeliamfallon12-19/+187
The TOSCA specification has a "bug" in that it does not have a field to specify the version of a policy type to use. We already had introduced the "type_version" field for this. This review introduces setting of the default version of a policy type to be be used by a policy as the latest version of the policy type in the database. As a side effect of this, we now have to check for existence of the policy type of a policy in the database. This means that creation/update of a policy with a non-existant policy type specified will now fail. Issue-ID: POLICY-1738 Change-Id: I27080cf6cd358948810dab6897c72dfe4d41fe91 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-05-05Serializaiton of properties to DB as JSONliamfallon5-9/+28
Properties should be serialized to JSON prior to writing to database and deserialized from JSON when read from database. Issue-ID: POLICY-1736 Change-Id: I5ad3fd4a87079f4557f5fcb825395f0b4bec3318 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-05-02Fix bug in guard policy metadata creationliamfallon2-3/+32
Issue-ID: POLICY-1728 Change-Id: Ie33a30a811fcd8c128dfac87c17dcb37da6d42b4 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-20Merge "Fix a bug in adding one-digit policy-version in metadata"Jorge Hernandez2-6/+6
2019-04-19Fix a bug in adding one-digit policy-version in metadataChenfei Gao2-6/+6
Original change of adding single digit policy-version in tosca policy metadata does not take effect actually. It is added into metadata of authorative tosca policy but not jpa tosca policy. Identify the issue at the last minute and fix it. Issue-ID: POLICY-1442 Change-Id: I8aefa546f757f7841554e3caf00ccc476d23ebf5 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-04-19Exclude jackson-databindPamela Dragosh1-2/+6
Jackson databind has security issues, sometimes its easier to just exclude it if possible. This repo doesn't use it directly, the swagger dependency pulls it in. It doesn't look like our usage of swagger dependency would require the jackson-databind as we only use the annotation: @ApiModelProperty NOTE: Swagger also pulls in jackson-annotations, which seems to be used by a few modules for JSON annotations. eg. those modules are using jackson-annotations indirectly via the swagger dependency pulling in that dependency. Not a big deal. Compilation of policy/api repo works with this exclusion. Issue-ID: POLICY-1507 Change-Id: Ic8501df5ad4f4fc8f6cd93e739d7ff2e52d98785 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-04-16Don't include "nullVersion" in swagger APIJim Hahn1-0/+2
Swagger sitll uses jackson, thus it is including ToscaPolicyIdentifierOptVersion.isNullVersion() in the API that it generates. Added @JsonIgnore annotation to prevent it from being included. Similar issue with get/setVersion() in PdpGroup. Created POLICY-1653 to remove the isNullVersion() method altogether in El Alto. Change-Id: I6cb7b7d1d75258eeb9d6f9b6c7a48eeb32174307 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-15Add serialized name for typeVersionChenfei Gao1-0/+4
Add serialied name and swagger ui rendering name for attribute typeVersion in ToscaPolicy. Issue-ID: POLICY-1515 Change-Id: I42e85117c5f47901bf8c16d3cc6f162a8b6db5e1 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-04-15Merge "Use keys to speed DB queries"Pamela Dragosh1-2/+7
2019-04-15Use keys to speed DB queriesJim Hahn1-2/+7
When a filter specifies a name (and possibly version), those can be used to speed DB searches. Modified the code to use the keys rather than always retrieving every record before applying the filter. Change-Id: I6b48d9e6880ab7e8132d5d8f770394720031b9b5 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-15Add conversion from plain Ident to IdentOptVersionJim Hahn2-2/+28
Added a "copy constructor" that copies an Ident to an Ident with an optional version. The reverse does not make sense, so did not add that (e.g., version may be null or may just be a prefix, while the version in Ident is major.minor.patch). Change-Id: Ifd3935a998cd4c1cb5113a59c5f36a7d9baf79ff Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-14Add prefix matching for policy versionJim Hahn2-9/+30
Re-introduced regular expressions to match policy version so that the policy version found in the metadata, which is just the major number, can be matched with a policy's version, which is of the form, major.minor.patch. Simplified equals() test, as we already know "text!=null". Added filterPrefixPred() and modified policy filter to use it when matching versions, as it is simpler to use when matching a version prefix. Also added tests to PfObjectFilterTest to test each of the XxxPred() methods. Change-Id: I0734873f701a539e883fe25b8eecfdde60cc8b6d Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-12Add validation methods for PAP REST APIJim Hahn8-18/+212
Also made the identifier classes comparable. Stupid tabs. Change-Id: I54c0595c6a2c61a1b72b58fe1d667657f9d5d71e Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-12UNit test and minor fixes for DB parsliamfallon5-47/+31
Add unit test for the new database provider driver parameter. Address the comments raised in the last review. Issue-ID: POLICY-1095 Change-Id: I9f629d9f4446d12bfb492e00e49e07b97ef5a490 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-11Merge "Fix database properties"Pamela Dragosh6-76/+77
2019-04-11Fix database propertiesliamfallon6-76/+77
Issue-ID: POLICY-1095 Change-Id: I3edd70898836d3bd978643857d1ba29599b1cf6c Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-11Use policy-id instead of nameJim Hahn1-0/+3
When CLAMP deploys a policy to the PDPs, it uses field names found in the meta-data, which are "policy-id" and "policy-version". Modified the class used by that particular to use those field names when encoded/decoded via gson. Change-Id: Ib67bd2cd05a906cc809dc6078efdabbd7aa1fa37 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-10Add policy ID and version to metadataliamfallon1-0/+13
Adds the policy-id and policy-version of the policy to the policy metadata, duplicating the policy key in therre. Issue-ID: POLICY-1095 Change-Id: I49603766141f5dee47573edc9f05d2ee2cf9da52 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-10Finish unit test on policy-modelsliamfallon30-414/+748
Unit test coverage well over 90% in policy-models-base policy-models-dao policy-models-pdp policy-models-tosca policy-models-provider Issue-ID: POLICY-1095 Change-Id: I7703e2ae8a93575ca478c3d809ff8c1fb9f0f334 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-09Add unit tests for policy type and policy filtersliamfallon8-6/+800
THis review adds unit tests for the authorative concepts in the models-tosc module and adds unit tests for the authorative and and database providers. Issue-ID: POLICY-1095 Change-Id: If98deea99658056030dd47725b0c0a4266d84106 Signed-off-by: liamfallon <liam.fallon@est.tech>