...
Jira Legacy | ||||||||
---|---|---|---|---|---|---|---|---|
|
Issues & Decisions
Acceptance Criteria
Add a method to cps-service/src/main/java/org/onap/cps/api/CpsModuleService.java to retrieve all modules and version known by CPS
Steps
- Propose changes to https://wiki.onap.org/display/DW/CPS+Internal+Relation+DB+Schema to add fields for module metadata in yang-resource table (agree with team)
Note. schema is now a screenshot from other tool. Probably best to replace with build-in confluence diagram tool. - Add Liquibase steps to update schema (incl. rollback ?!)
- Update org/onap/cps/spi/entities/YangResourceEntity.java with new fields
- PROBLEM!!! org.onap.cps.yang.YangTextSchemaSourceSetBuilder#generateSchemaContext uses identifiers based on the 'filename' instead of module.-name and revision. Once the SchemaContext is build there is no way to link back to the source it was build from.
Proposal
For the following open question on the Jira.
- RestConf module information contain both Name and Namespace (as well as revision). Do we need both of these for uniqueness? https://datatracker.ietf.org/doc/html/rfc6020#section-5.1 states "The names of all standard modules and submodules MUST be unique". The pitfall could be the word 'standard' here and it might be good to include dataspace as well. https://datatracker.ietf.org/doc/html/rfc6020#section-5.3 states that "Namespaces for private modules are assigned by the organization owning the module without a central registry. Namespace URIs MUST be chosen so they cannot collide with standard or other enterprise namespaces, for example by using the enterprise or organization name in the namespace."
When importing a module, according to https://datatracker.ietf.org/doc/html/rfc6020#section-5.1.1 name and revision are used to identify the module that is to be imported. Similarly, we can store name and revision of the module in our database and this will uniquely identify the module. For this, we need to add fields for module metadata in the yang-resource table. The fields would be moduleName and revision, where moduleName is the name of the module and revision is the revision of the module. This change will be going in the following file.
- cps-ri/src/main/java/org/onap/cps/spi/entities/YangResourceEntity.java
Code Block language java theme RDark title YangResourceEntity.java changes linenumbers true collapse true @NotNull @Column private String moduleName; @NotNull @Column private String revision;
Following on from this, we need to now update how we store name, revision, content in the yang-resource table.
...