aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ncmp-rest/src/main/java/org/onap
AgeCommit message (Collapse)AuthorFilesLines
2023-09-25Refactoring persistence classessourabh_sourabh2-3/+3
- Created a common ncmppersistence pkg inside ncmp service "api/impl" pkg". - Move "inventery" into "api/impl" pkg. - Created common class named as "NcmpPersistence" inside "ncmppersistence" pkg. - Move all the commin constants and methods into "NcmpPersistence". - SubscriptionPersistence and InventoryPersistence extends "NcmpPersistence". - Find and replace all the constants of NCMP. Issue-ID: CPS-1883 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: Id3e678109766d680589fa7aab965ea251a55f075 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-09-22Reinstate Spring Boot 3.0 after revertegernug1-1/+1
Issue-ID: CPS-1789 Signed-off-by: egernug <gerard.nugent@est.tech> Change-Id: Iee5c514ccdba36a387f83948d8a3ba26e6b1de5b
2023-09-20Revert "Migrate CPS to Spring-boot 3.0"Toine Siebelink1-1/+1
This reverts commit 9693ec51cf6526082f0ad0c3ad208d144cbbb163. Reason for revert: Bug fix delivery Change-Id: I73bdc1528192c662983b0bbef73b10b6d612a719 Signed-off-by: egernug <gerard.nugent@est.tech> Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2023-09-14Migrate CPS to Spring-boot 3.0egernug1-1/+1
Issue-ID: CPS-1789 Signed-off-by: egernug <gerard.nugent@est.tech> Change-Id: I932fca8a50cedf2ae0604401c5e2b27896e4d449
2023-07-20Refactor ncmp request handlers (fix async issue)ToineSiebelink5-177/+131
- simplified request handlers (sub)classes (no more need for default interface) - fix issue with async execution of data operation requests (wasn't really async) - removed redundant (unreachable) check in production code - Improved code coverage (branches) ncmp request handlers added UNIT test - removed MVC test scenarios now covered by appropriate unit level tests - applied Spock Polling Condition for verifying async call Issue-ID: CPS-475 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Ibe601c709de65080fa8898f2419fdbd92c5ba27d
2023-07-13Introduced a dmi rest demo csit stubsourabh_sourabh1-4/+2
- Introduced a new response code 0 for data operational success response. - Created a new dmi plugin rest stub for demo and performance testing. - Removed dmi plugin stub of wiremocked. - Updated parent pom to add newely created demo stub. - updated docker compose to add neww demo stub with profile for CSIT, demo and performance testing. - Removed target id list from unsupported operation/datastore from REST response. Issue-ID: CPS-1560 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: Ie8198366df820e7d4b8b6e8a85ff9cdb0fce7435 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-07-11Combine alreadyDefinedException classesdanielhanrahan1-2/+1
Issue-ID: CPS-1774 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I52ff9074a9f8188e8635a811b0d2713a97cb4b10
2023-06-26Chsnge to OpenApi 3.0egernug2-12/+12
In preparation for the Java 17 and Springboot 3 migrations Swagger Codegen has to upgrade to OpenApi 3.0 This effects cps-rest and cps-ncmp-rest Issue-Id: CPS-1745 Signed-off-by: egernug <gerard.nugent@est.tech> Change-Id: I18b8e9ca26d0123009702c2474efbfbeec6d4c44
2023-06-22NCMP : Replacing the word 'Batch' as 'DataOperation'.raviteja.karumuri5-47/+47
Issue-ID: CPS-1754 Signed-off-by: raviteja.karumuri <raviteja.karumuri@est.tech> Change-Id: Ie9f56effb160582ba7177331fb6260b2bde2342b
2023-05-25NCMP: Update existing Batch endpoint (Moving url param into rest body)sourabh_sourabh7-75/+158
- NCMP batch endpoint is updated to accept details into request payload. - Removed unused code of previous impl. Issue-ID: CPS-1635 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: Ic290b750557da06b861c5a4a9bb12debc495ec2e Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-05-09NCMP: Delete DatastoreType enum from cps-ncmp-restsourabh_sourabh4-101/+3
- Delete duplicate enum of datastore - Use datastore from cps-ncmp-service Issue-ID: CPS-1635 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I36484d6a327c81d81741b18a932fc6a1febfc520
2023-05-03Refactor datatrore handling in API requestsToineSiebelink7-133/+101
- Fully parameterized datastore(name) - Improved controler testing to verify all parameter handling - Simplified service inject (alwasy using contructors instead of @AutoWire) - Added delay to fix isuse with intermitting failign test that tests invocation of a method that is executed on a separate thread Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Iba5d118d2484badee9c7c90ec7694882f6557d16
2023-04-27CPS-1553 :REST endpoint to accept collection of cm handles for GET operationsourabh_sourabh10-298/+338
-Introduced an interface having all un-implemented or default defination of any method that is further extended or implemented by abstract or stubbed controller. -Exposed an endpoint to accept bulk request -Modified an existing methods for more readability. (Parameterized datasource for ... methods) -Code impl. for getResourceDataFromDmi method to send bulk request to new proposed dmi-plugin endpoint that would accept bulk request. -We need to investigate a groovy test that fails only into onap CICD pipeline. For now it's commented out by added TODO tag. (org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy:205) Issue-ID: CPS-1553 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: Ieac39690956e3a0eab41068db57c5d93a16d04f0 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-03-22500 Error Reponse on NCMP inventory cmhandle searchseanbeirne1-1/+4
Issue-ID: CPS-1563 Signed-off-by: seanbeirne <sean.beirne@est.tech> Change-Id: I5579e8e852c20ce61a6684140198e989f7876d79
2023-03-02Refactor cmHandle(ID) queriesseanbeirne2-7/+8
- first execute cm-handle id search only - get cm handles for ids only when needed using multiple-get-method - use Collection interface where posisble (instead of Set) - use java Function to combine multiple queries in a more genric way Issue-ID: CPS-1494 Signed-off-by: seanbeirne <sean.beirne@est.tech> Change-Id: Icfcb8ec94f75e261303aaee5c9034b920c01f3c4
2023-01-31Introduce InstrumentationToineSiebelink1-1/+4
- Add instrumentation related dependency - Added Timed Instrumentation - CPS-Service Crud methods - CPS Yang parsing - NCMP Registration methods - NCMP Events handling - Remove manual Gauge for YanResources Cache as (better!) instrumentation is already built into the 3PP - Sorted dependecies alphabetically (as we used to enforce, to prevent duplicates) - Added ## P E R F O R M A N C E T E S T R E S U L T S ### mini report - (unrelated) test improvement (because of bug that turned out to be invalid) Reviewers: Sourabh,Priyank, Luke Issue-ID: CPS-1457 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I34b20bece2f59488b022b8effa9470704c57be4d
2022-12-01Filter on private properties of CM Handlesleventecsanyi2-1/+18
- Moved cm handle query validation to cps-ncmp-service (where it belongs!) - Added new enum type for private/public field types - Created new methods for private and public queries - Added new REST endpoint - Created service methods for filtering on different types of properties - Refactored getPublicPropertyPairs and queryCmHandleAnyProperties - Added unit test for the controller layer - Fixed refactoring suggestions - Imporved code coverage with unit tests - Refactoring - Added new functionality to NcmpRestInputMapper - Updated version number to 3.2.1-SNAPSHOT and updated release-notes.rst Issue-ID: CPS-1236 Change-Id: I0ddf6866473f7c3c6b8507d222d441bf97ca6bdc Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
2022-11-15Query data NCMP-Operational with CPSpathlukegleeson8-129/+237
New GET Endpoint: /v1/ch/{cm-handle}/data/ds/{ncmp-datastore-name}/query?cps-path={CPSPath} Implemented error for {ncmp-datastore-name} other than operational - (Toine) Refactored and renamed (abstract) handler for better re-use Mainly by introducing a separate handler for OperationalQuery Reviewers Toine, Sourabh, Priyank Issue-ID: CPS-1002 Signed-off-by: lukegleeson <luke.gleeson@est.tech> Change-Id: Iaca018869d95d4ce800072431baa190050a6dad0
2022-10-19Improve code coverageleventecsanyi3-48/+1
- Fixed and refactored unit test to get over the 97% coverage baseline. - Removed unused exception. Issue-ID: CPS-475 Change-Id: I6dbcba58b880a584f6d9346e2aca6c763e5d2081 Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
2022-10-17Fix SonarQube Violationsleventecsanyi1-0/+3
- Fixed SonarCube issue: added private constructor to TopicValidator and a unit test. Issue-ID: CPS-475 Change-Id: I4379522f023f32c8999a3ee595392bfbab147050 Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
2022-09-13Handle partial failure (improvements)ToineSiebelink1-0/+7
- catching of failures on retry of individual nodes - extract cm handle id from xpaths (can only report xpaths in cps core) - add test for same Issue-ID: CPS-1232 Issue-ID: CPS-1126 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Ice2032c8b15fea97ae0aaa4d1ed642b3499228fa
2022-09-07Handle invalid operations on merged datastore endpointbmiklos4-8/+92
- Move the other endpoints under the same thats handling the get - Add exceptions to handle invalid cases - Add new tests for testing the invalid cases Issue-ID: CPS-1001 Issue-ID: CPS-1219 Change-Id: I26fd57b5921f976cde7089b4cf1e8c0e5d8dc43b Signed-off-by: bmiklos <miklos.baranyak@est.tech>
2022-09-01Implement merging all ncmp datastore endpoints into onebmiklos10-109/+504
- Merging all endpoints under /v1/ch/{cm-handle}/data/ds/ncmp-datastore:* to /v1/ch/{cm-handle}/data/ds/{ncmp-datastore-name} - Implementing missing tests from parent - Introducing abstract class to keep the common code and just pass in the supplier to be executed in sync or async manner - Removed the existing get endpoints for passthrough-running, passthrough-operational and operational and merged them into a common get endpoint Issue-ID: CPS-1178 Issue-ID: CPS-1001 Change-Id: I6956c81d5acfa8fb11217bcc16cb795b62070fa3 Signed-off-by: bmiklos <miklos.baranyak@est.tech>
2022-09-01Get all cm handles by DMI plugin Identifieremaclee1-3/+14
- api added to get cm handles by dmi plugin identifier - response object refactored from RestOutputCmHandle to collection of Strings (cm handle ids) - added public and private methods in CmHandleQueries to get cm handle ID by dmi plugin - added unit tests including test to show that there are no duplicates on response Issue-ID: CPS-1136 Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech> Change-Id: Ia3bdc16172a90ad3a3f9ae11cddcad1352188726
2022-08-02Merge "Enable/Disable Data Sync for Cm Handle"Joseph Keenan1-0/+14
2022-07-29Query CmHandles using CPS pathlukegleeson1-1/+1
Added withCpsPath condition parameter Validated to prevent misuse and blocking of querying using private properties Updated OpenAPI with examples and links to documentation Moved methods related to cmHandle querying using cps path from InventoryPersistence to CmHandleQueries Renamed private method deleteSchemaSetAndListElementByCmHandleId to deleteCmHandleByCmHandleId Issue-ID: CPS-977 Change-Id: I83827215b7e58de74f8f62cd0140516d217d93f1 Signed-off-by: lukegleeson <luke.gleeson@est.tech>
2022-07-28Enable/Disable Data Sync for Cm HandleDylanB95EST1-0/+14
-Create API Which will enable/disable data sync enabled flag -Default functionality of module sync watchdog is to set to false -Remove global config param -Will set initial sync state based on data sync enabled flag -Throws an Exception if the same data sync enabled flag tries to be set -Throws Exception if state is not in READY -Data Sync enabled must be true to complete data sync process - Delete all resource data within fragment table related to synced cm handle when data sync is set to false Issue-ID: CPS-1133 Change-Id: Ib47bbd8293f083c1d705d91bd0def74e6a105c72 Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
2022-07-04Simplified 'External' lock reason Mappinglukegleeson2-4/+23
Refactored LOCKED_MISBEHAVING -> LOCKED_MODULE_SYNC_FAILED CompositeStateMapper will change internal reason LOCKED_MODULE_SYNC_FAILED to external reason LOCKED_MISBEHAVING for client payloads Changed openapi description of lock-reason to reflect only enum currently available LOCKED_MISBEHAVING Issue-ID: CPS-1099 Signed-off-by: lukegleeson <luke.gleeson@est.tech> Change-Id: I9cda45f6c30b94684ee1c8ad0c49e35a3a824d52
2022-06-30Add method to get YANG module sources for CM handleemaclee3-1/+25
- part of this commit includes renaming the enum SyncState to DataStoreSyncState Issue-ID: CPS-1064 Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech> Change-Id: I6bf419141a1b33f09871946445cdfff422c8c354
2022-06-30Merge "Kafka consumer can not be turned off"Toine Siebelink1-19/+19
2022-06-30Kafka consumer can not be turned offJosephKeenan1-19/+19
-NOTE: Build will fail until docker-compose version issues on build server are fixed --Ticket raised https://jira.linuxfoundation.org/plugins/servlet/theme/portal/2/IT-24219 -added flag for async -added response if async is triggered without being enabled & associated test -modified to use one global flag for notifications Issue-ID: CPS-1088 Signed-off-by: JosephKeenan <joseph.keenan@est.tech> Change-Id: If9d988b4dcb71bf37c1b1bf9464090782708ffc2
2022-06-29Get cm-handle state endpointlukegleeson2-7/+24
Added new get cm-handle state endpoint Refactored RestOutputCmHandleState to CmHandleCompositeState Created new RestOutputCmHandleCompositeState OpenApi object ^This is done so that we get '"state: {" at the start of JSON response Refactored RestOutputCmHandleStateMapper to CmHandleStateMapper Added more detailed composite state to get cmHandleDetails endpoint tests Rebased code Code rebased on top of 129658: Unable to change state from LOCKED to ADVISED | https://gerrit.onap.org/r/c/cps/+/129658 which fixes output error Issue-ID: CPS-1019 Signed-off-by: mpriyank <priyank.maheshwari@est.tech> Signed-off-by: lukegleeson <luke.gleeson@est.tech> Change-Id: I361117c98c256a4aa578c13d21926bc6d7876a15
2022-06-22Data Sync Watchdog Processsourabh_sourabh1-1/+1
- Get all the Cm Handles state in READY and Operational datastores sync state in UNSYNCHRONIZED - Get a random Cm Handle - Get the first resource data from the node - Save the data in Cps Db - Update the Operational datastores sync state to SYNCHRONIZED Issue-ID: CPS-1052 Issue-ID: CPS-1053 Issue-ID: CPS-1054 Change-Id: I9a20391ef30e6d56c4d789a92b8bf42cd3756c62 Signed-off-by: Lathish <lathishbabu.ganesan@est.tech> Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2022-06-13Fix sonar code smellskissand2-1/+4
- https://sonarcloud.io/project/issues?resolved=false&types=CODE_SMELL&id=onap_cps&open=AYFC3OguDZ5Vb3SQMOU1 Issue-ID: CPS-1016 Change-Id: Ic8fdae78337da1ff2c239ae2dfae67e23e88a4bb Signed-off-by: kissand <andras.zoltan.kiss@est.tech>
2022-06-09Merge "Fix sonar code smells"Toine Siebelink1-5/+1
2022-06-09Fix sonar code smellsemaclee1-5/+1
- Remove useless curly braces around statement (https://sonarcloud.io/project/issues?resolved=false&types=CODE_SMELL&id=onap_cps&open=AYD_5_HLFWip2-KRhcLs) - Define a constant (https://sonarcloud.io/project/issues?resolved=false&types=CODE_SMELL&id=onap_cps&open=AYEj9y6sq272EuFEMiu-) Issue-ID: CPS-475 Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech> Change-Id: Ib430fac481b29dba8725ed0dac4da3daa56a3984
2022-06-08Merge 2 'query' end points in NCMPkissand2-61/+97
- merge two endpoint for a same backend - use xPath query instead of sql query - modify searches endpoint to return a cmHandle object with all public properties - handle old (deprecated) queries - handle public property queries - create useful examples - use more verbose error messages - simplify openapi yamls - create new query service - change second endpoint name to a better matched name - modify legacy tests with new requirements - create new tests for the new scenarios Issue-ID: CPS-1016 Change-Id: I7476e9dbd510ec93b5b48ce85d477ecb2dadffff Signed-off-by: kissand <andras.zoltan.kiss@est.tech>
2022-06-01Module Sync Lock State implementationDylanB95EST1-20/+1
Implementation of Lock state for module sync watchdog Cm Handle state is locked if any exception is found during sync process Make changes around READY state method in line with the new schema set Add last updated time to composite state Remove running datastore references as this is being done at a later time Issue-ID: CPS-875 Change-Id: I6bd159faefef2fa84dbf536c292ff0a132793381 Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
2022-06-01Fixing CompositeState mappingmpriyank1-1/+9
- Mapper null check - NcmpServiceCmHandle mapping for the new composite state - Added global parameter for jackson to include only NON_NULL attributes in the response Issue-ID: CPS-1066 Change-Id: I1924fef45345c77873f9c788baa701311e72bea7 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-05-25Async request response NCMP -> ClientJosephKeenan3-41/+142
-Added consumer for DMI events and producer for forwarding to client -Added schemas for events -Updated tests -Added new module for ncmp events -Used mapstruct for event mapping Issue-ID: CPS-830 Change-Id: I096d08af9d69092cf8651e11eaa00ce441fc3605 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Signed-off-by: JosephKeenan <joseph.keenan@est.tech> Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Signed-off-by: JosephKeenan <joseph.keenan@est.tech>
2022-05-24Enhanced response with Complex State in APImpriyank2-0/+83
- Introduced RestOutputCmHandleState in API specs of retrieveCmHandleDetailsById - Mapper to map CompositeState to RestOutputCmHandleState - Enhanced existing test cases and introduced new one to test the mapping result Issue-ID: CPS-1047 Change-Id: I34fa198287e5d920bc0cea312ee4e368f3be2b90 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-05-20Get cm-handle public properties endpointlukegleeson1-2/+19
Added RestOuputCmHandlePublicProperties OpenApi Object Added Get cm-handle public properties endpoint Added rest and service layer functionality for endpoint with tests Fixed Copyright Checker violations Issue-ID: CPS-1018 Signed-off-by: lukegleeson <luke.gleeson@est.tech> Change-Id: Ifc13cde350a49f6ba705a09e31853dc9c73be168
2022-04-08Fix Sonar Qube Violations - Recurring taskDylanB95EST1-1/+2
Fix sonar issues in CPS. - Remove Unnecessary cast to List - Immediately return expession Issue-ID: CPS-475 Change-Id: Ic3fa2f3f92784682045a780d87c6737d04f37659 Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
2022-04-08Refactoring/ Adding Tests for ValidationDylanB95EST2-2/+2
Refactored classes affected by validation Have added tests for anywhere where validation is used Have refactored the parse and sync modules validation to be validated at the public api method Issue-ID: CPS-322 Change-Id: I4989cfd03300fbdca41571d0aa2d0b96978858ba Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
2022-04-06Query based on Public CM PropertiesJosephKeenan1-0/+16
-Updated OpenAPI for new Endpoint -Will replace SQL with CPSPathQuery once investigation is complete -Functionality in place to determine if public properties match - -Added Unit and CSIT tests - small modifications may need to be made -CSIT tests enhanced to add additional nodes and tests Issue-ID: CPS-731 Change-Id: I403e603ce79c4a4a6994d51b459b5703510d5a83 Signed-off-by: DylanB95EST <dylan.byrne@est.tech> Signed-off-by: JosephKeenan <joseph.keenan@est.tech>
2022-04-05Async: NCMP Rest impl. including Request ID generationsourabh_sourabh1-4/+57
- Restructured code and moved some of them at controller and service layer. - Unit is fixed and organized to it's belonging classes. Issue-ID: CPS-828 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I0919218e35b1d11cb579d707f376b76de80409da
2022-04-05[cps] Fix getResourceDataForPassthroughOperational endpointputhuparambil.aditya1-7/+1
Get endpoint only accepts application/json. Issue-ID: CPS-957 Signed-off-by: puthuparambil.aditya <aditya.puthuparambil@bell.ca> Change-Id: Ifc7426fbcd6073a39554014dc18b2107b6343b16
2022-04-05Merge "Structured Exception details for DMI"Bruno Sakoto1-2/+22
2022-04-04Structured Exception details for DMImpriyank1-2/+22
- Introduced DmiErrorMessage in API docs with 502 Bad Gateway - HttpClientRequestException will be thrown which will be exposed as 502 BAD Gateway for the client from NCMP Issue-ID: CPS-917 Change-Id: Iba8f159e8216bc1f63a9ab86208e5c802437e2e8 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-04-01Update CM-Handle registration responseRenu Kumari1-5/+55
- update openapi.yml with new response structure - send only details of failed cm-handle operations - updated csit to validate 200 status Issue-ID: CPS-896 Signed-off-by: Renu Kumari <renu.kumari@bell.ca> Change-Id: I3b868bcc5b8ff488c31faef51edc82c771452234