...
Issues/Decisions
# | Issue | Notes | Decision |
---|---|---|---|
1 | Add/Remove/Update properties as part of CM-handle registration updateExisting property not part of the update should not be updated/removed. | In the updatedCmHandles request , if we don't provide any existing property in the update , then we don't touch that property and it will remain as it is. See below : Req-002 has "prop3": "value3" which is not part of the update , hence it will remain as it is. |
Scope
- Within the NCMP CM-Handle registration post request add functionality to add/remove properties of an existing CM-Handle.
- Properties are removed by setting the value to null in the update registration request. (Only applicable when updatedCmHandles json tag is present)
- Both Additional and Public properties should be taken care off as part of the update.
- Update Open API docs with details on property updates.
Analysis
REST layer :
- No change as there is no update in the incoming request structure.
Service layer (cps-ncmp-service) :
NetworkCmProxyDataServiceImpl#parseAndUpdateCmHandlesInDmiRegistration(dmiPluginRegistration): already present , we iterate over the incoming request and call the method to handle add or remove attributes from cmHandle.
- NetworkCmProxyDataServiceImpl#handleAddOrRemoveCmHandleProperties(leaves, targetAttributeKey, targetAttributeValue) : new method which will have logic to handle addition or removal of attributes based on the value.
CpsDataServiceImpl#replaceListContent(dataspaceName,anchorName,parentNodeXpath,dataNodes,observedTimestamp) : new overloaded method for replaceListContent.
Proposal
Scenario | URI | Payload/Input Request | Suggested Code / Changes | Comments | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Req-001 Request to create the cmHandle | POST {ncmpRoot}/ncmpInventory/v1/ch/ | Input
{
} } ]
| No Impact. It will create the cmHandle. | Existing behaviour. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Req-002 Request has updatedCmHandles tag present in the incoming request. | POST {ncmpRoot}/ncmpInventory/v1/ch/ | Input
{
} } ] }
| Result
Changes:
|
Register or update public cmhandle properties
Method : POST
URI :
Req-003 Request to remove all the cmHandles for a particular cmHandleId. | POST {ncmpRoot}/ncmpInventory/v1/ch/ |
Header :
Content-Type: application/json
|
Request Body : {
|
"createdCmHandles" : [ { "cmHandle" : "cmHandle1",
"cmHandleProperties" : {
"prop1" : "value1",
"prop2" : "value2",
"prop3" : "value3"
}
"publicCmHandleProperties" : {
"hostedBy" : "cmhandle-5678"
"samplePropertyName2" : "samplePropertyValue2 }
},
{..}
],
"updatedCmHandles" : [
{
"cmHandle" : "ds4errr77",
"cmHandleProperties" : { # To remove a property, set the value to null
"samplePropertyName1" : "updatedSamplePropertyValue1",
"samplePropertyName2" : null # This property will be removed
}
"publicCmHandleProperties" : { # To remove a property, set the value to null
"hostedBy" : "cmhandle-11213",
"samplePublicPropertyName1" : "updatedSamplePublicPropertyValue2" }
},
{..}
],
"removedCmHandles" : [ "node-1", "node-2" , ... ]
}
json attributes:
- "dmiPlugin" resolvable servicename
- "createdCmHandles" used for initial cm handle registrations or subsequent
cmhandle creations - "updatedCmHandles"
Used for updates to cmhandles. Same structure as for create handles - "removedCmHandles" array of cmhandles that have been deleted
from the network (no additional properties
December 2021 Yang Model for Public Properties Support
...
theme | Emacs |
---|---|
title | December 2021 Yang Model |
linenumbers | true |
collapse | true |
...
|
|
...
|
...
|
...
| ||||||
Req-004 Request doesn't have updatedCmHandles tag present in the incoming request. | POST {ncmpRoot}/ncmpInventory/v1/ch/ |
| No Change from the code pespective. | Existing behaviour. |