Details
-
Story
-
Status: Closed
-
Medium
-
Resolution: Done
-
None
Description
Within the NCMP CM-Handle registration post request add functionality to remove properties of an existing CM-Handle.
Properties are removed by setting the value to null in the update registration request
this can be done for both Additional and Public properties of the CM HandleOriginal Interface described here: https://wiki.onap.org/display/DW/CPS-391Spike%3A+Define+and+Agree+NCMP+REST+Interface#CPS391Spike:DefineandAgreeNCMPRESTInterface-Sync&ModelAPI #1
Original registration request : {
"dmiPlugin" : "onap.dmi.plugin",
{ "createdCmHandles" : [ { "cmHandle" : "myHandle1",
"cmHandleProperties" :
{ "prop1" : "value1",}}
"prop2" : "value2",
"prop3" : "value3"}
}
}, {..} ]
}
Update registration request : {
"dmiPlugin" : "onap.dmi.plugin",
{ "updatedCmHandles" : [ { "cmHandle" : "myHandle1",
"cmHandleProperties" :
}}{ "prop1" : null,
"prop2" : "newValue2"
"prop4" : "value4"}
}
}, {..} ]
}
- Properties can only be updated using 'updateCmHandles' json tag. Currently this only works with existing properties.
- Property should be removed when explicitly set to null. see above example for "prop1"
- Property should not be removed because it is omitted. see above example for "prop3" (value should remain)
- New properties should be added (unlike current behavior which throws DataNode not found exception)
Code Impacts
- org.onap.cps.ncmp.api.impl.NetworkCmProxyDataServiceImpl#parseAndUpdateCmHandlesInDmiRegistration
- for each CM Handle :
- need to retrieve existing properties (read dat using cps Service)
- compare with incoming (updated) properties
- create dataNode collection representing the updated properties
- instead of cpsDataService.updateNodeLeavesAndExistingDescendantLeaves use cpsDataService.replaceListContent
A/C # Create and agree proposal with team on (https://wiki.onap.org/display/DW/Implementation+Proposals)
- Update Open-API docs with details (add description and examples?) on property updates (https://wiki.onap.org/display/DW/Implementation+Proposals RestDmiPluginRegistration.updateCmHandles)
- Demo update scenarios to team
Out-of-Scope
- CSIT Test, this alternative scenario of normal registration which can be covered by unit (Groovy/Spock)
Attachments
Issue Links
Gerrit Reviews
# | Subject | Branch | Project | Status | CR | V |
---|---|---|---|---|---|---|
126792,1 | Logic to update,add or remove cmHandle properties | master | cps | Status: ABANDONED | -1 | +1 |
126916,23 | Core logic to update,add or remove cmHandle properties | master | cps | Status: MERGED | +2 | +1 |
127246,8 | Fix success response code CM Handle Registration | master | cps | Status: MERGED | +2 | +1 |