Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A dataspace must be defined

CPS service provides a method to create a dataspace

  • createDataspace method in the CpsAdminService

This method takes one parameter, dataspaceName. The value for this parameter is going to be based on the cm handle id provided from NCMP.A dataspace is already defined as part of CPS-352, the dataspace we are using is NCMP-Admin

A schemaset must be created in the defined dataspace

...

  • schemasetName : The value for this parameter is going to be based on the cm handle id provided from NCMP
  • dataspaceName : The value for this parameter is going to be based on the cm handle id provided from NCMP NCMP-Admin
  • yangResourcesNameToContentMap : The value for this parameter will be discussed in more details below.

...

Code Block
languagejava
themeMidnight
titleYangResourcesMap
// We have the list of yang resources retrieved from the db, exisitingYangResources
exisitingYangResourcesexisitingYangResourcesForTheGivenCmHandle
allYangResourcesModuleNameToContentMap = exisitingYangResourcesForTheGivenCmHandle.forEach(yangResource -> newYangResourcesModuleNameToContentMap.put(yangResource.getModuleName(), yangResource.getContent()));

Now the newYangResourcesModuleNameToContentMap allYangResourcesModuleNameToContentMap Map is a complete map that contains the new and existing resources for the cm handle and can now be passed as a parameter to the createSchemaSet method in the CpsModuleService.

The method will now create a new schema set and we can now use this to create the anchor.

Create an Anchor using

...

the schemaset created above

CPS service provides a method to create an anchor.

...

This method takes three parameters:

  • dataspaceName dataspaceName : NCMP-Admin
  • schemasetName 
  • anchorName

The value for all these three is schemasetName and anchorName is going to be base on the cm handle id provided by from NCMP.