aboutsummaryrefslogtreecommitdiffstats
path: root/models-provider
AgeCommit message (Collapse)AuthorFilesLines
2020-10-09Bump models to 2.3.5Jim Hahn1-1/+1
Issue-ID: POLICY-2863 Change-Id: Iba0dfe78576a2ad1551c165e3b9f53fa3c55259a Signed-off-by: Jim Hahn <jrh3@att.com>
2020-10-09Bump models to 2.3.4 snapshotJim Hahn1-1/+1
Issue-ID: POLICY-2863 Change-Id: I9d764a0cd695aa95a5880fd20b594e465d14c658 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-10-07Bump models to 2.3.3Jim Hahn1-1/+1
Issue-ID: POLICY-2839 Change-Id: Ifd7f45854904545b4f2973e1429cb791ac00b600 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-09-16Remove base64 encoding of password from modelsRam Krishna Verma6-21/+12
Remove base64 encoding of db password from models. This will have impact on the defaultConfig of API & PAP component. Seperate reviews are raised for those repos. Issue-ID: POLICY-2550 Change-Id: I258f76d01c21893bb40b4095a82e56ed51bd1377 Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2020-09-08Bump models to 2.3.2Jim Hahn1-1/+1
Issue-ID: POLICY-2789 Change-Id: I19b397ecb165bea30059142d9d4c5357ceba9825 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-08-14Remove legacy operational policy from modelsRam Krishna Verma7-353/+6
Removing all the legacy operational policy related concepts, providers, examples etc from models repo. Issue-ID: POLICY-2764 Change-Id: Ie820271381674ccc4eaef0bd6379f673f67701e7 Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2020-07-09Bump policy/models to 2.3.1-SNAPSHOTRam Krishna Verma1-1/+1
Issue-ID: POLICY-2695 Change-Id: I64473cc81ae48942010472f15faac75c13cb0b7d Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2020-06-18Changes for Checkstyle 8.32liamfallon12-22/+5
Issue-ID: POLICY-2188 Change-Id: I6db16763c1d2d80ff934302081a8dfc16afa7d9a Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-05-19Bump models master to 2.3.0-SNAPSHOTRam Krishna Verma1-1/+1
Issue-ID: POLICY-2514 Change-Id: I6a3d4e588a0ff0d15fccf49de66c51ea7d709b4b Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2020-05-19Bump models to 2.2.7-SNAPSHOTRam Krishna Verma1-1/+1
Issue-ID: POLICY-2514 Change-Id: Ie482926a56a5250be5d78a97aa7c1c19311a292c Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2020-05-10Policy DB contents removed on DB deadlockliamfallon1-39/+39
When a DB deadlock occurs, the DB contents can sometimes be deleted becasue the DB removes the Service Template object and recreates a new one in two separate DB transactions. This change makes sure that the object remove and re-create is in a sngle DB transaction, so the operation will either happen or not happen so the DB will not be cleared. Legacy policy handling must also use the SimpleToscaProvider rather than accessing the DB directly, as SimpleToscaProvider keeps the DB structure correct. Issue-ID: POLICY-2548 Change-Id: I263a41cd1d8bec5d7b421045b3b14aad6e6c66d3 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-05-05Policy delete should only return deleted policyliamfallon2-3/+36
The policy type delete and policy delete now only return what is deleted in the service template. Issue-ID: POLICY-2534 Change-Id: I1b8d10c22d4392b0bbb655aa6876ac900ebc81df Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-05-04Fix simultaneous write access to policy providerliamfallon3-6/+40
This change serializes write access to the policy database via the AUthorative TOSCA provider by making sure that only one request is executed at a time. His change should be repolaced by proper session handling in the next release of the Policy Framework project. Issue-ID: POLICY-2533 Change-Id: I5fe4c0f2846981a66eb2f4e1da936fe3c9490ae5 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-04-28modifications in example sdnc naming policyjhh1-8/+8
Issue-ID: POLICY-2525 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I7c6880b63b3ff8f986fb0de27656eda8f6e596a2 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2020-04-24Bump models patch 2.2.6-SNAPSHOTPamela Dragosh1-1/+1
Also point to parent, common snapshots Issue-ID: POLICY-2510 Change-Id: Iad79c341bcfb8cb6bb828ee71e199ba3bb9a838b Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-04-20Test latest policy version is returnedliamfallon1-13/+63
Load 21 versions of the same policy and make sure that the latest version is returned when the LATEST policy is set on the version filter. Issue-ID: POLICY-2352 Change-Id: Iddee33ae53096e18ed2ec67b0c3e837d1d7410a9 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-04-14Bump models to 2.2.5-SNAPSHOTRam Krishna Verma1-1/+1
Issue-ID: POLICY-2378 Change-Id: I5461bafd3c2d19f4f457da0816bba117a2d8b550 Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2020-04-11Bump models patch 2.2.4-SNAPSHOTPamela Dragosh1-1/+1
Issue-ID: POLICY-2378 Change-Id: I51c6c57bdcc0299c25b5ee05f47c20f4542bc02d Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-04-07Address sonar issues in modelsJim Hahn2-9/+6
Addressed the following sonar issues: - use RE2 instead of java.util Pattern for "+" and "*" - don't use deprecated methods - for Date(long), sonar appeared not to parse the argument's type correctly. Modified the code slightly to make sonar happy - duplicate blocks of code - either log or throw - missing assert in junit - for SDNR & VFC, eliminated threads, as they are unnecessary - duplicate code block in different branches - useless assignments - redeclaring abstract methods - cyclomatic complexity - used lombok in some cases (e.g., EqualsAndHashCode) - assert argument order - actually deleted ControlLoopTargetType, because it is not needed and sonar complains regardless of which order is used - add private constructor to utility classes - use StandardCharsets instead of literals Also: - added logback-test.xml to SO to eliminate the voluminous output from the junit test Issue-ID: POLICY-2305 Change-Id: I586c331781bedbd54a115a71847d04d293689445 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-03-25Bump models 2.2.3-SNAPSHOTPamela Dragosh1-1/+1
Released 2.2.2 Issue-ID: POLICY-2378 Change-Id: I829f0dfc88aeaf1f9b7efad91c983628f2a5d706 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-03-24Bump policy-models to version 2.2.2-SNAPSHOTliamfallon1-1/+1
Issue-ID: POLICY-2378 Change-Id: I644e45822154f57d2bf6a81e55df07e2e4ca6966 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-03-20Test cascaded multiple revision getsliamfallon2-79/+773
This patch tests cascaded get requests with multiple revisions. Issue-ID: POLICY-2377 Change-Id: Ie7dc849d7b930b861d38c386a9950ae7e84e2a05 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-03-18Return latest entity on null versionsliamfallon1-5/+4
This review amends the behaviour of "get" operations on entities to always return the latest version of an entity when the version of the search key is the null key (value of 0.0.0). Issue-ID: POLICY-2377 Change-Id: I4f7c12637c90bc1a83ce2ba5ef40e15b461a7d51 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-03-13Consistent returns on Service Template getsliamfallon2-0/+488
This review enables specification of versions of entities on incoming service templates using a ':' delimiter. So this will load version 1.00, version 2.0.0, and version 3.0.0: org.onap.entitiy:1.0.0: version: 1.0.0 org.onap.entity:2.0.0: version: 2.0.0 org.onap.entity version: 3.0.0 So this will load version 1.00, version 2.0.0, and version 4.0.0: org.onap.entitiy:1.0.0: version: 1.0.0 org.onap.entity:2.0.0: version: 2.0.0 org.onap.entity: version: 3.0.0 org.onap.entity: version: 4.0.0 This will load org.onap.entity:1.0.0 name: org.onap.entity version: 1.0.0 This will throw an exception org.onap.entity:1.0.0 name: org.onap.some.other.entity version: 1.0.0 This will throw an exception org.onap.entity:1.0.0: name: org.onap.entity version: 2.0.0 Issue-ID: POLICY-2377 Change-Id: I34bccf065b4ee4d2fe71b052bf009d4a40e2cba8 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-03-06TOSCA Compliant Guard PoliciesPamela Dragosh7-357/+0
Fixing the legacy guard policies and renaming them so we are able to differentiate them. Adding newer, cleaner TOSCA Guard Policies that match the operational guard policies. Removing legacy guard policies. Fixing JUnit so that they don't use indexes to test whether versions are changed correctly. Added back in new guard policies. Fixed the guard policy types to use camel case. Issue-ID: POLICY-2243 Change-Id: Ie611f26f73f41e64c0b467f524f470739158f437 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-02-19Fix cascaded get filtering and speedliamfallon1-1/+49
This change adds proper cascading bahaviour to the returned service template for filtered gets on policies. It also significantly improves the performance on get operations, all get operations on the API now result in only one database query. Issue-ID: POLICY-1402 Change-Id: I7c7d0a8d9f1caf8b610461779e242c34b7f77365 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-02-18Merge "Add safe entity delete, fix multiple entity get"Ram Krishna Verma4-1/+140
2020-02-18Merge "Allow storing database password in environment variables"Ram Krishna Verma1-1/+8
2020-02-18Add safe entity delete, fix multiple entity getliamfallon4-1/+140
This review implements checks on whether entities are being used or referenced propr to allowing deletes. The review also fixes bugs on multiple entity get returning 4040 not found Issue-ID: POLICY-1402 Change-Id: I9cebb9a873098740e9ff4be6284d6307e19838bd Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-02-18Add missing classes to persistence.xmlliamfallon1-0/+2
The recent policy-models changes cascade database changes to some new classes. THis change adds these classes to persistence.xml. Issue-ID: POLICY-1402 Change-Id: I4d9953c8423dc6e33f6852744c394c9cfbc21ac6 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-02-17Add missing entry_schema for operational policy typePamela Dragosh1-6/+7
Also ensure the json for vFirewall matches the yaml. We will need to clean up some of the other legacy operational policies. Or at least rename them. Renamed legacy Operational policies to avoid confusion. Fixed wrong derived_from policy types. Operational Policy Types are now solely for new TOSCA compliant operational policy types. Issue-ID: POLICY-2146 Change-Id: Ia0bcabe6cca8e197f1bec8157a3004a420033969 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-02-14Fix return codes and policy getliamfallon1-24/+34
Change the return codes for validation to return more helpful and correct codes. Fix the policy "get" request to get policy types and data types for a policy get. Issue-ID: POLICY-1402 Change-Id: I89d67f830e9a75bdeef39c4142523c718879f19c Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-02-13Allow storing database password in environment variablesDominik Mizyn1-1/+8
This patch allows to store and get database passwor from environment variables. This is needed if we want to send those variables by helm secrets. Issue-ID: OOM-2287 Change-Id: Id9ea8f43dd07c2b0cdeaa6d14a8033336d26923f Signed-off-by: Dominik Mizyn <d.mizyn@samsung.com>
2020-02-13Update models-tosca for hetter handlingliamfallon1-2/+2
More additions, updates, and fixes for TOSCA service template handling. Better handling of 404 not found on list requests. Issue-ID: POLICY-1402 Change-Id: Id73b9a3cebb5445d4f05ae83e301330ee38a6598 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-02-12Implement validation and hierarchical getliamfallon8-627/+430
NOTE: This review will require changes to the persistence.xml file in other policy framework components. This change brings in two changes: 1) Validation of the references betwen policies, policy types, and data types This change mans that additions to and changes to policies, policy types, and data types must be structurally correct in the change coming in and with whatever is already in the database 2) Hierarchical return of referenced entitites on policy types, policies and data types. When a policy, policy type, or data type is read from the database, the entities referenced byt the returned policy, policy type, or data type are returned as well. Tests are amended for the stricter validation and structure. Examples are corrected where they are incorrect. Issue-ID: POLICY-1402 Change-Id: Ie6a4cb7ed336562338924079114df405f0ab889f Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-01-16Clean up TOSCA provider unit testsliamfallon4-31/+79
SOme outstanding comment on TOSCA provider unit tests cleaned up. Issue-ID: POLICY-2315 Change-Id: I235a5fc9996c81f421f17236afb413df7435de19 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-01-13Read resource dirs in models prvider unit testsliamfallon6-411/+296
Update the unit tests in models-provider so that we can check that the TOSCA artifact that is read from the database is the same as the TOSCA artifact that is stored. This review does some groundwork for that check. Issue-ID: POLICY-2315 Change-Id: Iabc7b247736b862713585a493752bc254cfe1c3d Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-01-10Bumped patch version for policy/modelsHOCKLA1-2/+2
Issue-ID: POLICY-1592 Change-Id: Iafc35fe53e28c815a79041f289cb17b6354ceccd Signed-off-by: HOCKLA <ah999m@att.com>
2020-01-09Merge "update Db provider to support query number"Jim Hahn5-27/+48
2020-01-08Store and return data types for policiesliamfallon1-4/+5
In this change, the data types of policy types are persisted to the database. All policy types currently in the database are returned on all policy type get requests. This will be made more intelligent in the next review. Issue-ID: POLICY-2315 Change-Id: I10065ab9b90e72114a453494fc706d8aabc50c0a Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-01-08update Db provider to support query numberning.xi5-27/+48
Issue-ID: POLICY-1629 Signed-off-by: ning.xi <ning.xi@est.tech> Change-Id: I42c9542adc44d52b760a70e710ab4cc6fa8a1b3b
2020-01-07Support persistence of data typesliamfallon5-105/+102
Data types must be persisted to the database in order for them to be retrieved in policy type queries and later for policy validation. Issue-ID: POLICY-2315 Change-Id: Iacb88501a597aeee8f6d8bcc3d9604c13dc09090 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-12-20pdp statistics database provider implementationning.xi6-119/+193
Issue-ID: POLICY-1629 Signed-off-by: ning.xi <ning.xi@est.tech> Change-Id: Ife65d50c862ed90c3c9a3cea91a2b9a8d874fa14
2019-12-11Merge "Fix minor checksyle issues in models"Pamela Dragosh1-1/+3
2019-12-10Fix minor checksyle issues in modelsliamfallon1-1/+3
New checkstyle profile flagged some minor issues in policy models. Issue-ID: POLICY-2165 Change-Id: I17ed070a3d55601ad31e48fdfd29fff01d29fa42 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-12-10Merge "Add JpaPdpStatistics entity"Ram Krishna Verma1-0/+1
2019-12-09Add JpaPdpStatistics entityshaoqiu1-0/+1
Add JpaPdpStatistics entity which will be used in provider. Add Pdp Statistics entities Issue-ID: POLICY-1628 Signed-off-by: shaoqiu <tim.huang@est.tech> Change-Id: Iab12eb02e2e7f0e366aff64fa665b5d6674f2905 Signed-off-by: shaoqiu <tim.huang@est.tech>
2019-12-07Refactor optimization policiesPamela Dragosh1-9/+9
Optimization policies need to be further refactored so that Resource vs Service type policies can be specified. Issue-ID: POLICY-2066 Change-Id: Ia40a947097692ea7dcc6ea8d13eb8669c37fac14 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-12-05Add new Operational Policy TypePamela Dragosh2-0/+17
New operational policy type for Frankfurt. Updating examples. added sample CLAMP metadata. Issue-ID: POLICY-2217 Change-Id: I941c3a4187a4d164bf793ef2d82c34fccc1a2c35 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-11-13Remove duplicate dao objectJim Hahn1-1/+0
Code was creating the DAO object twice - removed the extra line. Note: this properly doesn't fix the race condition, but it should fix a memory leak. Change-Id: I5f5c6002d42f9bb0525d1b5013b1300e80264645 Issue-ID: POLICY-1832 Signed-off-by: Jim Hahn <jrh3@att.com>