...
Jira |
---|
server | ONAP Jira |
---|
columnIds | issuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution |
---|
columns | key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution |
---|
serverId | 425b2b0a-557c-3c0c-b515-579789cceedb |
---|
key | CPS-1016 |
---|
|
Assumptions/Decisions
...
DecsionDecision |
---|
1 | There are 2 separate query objects defined in OpenAPI |
| Combine them into one 'Conditions' has the better structure but 'cmHandleQueryRestParameters' is a better name |
2 | Exact format of 'legacy' Conditions unclear and maybe not generic enough | Study demo: https://wiki.onap.org/download/attachments/93000392/CPS644.mkv?version=1&modificationDate=1636566033000&api=v2 |
|
3 | Definition of 'Conditions' is not Generic enough | $ref: '#/components/schemas/ModuleNamesAsJsonArray Should be something like '#/components/ConditionParametersNameValuePairs |
|
4 | Agree backward incompatibility | Discuss with stakeholders |
|
Implementation Proposal
...
Merge 2 'query' end points in one
# | Layer | Proposed Changes |
---|
1 | REST Layer | - openapi.yaml
- change /v1/data/ch/searches to /v1/ch/
|
idSearches- id-searches
- ncmp.yaml
- change
|
executeCmHandleSearch method to queryCmHandleschange queryCmHandleIds- executeCmHandleIdSearch
- Use the CmHandleQueryRestParameters schema to both of them
- components.yaml
- merge Conditions schema to CmHandleQueryRestParameters schema
- delete Conditions schema
|
2 | Controller Layer | - NetworkCmProxyController
- Update controller methods to use the new schema
- Both component method call separated service method
- Rename
|
methods to executeCmHandleSearch and executeCmHandle- queryCmHandles method to executeCmHandleIdSearch
|
3 | Service Layer | - NetworkCmProxyDataService
- Create new method for query cmHandles
- Keep queryCmHandles method and rename it to queryCmHandleIds
- Both method should be
|
called a same method in CpsAdminService- calling separate methods in CpsDataService
- Validation logic should be moved to an separated method and call it from both method
|
CpsAdminService- CpsDataService
- Update queryCmHandles method return type to Set<CmHandles>
- Use separate methods to CmHandlesId search to just return a collection of CmHandleIds (extract from DataNode Objects)
- CpsAdminPersistenceService
- Update queryCmHandles
|
method return type to Set<CmHandles>- will always return complet DataNode object(s). No updates can be done
|
4 | Persistence Layer | - ModuleReferenceQuery
- Update queryCmHandles method return type to Set<CmHandles>
- Update queryCmHandles method to handle both filtering parameters
- Create to separete method for CmHandlesId searches with new filtering parameters (use the original queryCmHandles method code)
|
New Rest Request Input Format
Assumed Current Request Format:
See Issue #3, it need to be confirmed
Code Block |
---|
{ "conditions": [
{
"name": "hasAllModules",
"conditionParameters": [ {"moduleName": "module1"} ,{ "moduleName": "module2" } }
}
]
} |
Action 1: Rename query new top element name
After 'Merge' it should also support (public Properties conditions like so
Code Block |
---|
{ "cmHandleQueryRestParameters": [
{
"name": "hasAllModules",
"conditionParameters": [ {"moduleName": "module1"} ,{ "moduleName": "module2" } ]
}
]
} |
Action 2: Support (public' Properties condition using the same format
Code Block |
---|
{ "cmHandleQueryRestParameters": [
{
"name": "hasAllProperties",
"conditionParameters": [ {"Colour": "Green"} ,{ "Size": "Small" } ]
}
]
} |
Action 2: Verify combinations of conditions are supported (AND is assumed)
Code Block |
---|
{ "cmHandleQueryRestParameters": [
{
"name": "hasAllProperties",
"conditionParameters": [ {"Colour": "Green"} ,{ "Size": "Small" } ]
},
{
"name": "hasAllModules",
"conditionParameters": [ {"moduleName": "module1"} ,{ "moduleName": "module2" } }]
}
]
} |
Test
- update existing test tests to the new endpoint (groovy and CSIT)
- create new tests for new filtering scenarios (combine the two existing filter) in CSIT tests
References
...