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

Compare with Current View Page History

« Previous Version 2 Next »

CPS-644 - Getting issue details... STATUS

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": "xxx"
    }
  ]
}

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
  • Implement SQL queries to get the cm handle in the anchor repository
    • getCmHandleForModuleNameAndRevision
    • getCmHandleForModuleName

      module_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 = ''
      AND yr.revision = ''
  • No labels