aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
AgeCommit message (Collapse)AuthorFilesLines
2019-06-17Change getCanonicalName() to getName() in apiJim Hahn3-15/+10
Per javadocs, getName() should generally be used instead of Class.getCanonicalName(). This change only applies to classes; it does not apply to File objects. Change-Id: Ia1726f178f906bfdfbd056c50598228cff8e1a2d Issue-ID: POLICY-1646 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-05-23Log POST requestsJim Hahn2-0/+76
Add logging of POST requests received via the REST API. Change-Id: I8c71df3a45b8a3369b48eee06165dd5034c115a6 Issue-ID: POLICY-1777 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-05-22Reserve version integer check and delete eligibility checkChenfei Gao4-4/+4
Per Jim's comment, version integer check should come first before checking delete elibibility (i.e. checking if policy is deployed in PDP group or not). Issue-ID: POLICY-1777 Change-Id: Ibd3d8d05a40ef34c558a2e9389596396a69469fe Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-05-21Modify legacy API and policy provider to support version enabled features in ↵Chenfei Gao9-88/+244
legacy db provider Includes: a) Modify legacy API endpoints to retrieve the latest version of legacy policies b) Modify legacy policy providers to support newly added version enabled features in db provider c) Fix corresponding junit test failures Issue-ID: POLICY-1777 Change-Id: I641170b37e2929b5060414832d4b8395493cecdc Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-05-10Add more filtering conditions to filter returned PdpGroups with specified ↵Chenfei Gao1-1/+3
policy deployed Add groupState=ACTIVE and pdpState=ACTIVE to pdpGroupFilter for filtering returned pdpGroup list with specified policy deployed in it. Issue-ID: POLICY-1738 Change-Id: Ie777ab1f6438871b2034c8f2fe7a61595a3f633c Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-05-07Preload legacy operational policy type and guard policy typesChenfei Gao14-8/+382
Includes: a) Add legacy operational policy type and guard policy types into preloading list. b) Fix corresponding junit test failure. Issue-ID: POLICY-1738 Change-Id: I071e898be31e62f47d427094f1e76069fafd0148 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-05-02Fix api sonar bugs - logging exceptionsChenfei Gao2-0/+40
Fix api sonar bugs by logging exceptions in api controllers Issue-ID: POLICY-1710 Change-Id: Ie591e0d4709c43f3e91aa7b94a1305d8814bd695 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-05-01Add version to preloaded policy typesJim Hahn10-10/+20
Change-Id: Iee60e74742dce9df03b5409356dcf2cb433c811c Issue-ID: POLICY-1724 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-26Fix legacy policy type names3.0.2-ONAPPamela Dragosh2-20/+20
The default names were incorrect in the api path. Issue-ID: POLICY-1704 Change-Id: Ib95a7954c6b4a6fef0e871dfd4130e600e03c957 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-04-16Preload policy types when api starts upChenfei Gao18-4/+1443
Includes: a) Preload monitoring and optimization policy types when api component starts up b) Fix the failure unit testing delete policy type c) Enhance several junit test cases to be irrespective of running orders Issue-ID: POLICY-1441 Change-Id: Ia1ba17d58dfbc9a8ee12e789e3867b20111e9cd2 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-04-11Add junit tests for endpointsChenfei Gao18-136/+690
Add junit tests to improve code coverage to > 80%. Modify db setting and remove db authorization from persistence. Issue-ID: POLICY-1441 Change-Id: I6070ac9ba6adba836adeeb547610c27dccf577bd Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-04-10Modify delete safety net and DB lab setupChenfei Gao14-566/+953
Includes: a) Close db connection using try-with-resource b) Modify delete safety net for policy, policy type and legacy policies c) Modify db persistence d) Modify db setup in bootstrap config e) Add unit tests for providers and endpoints Issue-ID: POLICY-1441 Change-Id: Id89bc361c73380df61df35f01f296e47e936e9cf Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-04-09Modify policy provider to support GET/CREATEChenfei Gao15-58/+863
Modify policy and policy type providers to better support GET/CREATE policy/policy types. Issue-ID: POLICY-1442 Change-Id: I7a513be4f9dbd5b48b85a948e3bda7b6c6ab7ddb Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-04-05Incorporate filters in provider functionsChenfei Gao10-65/+398
Use filters to GET wildcard/latest/deployed policies and policy types. Junit tests for providers are coming in next patch/review. Issue-ID: POLICY-1441 Change-Id: Iccd02f395d612ba95728d1bc5808ad16c6f386fe Signed-off-by: Chenfei Gao <cgao@research.att.com> Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-04-03Implement policy provider functionsChenfei Gao28-435/+1395
Includes: a) Implement policy provider functions b) Implement policy type provider functions c) Implement legacy guard policy provider functions d) Implement legacy operational policy provider functions e) Modify API endpoints to align with provider functions f) Hook up API statistics counter Junit tests for providers and new endpoints will be in next patch/review. Issue-ID: POLICY-1441 Change-Id: I113de95f6e0ea5f5436c072536f5e9a178988e5e Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-03-19added file to test ApiRunttimeException.javaSandeep J1-0/+43
to increase code coverage Issue-ID: POLICY-1606 Change-Id: I03b7680df972f3c809d57e6432e61c2422ecea60 Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
2019-03-18added test cases to TestApiParameterGroup.javaSandeep J1-20/+32
to increase code coverage Issue-ID: POLICY-1606 Change-Id: I23350df11457422eb6b56cb6e175dcea0ba2be14 Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
2019-03-17Add API endpoints for legacy policiesChenfei Gao7-44/+878
Includes: a) Added separate endpoints for legacy guard and ops policies b) Added legacy policy providers c) Added hotfix for models package name d) Added new REST controller to http server properties Issue-ID: POLICY-1515 Change-Id: Id69c88810efc8b76fccc62f386d6e189ba297b1e Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-03-17Add test policytype and policiesPamela Dragosh33-2/+1002
Some example policies for vDNS, vFW and vCPE use cases using DCAE TCA. The .input are the expected REST body from the calling client (eg. CLAMP). While the .output are the expected REST body for the return response from policy. The .tosca.yaml are what the DBAO will look like internally. Upgraded to support policy/model merge. Fixed missing tca_policy field in monitoring policies. Update for policy-id. Issue-ID: POLICY-1273 Change-Id: Ib087b184c3ac9a058fe600c6c8a28cca3a71fbea Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-03-15Hotfix for compilation errorsChenfei Gao4-1069/+1077
Added hotfix for compilation errors due to model package name change. Issue-ID: POLICY-1515 Change-Id: Ia58671234bc5a5cfe201ee448d38adca870333b3 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-03-07Add code to follow ONAP API CVS guidelinesChenfei Gao3-81/+481
Includes: a) Added custom headers of versioning info into API response. b) Added custom header of requestID into API response for fulfilling logging v1.2 requirements by copying from client's request header. If no requestID is contained in client's request header, API server will randomly generate one and include it in response header. c) Added extension annotations into swagger to comply with swagger 2.0 spec extension requirements posted in the table of ONAP API CVS guidelines wiki page. d) Updated the package name of TOSCA model POJOs. Issue-ID: POLICY-1270 Change-Id: Ia9e0f18c088604636008201fe5a149dc5fa21de3 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-02-27Add more endpoints and swagger annotationsChenfei Gao12-1038/+991
Includes: a) Organized swagger models into new rest.model package b) Organized provider classes into new rest.provider package c) Added policyType GET/POST/DELETE endpoints d) Added policy GET/POST/DELETE endpoints e) Added swagger annotations for the new endpoints Issue-ID: POLICY-1515 Change-Id: Ia159a4cfebdad36cb1b4a5cc6456d07d2fde09ee Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-02-07Add changes to basic structure of api componentChenfei Gao26-126/+1504
Includes: 1) Changed logging from FlexLogger to slf4j and used the logback.xml aligned with v1.2 logging requirements. 2) Added https as a configurable parameter of api rest server. 3) Added aaf as a condfigurable parameter of api rest server. 4) Added AafFilter classes for healthcheck and statistics. 5) Added api statistics REST entry point. 6) Created related junit tests. 7) Packaged docker Issue-ID: POLICY-1270 Change-Id: I638f61361bb052545e8597531ba3d58019bf1f24 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2018-09-25Clean up checkstyle declarationPamela Dragosh9-32/+26
Fixed the path for finding the src files. Added eclipse lifecycle to ignore the oparent checkstyle bug. Cleaned up existing checkstyle issues. Added entries into .gitignore to ignore debug logging directories created. Issue-ID: POLICY-1136 Change-Id: I684038babcb9723cfc4bef2b2a713425ae077599 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-09-03Add basic main structure for policy-apiKrishnajinka27-0/+1865
Define main pom xml and update to include main. Add the main exception parameters rest startstop classes. Add test cases. Modify comments Issue-ID: POLICY-1066 Change-Id: I2e878a58eef4f021e3a9a991738194127edf4d16 Signed-off-by: krisjinka <kris.jinka@samsung.com> Signed-off-by: krishnajinka <kris.jinka@samsung.com>