aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest
AgeCommit message (Collapse)AuthorFilesLines
2024-09-04Merge "Support alternate id for CPS-E05 GetCmHandleDetailsById"Daniel Hanrahan1-3/+3
2024-09-04Support Alternate-id for CPS-E05 module searchseanbeirne1-3/+3
Issue-ID: CPS-2370 Change-Id: I0ca3a1df232ad9fd9f76695cd6ea21d36919130d Signed-off-by: seanbeirne <sean.beirne@est.tech>
2024-09-03Support alternate id for CPS-E05 GetCmHandleDetailsByIdmpriyank1-3/+3
- added support for alternate id when retreiving cmhandle details by id - Note : The performance for alternate id fetching will be taken care as part of a separate story. Issue-ID: CPS-2385 Change-Id: I019b85d128e4b0a1f1d61623c92e1a2381c406c0 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2024-09-02Support Alternate-id for CPS-E05 module definitionseanbeirne1-6/+8
Issue-ID: CPS-2379 Change-Id: Idd180c5792575522ceaaa094b94c8f5b36790186 Signed-off-by: seanbeirne <sean.beirne@est.tech>
2024-08-30Support alternate id interface for CPS-E-05 - publicPropertiesmpriyank1-8/+8
- added alternate id support for the existing endpoint - Incorporated previous comments on the indendation - Added new component cmHandleReferenceInPath in openapi docs to depict the correct example Issue-ID: CPS-2378 Change-Id: I63e752fbb6cb0bde49d1ced53f063743d904d74e Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2024-08-29Merge "Invoke Policy Executor and handle not-allowed response"Sourabh Sourabh1-4/+3
2024-08-29Invoke Policy Executor and handle not-allowed responseToineSiebelink1-4/+3
- Execute Policy Executor REST request - Act (and log) on response from Policy Executor - Add dispatcher(mock) in integration test FWK - Add integration test for allow/non allowed and no authorization use cases - disabled PolicyExecution feature by default (only enabled for testware) Issue-ID: CPS-2247 Change-Id: I111ba9ba89cc91649b63b20f88414aa33721dbeb Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2024-08-27Support for alternate-id for CPS-E-05 i/fmpriyank1-12/+12
- Added support for alternateId for CREATE , UPDATE, DELETE and PATCH operation for CPS-E05 passthrough running datastores Issue-ID: CPS-2362 Change-Id: Ie4db1d84dba795e9650949cab3374e0b2570beba Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2024-08-27Support for alternate-id CPS-E05 composite statempriyank1-3/+3
- Added support for alternate id for the composite state API for CPS-E05#15 Issue-ID: CPS-2377 Change-Id: I1af41efb8cec762be68250cae7c1e98fbc61a4f5 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2024-08-12Support alternate Id interface for CPS-E-05 #2seanbeirne1-4/+5
- Supports Alternate Ids for getResourceDataForCmHandle Issue-Id: CPS-2279 Change-Id: I1f145308cec5b545fab2d5c96efbc00fc3a110f4 Signed-off-by: seanbeirne <sean.beirne@est.tech>
2024-07-11Policy Executor Feature ToggleToineSiebelink1-9/+9
- defined config parameters for feature toggle and server details - log request details when feature enabled - improved JavaDoc in Controller - improved configuration properties checks in HttpClientConfigurationSpec Issue-ID: CPS-2311 Change-Id: I1ff4bd3592ce2570ac74f9ec6e62b75001cb611a Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2024-07-09Refactor remaining classes package structureToineSiebelink1-6/+6
-Introduced org.onap.cps.ncmp.config for all config type classes like http, kafka etc. -Introduced org.onap.cps.ncmp.impl.dmi for dmi specif classes like DmiRestClient etc. -Moved most exception classes to org.onap.cps.ncmp.api.exceptions (only two were 'internal' i.e. NOT used in REST so left in org.onap.cps.ncmp.exceptions) -Deleted unused DateNodeHelper class (and related testware) -Moved some classes to org.onap.cps.ncmp.impl.utils -Moved messaging test base classes to org.onap.cps.ncmp.impl.utils.events -All imports were reorganised automatically by IntelliJ -did NOT update any copyright dates (seems incorrect to me anyway) Issue-ID: CPS-2257 Change-Id: Ie28b1777ea278064b46c6a1c3a28f4d0696565e2 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2024-07-03 CPS NCMP: Resolved high cardinality of prometheus metrics for dmi service urlsourabh_sourabh1-2/+1
- Used autoconfigured web client builder for http_client_requests_* prometheus metrics. - Refactored dmi service url builder to create url template and its variables. - Web client is modified to use uri(urlTemplate, urlvars) version. - Deleted InvalidDmiResourceUrlException that no longer needed. - Used DmiServiceUrlBuilder to build dmi health check service url. - Created a new pkg url.builder into utils to have all related classes and record. Issue-ID: CPS-2121 Change-Id: Id67e0f0d4e640bb8f9eea0b6c2db1dba3468e1d7 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2024-07-01Improve handling of Invalid Operation exceptionToineSiebelink1-3/+4
- MOve to API package - Handle in REST Controller to return BAD REQUEST Issue-ID: CPS-2256 Change-Id: I4f96519aaf2e7f781729c8b8671ea02630a2e0a8 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2024-06-27repackage 'data' featureToineSiebelink3-14/+14
- moved relevant classes into these (new) packages: api.data.exceptions api.data.models impl.data impl.data.async impl.data.exceptions impl.data.models impl.data.utils utils.events - removed old unused event class - moves some missed inventory related class to the right place Issue-ID: CPS-2256 Change-Id: I75563e063acc0054769d8f2b13146e6c1d1c6054 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2024-06-27Simplify package structure cps-ncmp-restToineSiebelink6-8/+8
Issue-ID: CPS-2294 Change-Id: Idc3605c1b877be13a8d344875612da6bef791fc7 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2024-06-26Move TrustLevel FeatureToineSiebelink1-14/+4
-Moved TrustLevel impl from Controller to Inventory Facade -Applied new package name convention using impl\inventory\trustlevel for this (sub)feature -Renamed some trustlevel related classes to better describe their role -Disabled failing architecture test (agreed this is tech. debt and created CPS-2293) -Refactored YangDataConverter method names and signatures (moved Spec to correct place) -Cleaned up names and javadoc of class now called DeviceTrustLevelMessageConsumer -Applied conventions to modified test methods Issue-ID: CPS-2255 Change-Id: Iccd20541488e6b61444bb2c7406c90e61a34124d Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2024-06-24Repackage Inventory FeatureToineSiebelink5-16/+16
- decided that cm handle queries is part of 'inventory' feature - a lot of files (~100 total) have changes because of some files have been moved. - The reviewers should probably just focus on the MOVED/renamed (~30) files - New packages (top level only): -- org.onap.cps.ncmp.api.inventory -- org.onap.cps.ncmp.impl.inventory -- org.onap.cps.ncmp.impl.models (common models NOT used in API, this was unforeseen) -- org.onap.cps.ncmp.impl.utils - I am NOT updating copyright years as part of this commit since there are no real code changes and it is simply NOT worth the effort TODO: - extend scope to 'TrustLevel' as an 'internal feature' (TBD) Issue-ID: CPS-2255 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I40b4efc8326068ab9ae1f31b77f46b2fe8579431
2024-06-20Introducing NCMP FacadesToineSiebelink2-37/+30
- NetworkCmProxyDataService was polluted with many non-data operations - it is now split into: 1) NetworkCmProxyFacade, a single thin facade for the (main) controler to redirect calls to the correct services 2) CmHandleRegistrationService(Impl), methods related to registration only - introduced NetworkCmProxyInventoryFacade for the invenoty controller - renamed some services for consitency and clarification - Use facade to acces ncmp data request handlers (instead of direct from controller) - remove unnecesarry wrappings between request handlers and facade - split facades according to names: data & inventory (the REST controllers are not split properly so I think one rest controller will end up needing both facades) Issue-ID: CPS-2263 Change-Id: I250732aa16ec28b43ff642d2adf10ba36f67290e Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2024-06-17Refactor and Move NCMP Data Request HandlersToineSiebelink9-472/+16
- Simplified NCMP Rest Request Handlers - Moved responsEntity wrapping to Controller so most handler methods can have clear return types - Moved NCMP Rest Request Handlers to Service Layer - Moved related exceptions and utils to Service Layer - Used Lombok for constructors - Improved related testware Issue-ID: CPS-2266 Change-Id: I0025fab1c92e0d613825093b6e4b43dae044c01a Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2024-06-13 #2: Used async version of web client for single cm handle read operationsourabh_sourabh5-154/+58
- Code change is done to use async web client for single cm handle read data operation. - CpsNcmpTaskExecutor class and groovy test code is removed. - Use of supplier code is removed from cm handle Query service. Issue-ID:CPS-2259 Change-Id: I2b7a36e8a151a9224937afd876fceb30be6a24ce Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2024-06-13 #1: Used async version of web client for batch read operationsourabh_sourabh1-37/+6
- Exposed async version of post method into dmi rest client. - Code change is done to use async web client for batch data operation. - Use of CpsNcmpTaskExecutor code is removed. Issue-ID: CPS-2174 Change-Id: I7840fd8c6d9debe42e50c860f9cf39d64274df72 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2024-05-22re-enable Operation Too Large Exception: limit 200ToineSiebelink1-1/+1
- settign limit to 200 Issue-ID:CPS-2164 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I728af7658e3f4e0900f286a544dea3bdb5d6773f
2024-05-17Replaced RestTemplate with WebClient in synchronous DMI callssourabh_sourabh1-10/+12
- added DmiWebClientConfiguration - use WebClient in DmiRestClient - fixed unit tests - encode query params for DMI request - added configurable buffer size - Re-used ncmp.dmi.httpclient.maximumConnectionsTotal parameter (as documented in RTD) to control webclient connection poolsize Issue-ID: CPS-2173 Change-Id: I21584563034d58e8ae3ff3cbcf172e0d14b408fb Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2024-05-02Handle error in case of upgrade operationsourabh_sourabh1-2/+3
- Send an error response if cm handle not found for upgrade operation. - Restrict upgrade operation if it is already in progress. Issue-ID:CPS-2204 Change-Id: Iad63732c5b1d2215b06a09ddda1c0c604cd7648c Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2024-04-23[BUG] Make failed async task report failure on Kafka topicdanielhanrahan2-6/+33
- In event of async task timeout, error code 102 (DMI_SERVICE_NOT_RESPONDING) is sent to client topic. - In event of unexpected error (such as database unavailable), error code 108 (UNKNOWN_ERROR) is sent to client topic. - The default timeouts have been adjusted so that the task timeout (60s) is longer than the HTTP and Database timeouts (30s), so that expected codes are returned. Issue-ID: CPS-2186 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I84c3447a625e084c445ab2f5c01e2b32a0c971ac
2024-04-19Temporary dsiable Operation Too Large ExceptionToineSiebelink1-1/+1
- settign limit to 50000 to efftively disable it - ericsson is not ready and wil infrom us when it can be enabled again Issue-ID: CPS-2164 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Ib1a8308a20bd77fcba9c4c9fc94739d5dd731b1f
2024-04-10Introduce and handle Operation Too Large Exception for batch operationsToineSiebelink3-12/+57
Issue-ID: CPS-2164 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Iec05d2013be4f971309f0e75d84dc5d0936eb8ef
2024-03-29Uplift Spring boot 3.2.4emaclee1-0/+3
- uplifted spring boot from 3.1.2 to 3.2.4 - removed redundant dependencies - upgraded relevant dependencies - use of @Bean(some_name) is give a specific bean name - using @Bean(some_name) with @Qualifier so on the injection point to specify which bean to actually inject, this is used as we deal with multiple beans of the same type. Issue-ID: CPS-2101 Change-Id: I64d5bf567b9eb03fb39034a46528d0160b332715 Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech>
2024-03-19Fix SonarQube warningsToineSiebelink4-34/+24
targetted: - Introduced CmResourceAddress (name agreed with Daniel and Priyank) - Extracted out private method in AltenateIdChecker to reduce complexity side effects: - use 'record' java feature as suggested by ItelliJ - had to uprade spotbugs version to avoid incorrect warning on 'record' equeals method - convention: added missing 'asserts' in affected testware - my preference: removed a lot of unnecessary linebreaks in affected testware - removed redunfant (variation) of a 'delegation' test Issue-ID: CPS-475 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Ie0c9d5ebc33196ae14ed6c226843095a2a040d1d
2024-03-15Merge "[Bug] Removing inner TaskExecutor to call DMI"Sourabh Sourabh1-2/+2
2024-03-14[Bug] Removing inner TaskExecutor to call DMImpriyank1-2/+2
- Removing TaskExecutor from cps-ncmp-service package as anyways the call coming over from the cps-ncmp-rest layer is managed by a different thread executor(CpsNcmpTaskExecutor) - Provided 60secs timeout value. - Spawning new thread from a different executor might not be needed - Removing @Async from a non spring managed method as its of no use Issue-ID: CPS-2150 Change-Id: Ic99632983aff2c40df81421d782cf98ec600fc41 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2024-03-13Modify the get cmHandle api to return dataProducerIdentifier, moduleSetTag, ↵JvD_Ericsson1-0/+3
and alternateId (CPS-1964 2) Issue-ID: CPS-2113 Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech> Change-Id: I672e5c8408e77a5fa15d6fc2f41438aca705484c
2024-02-29Add bearer token to NCMP async batch data passthrough (CPS-2126 #4)danielhanrahan2-10/+15
Async processing was not passing bearer token. Issue-ID: CPS-2128 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I75da35cce555c49cca638b68f106a9daba79c24a
2024-02-29Add bearer token to NCMP passthrough operations (CPS-2126 #2)danielhanrahan4-22/+39
For NCMP resource data passthrough operations, accept an authorization header and propagate it to outgoing DMI request if it has a bearer token, otherwise use same behaviour as before Issue-ID: CPS-2128 Change-Id: Ib3bf401abce4221a8b706989fb6f07618aa33fe2 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech>
2024-02-28Revert Spring Boot Upliftmpriyank1-3/+0
- reverting back to spring 3.1.2 - manual changes to revert as other apps not fully ready for the delivery Issue-ID: CPS-2133 Change-Id: I670b67916fa4a5d4e5bced6548b7fcd5ee12e855 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2024-02-22Uplift Spring Boot to 3.2.2waqas.ikram1-0/+3
- Upgraded hypersistence-utils-hibernate-60 to hypersistence-utils-hibernate-63 - Introduced @Qualifier annotations where needed Issue-ID: CPS-2101 Change-Id: I8303592ed91584deb6ca5cd4e49800210b6ea989 Signed-off-by: waqas.ikram <waqas.ikram@est.tech>
2024-02-01Extend API: Get Module Definitionshalil.cakal1-9/+26
- add query parameters: module-name and revision to OpenAPI - extend the controller method to hande the new parameters - add the new method stack to the service layer - extend the SQL query to support the new parameters - add unit and integration testwares Issue-ID: CPS-1135 Change-Id: I089ad2ad71effb58ac0ba809e9f441d6cdb59c4f Signed-off-by: halil.cakal <halil.cakal@est.tech>
2023-11-29Add metrics for NCMP passthrough read operationdanielhanrahan1-3/+2
Issue-ID: CPS-1968 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I9ef5af3e6333674cd5af5e9ca055c8748a63be17
2023-11-02Initial Registration with trustLevel on NCMPseanbeirne1-0/+1
- Updated NcmpServiceCmHandle class to include registration trustLevel Issue-ID: CPS-1902 Signed-off-by: seanbeirne <sean.beirne@est.tech> Change-Id: I7c97928f5cdd82f3036a57ea5f0c149e2872f4f1
2023-10-25Update return body of RestOutputCMHandleemaclee1-0/+7
Issue-ID: CPS-1869 Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech> Change-Id: I946db9e6785fc50775d1c5ff18e7462e8bad9af6
2023-10-11Expose REST endpoint to update YANG schema set using moduleSetTagsourabh_sourabh3-7/+14
- Added new schema to upgrade model into component. - Modified Ncmp rest input mapper to add upgradedCmHandles attributes. - Modified cm handle state mapper to add new lock reason. - Added new method to parse and upgrade Cm handles in DmiRegistration. - YANG data converter is modified to add "module-set-tag" atribute. - Cm handle new query method is added for cps path without appending ancestor. - Modified setCompositeStateForRetry to add lock reason. - New lock reason category is added. - Existing module sync service is modified to upgrade the model "syncAndCreateOrUpgradeSchemaSetAndAnchor". - Sync util method "getModuleSyncFailedCmHandles" to modified to add another lock reason "LOCKED_MISBEHAVING". - Added new attribute "UpgradedCmHandles" into DmiPluginRegistration and DmiPluginRegistrationResponse. - New attribute "moduleSetTag" is added into NcmpServiceCmHandle. - New model "UpgradedCmHandles" is added. - New method "updateSchemaSetWithExistingModules" is added into cps module service to update cm handle with exsting model. - Code coverage is reducced to 96 percentage that would be addressed and pushed into new patch. Issue-ID: CPS-1798 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I540acb404e38fc434de87a0d959bfde710a18b03 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-10-10Conflicting Error codesourabh_sourabh1-1/+1
-Used common error codes for NCMP responses Issue-ID: CPS-1904 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: Id2beaa9f3d49dffd0a193b05fbaa7a6dd801e34a Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
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