- CPS-731Getting issue details... STATUS
Scope
It should be able to query all cm handles with a given set of public cm handle properties.
Requirements
- We want all cm-Handles where both things are true.
- Those properties also need to exist.
- If query body does not follow supported structure return 400.
- Empty query will return all cm-Handles.
A/C:
- Demo - with "and" behavior
- CI Test - two attributes
Issues/Decisions
Issue | Notes | Decision | |
---|---|---|---|
1 | Does request body need to declare "publicCmHandleProperties"? | Do we need to explcitly declare "publicCmHandleProperties"? Will there be another possible variation to this in the future? { "publicCmHandleProperties" : { "module1": "revision1", "module2": "revision2" } } | Not another variation but there will be "modules" included in future implementations. |
2 |
Analysis
High level steps:
- Update openapi specification for new endpoint
- Update Controller for new endpoint
- Add new SQL query to return data
- If no data found return all cm handles
- else return data
- Implement 400 if request does not follow structure
- Create CSIT test with two attributes
- Demo functionality
Below is the implementation proposal for this story.
Interface Proposal
# | URI | SQL Query | Design Notes | Comment |
---|---|---|---|---|
1 | POST /ncmp/v1/data/ch/searches | Scenario : Request received to return all cm handles matching properties given Request Body { "publicCmHandleProperties" : { "module1": "revision1", "module2": "revision2" } } Response Body [ "cmHandle1", "cmHandle2", ..., "cmHandleN" ] |
Below is a sample yaml for OpenAPI.
Note: Will update to take in custom type and not ModuleReference.
Future Example (Out-of-scope)
POST /ncmp/v1/data/ch/searches
{ "publicCmHandleProperties" : { "publicPropertyName-1" : "publicPropertyValue-1", "publicPropertyName-2" : "publicPropertyValue-2" }, "modules": [ { "moduleName": "", (Mandatory) "revision": "" (Optional) } ] }
Modules here is to demonstrate future intentions of endpoint but is out of scope for this user story.