CPS-644 - Getting issue details... STATUS


Open Issues


IssueDecision
1Should the response be a string or described using a schema?yes, we will describe the request and response using a schema
2

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

  1. Have two methods that execute a native query and determine intersection on ncmp side
    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.

We no longer need to make a decision on this as we do not need revision (see no.3)

3Is revision necessary for this use case?No, we agreed moduleName is only needed for now.

API details

DescriptionURISample Request BodySample Response Body
Get all cm handles that support  all modules in a given list of modules

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

 {
  "conditions": [
    {
      "name": "hasAllModules",
      "conditionParameters": [
        {
          "moduleName": "module1"

        },

        {
          "moduleName": "module2"

        }

      ]
    }
  ]
}

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

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

      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

  • No labels