Versions Compared

Key

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

Jira
serverONAP Jira
columnIdsissuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId425b2b0a-557c-3c0c-b515-579789cceedb
keyCPS-644


Open Issues


IssueDecision
1Should the response be a string or describe using a schema?
2

What approach is best for getting the data from the DB?

  1. Have two methods that execute a native query
    1. get cm handles for the given module names and revisions 
    2. get cm handles for the given module name
  2. Have one method that combines the above queries into one
  3. Iterate over the list of modules and get the cm handle id for each.

I propose to use option 1 to improve performance and readability.

API details

DescriptionURIRequest BodyResponse Body
Get all cm handles that support  all modules in a given list of modules

POST {ncmpRoot}/ncmp/v1/ch/searches

 {
  "conditions": {
    "hasAllModules": [
      {
        "moduleName": "", (Mandatory)
        "revision": "" (Optional)
      }
    ]
  }
}

{
  "cmHandles": [
    {
      "cmHandleId": "cmhandle1"
    },

    {
      "cmHandleId": "

xxx

cmhandle2"
    }
  ]
}



Implementation details

  • The above API will be implemented in NCMP open API
    • moduleName is mandatory 
    • revision is optional
    • The request body will be described using the schema below

      Code Block
      languageyml
      Conditions:
      type: object
      properties:
        conditions:
          type: object
          properties:
            hasAllModules:
              type: array
              items:
                type: object
                properties:
                  moduleName:
                    type: string
      			  required: true
                  revision:
                    type: string
      
      


  • The response body will return the JSON example above as a string

  • Sample of native query
  • Code Blockmodule_Name revision SELECT an.id FROM yang_resource yr JOIN schema_set_yang_resources ssyr ON ssyr.yang_resource_id = yr.id JOIN schema_set ss ON ss.id = ssyr.schema_set_id JOIN anchor an ON an.schema_set_id = ss.id WHERE yr.module_Name IN ( '', '', '' ) AND yr.revision = ''