...
Scenario | URI | Payload/Input Request | Suggested Code / Changes | Comments | |||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Request to create the cmHandle | POST {ncmpRoot}/ncmpInventory/v1/ch/ |
| No Impact. It will create the cmHandle. | Existing behaviour. | |||||||||||||||||||||||||||||||||||||||
Request has updatedCmHandles tag present in the incoming request. | POST {ncmpRoot}/ncmpInventory/v1/ch/ |
case-1 [ "prop1": null ] : Property which needs to be removed must be explicitly set to null case-2 [ "prop2": "newValue2" ]: Property which needs to be updated can have the new values in the incoming request. case-3 [ "prop4": "value4" ]: Property which needs to be added can be present in the form of "name" : "value" as seen above. |
Changes:
| ||||||||||||||||||||||||||||||||||||||||
Request doesn't have updatedCmHandles tag present in the incoming request. | POST {ncmpRoot}/ncmpInventory/v1/ch/ |
| No Change from the code pespective. | Existing behaviour. |
Register or update public cmhandle properties
Method : POST
URI : {ncmpRoot}/ncmpInventory/v1/ch/
Header :
Content-Type: application/json
Request Body
Request Body : {
"dmiPlugin" : "onap.dmi.plugin",
"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
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
module dmi-registry {
yang-version 1.1;
namespace \"org:onap:cps:ncmp\";
prefix dmi-reg;
organization \"Nordix Foundation\";
contact \"rahul.tyagi@est.tech\";
revision \"2021-12-13\" {
description
\"Added support for new list of public additional properties for a Cm-Handle which are exposed to clients of the NCMP interface. \";
}
container dmi-registry {
list cm-handles {
key \"id\";
leaf id {
type string;
}
leaf dmi-service-name {
type string;
}
leaf dmi-data-service-name {
type string;
}
leaf dmi-model-service-name {
type string;
}
list additional-properties {
key \"name\";
leaf name {
type string;
}
leaf value {
type string;
}
}
list public-properties {
key \"name\";
leaf name {
type string;
}
leaf value {
type string;
}
}
}
}
} |