Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 17 Current »


CPS-1016 - Getting issue details... STATUS


Assumptions/Decisions


#

Issue

Notes/Jira

Decision

1There are 2 separate query objects defined in OpenAPI
Combine them into one 'Conditions' has the better structure but 'cmHandleQueryRestParameters' is a better  name
2Exact format of  'legacy' Conditions unclear and maybe not generic enoughStudy demo: https://wiki.onap.org/download/attachments/93000392/CPS644.mkv?version=1&modificationDate=1636566033000&api=v2
3Definition of 'Conditions' is not Generic enough

$ref: '#/components/schemas/ModuleNamesAsJsonArray

Should be something like '#/components/ConditionParametersNameValuePairs 


4Agree backward incompatibilityDiscuss with stakeholders


Implementation Proposal


Merge 2 'query' end points in one

#LayerProposed Changes
1REST Layer
  • openapi.yaml
    • change /v1/data/ch/searches to  /v1/ch/id-searches
  • ncmp.yaml
    • change queryCmHandles method to executeCmHandleIdSearch
    • Use the CmHandleQueryRestParameters schema to both of them
  • components.yaml
    • merge Conditions schema to CmHandleQueryRestParameters schema
    • delete Conditions schema
2Controller Layer
  • NetworkCmProxyController
    • Update controller methods to use the new schema
    • Both component method call separated service method
    • Rename queryCmHandles method to executeCmHandleIdSearch
3Service Layer
  • NetworkCmProxyDataService
    • Create new method for query cmHandles
    • Keep queryCmHandles method and rename it to queryCmHandleIds
    • Both method should be calling separate methods in CpsDataService
    • Validation logic should be moved to an separated method and call it from both method
  • 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 will always return complet DataNode object(s). No updates can be done
4Persistence 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

 {  "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

 {  "cmHandleQueryRestParameters": [
    {
      "name": "hasAllModules",
      "conditionParameters": [ {"moduleName": "module1"} ,{ "moduleName": "module2" } ]     
    }
  ]
}


Action 2: Support (public' Properties condition using the same format

 {  "cmHandleQueryRestParameters": [
    {
      "name": "hasAllProperties",
      "conditionParameters": [ {"Colour": "Green"} ,{ "Size": "Small" } ]
    }
  ]
}

Action 2:  Verify combinations of conditions are supported (AND is assumed)

 {  "cmHandleQueryRestParameters": [
    {
      "name": "hasAllProperties",
      "conditionParameters": [ {"Colour": "Green"} ,{ "Size": "Small" } ]
    },
    {
      "name": "hasAllModules",
      "conditionParameters": [ {"moduleName": "module1"} ,{ "moduleName": "module2" } }]     
    } 
  ]
}

Test

  • update existing tests to the new endpoint (groovy and CSIT)
  • create new tests for new filtering scenarios (combine the two existing filter) in CSIT tests


References



  • No labels