Table of Contents |
---|
Jira Legacy | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
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.
- If name is empty silently ignore, if value is empty (edge case test?)
- 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:
...
Table of Contents |
---|
Jira Legacy | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
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.
- If name is empty silently ignore, if value is empty (edge case test?)
- 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
...
Issue | Notes | Decision | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Does request body need to declare "publicCmHandleProperties"? | Do we need to explicitly declare "publicCmHandleProperties"? Will there be another possible variation to this in the future?
| Yes | ||||||||||
2 | Are public properties always stored (in postgress) in the format of "name" : x, "value": y? (does NOT affect implementation) | In the fragment table there are example that follow this format
| Yes. But all this is hidden when using CpsPath type query | ||||||||||
3 | Will there only ever be 1 kv pairs in public properties (in the DB)? | Yes, as each property is stored in a separate list-item Fragment But all this is hidden when using CpsPath type query | |||||||||||
4 | Does the order matter? | Does
==
| No But all this is hidden when using CpsPath type query | ||||||||||
5 | Should search be case sensitive? | depend on CPSPath functionality - may be case-sensitive https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html | Yes, that is the currently implement as such CpsPath type query. Given it is mostly machine-to-machine type queries this is good enough and performs better | ||||||||||
6 | What format should the response take? | We have two options currently:
2. Return CM Handle Objects
Contact Tony Finnerty & kieran mccarthy regarding this. | It has been decided to implement this using a list of cm handles | ||||||||||
7 | what if we have valid entries and one entry is empty? | We would return all cm handles and others that match would be included in this list anyway. → To avoid this should we first check the entries int map for empty entries as further processing is unnecessary in this case. | Discussed with Toine Siebelink and implementation changes are required for handling edges cases. we will handle empty and unknown properties separately. | ||||||||||
8 | Regarding empty/missing property in request e.g. { "publicCmHandleProperties": { | Do we want to throw an exception if there is an empty property? Do we silently ignore them and move on? should we send two lists back... one with matching cm handles and one with those that failed processing? | We will throw a DataValidationException if an entry contains an empty property |
...
# | URI | Design Notes | Comment(s) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | POST /ncmp/v1/data/ch/searches | Scenario : Request received to return all cm handles matching properties given Request Body
Response Body Example 1
|
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
executeSearchForMatchingPublicProperties: post: description: Execute search to get all cm handles for the given public properties tags: - network-cm-proxy summary: Execute cm handle search using operationId: executeSearchForMatchingPublicProperties requestBody: required: true content: application/json: schema: $ref: 'components.yaml#/components/schemas/PublicProperties' responses: 200: description: OK content: application/json: schema: type: array items: type: string 400: $ref: 'components.yaml#/components/responses/BadRequest' items401: type: string$ref: 'components.yaml#/components/responses/Unauthorized' 400403: $ref: 'components.yaml#/components/responses/BadRequestForbidden' 401404: $ref: 'components.yaml#/components/responses/UnauthorizedNotFound' 403500: $ref: 'components.yaml#/components/responses/Forbidden' 404: $ref: 'components.yaml#/components/responses/NotFound' 500: $ref: 'components.yaml#/components/responses/InternalServerError' |
Testing
Data Used for Testing
URL Used for all Requessts
http://localhost:8883/ncmp/v1/data/ch/searches
Results - Happy Path
...
.yaml#/components/responses/InternalServerError' |
Testing
...
Data Used for Testing
URL Used for all Requessts
http://localhost:8883/ncmp/v1/data/ch/searches
Results - Happy Path
# | Scenario | Request | Response | |
---|---|---|---|---|
1 | Both properties match (Return CM Handles that Match) | { | [ | |
2 | No properties given (Return CM Handles that Match which contain public properties) | { "publicCmHandleProperties": { | [ | |
3 | Multiple Entries - both properties match (Return CM Handles that Match) | { | [ | 2 |
Results - Edge Cases
# | Scenario | Request | Response | |||
---|---|---|---|---|---|---|
1 | Value doesn't match (Nothing Returned) | { | }[ | 3 | Multiple Entries - both properties match (Return CM Handles that Match) "Contact": "wont match" | [ ] |
2 | Unknown properties given (Return Empty Response) | { UnknwnProperty": " doesnt matter" } | [ "Bookstore1", "Bookstore3", "PNFDemo" ] |
Results - Edge Cases
# | Scenario | Request | Response | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
1 | ] | ||||||||||
3 | Empty property (invalid) (BAD_REQUEST) | { "publicCmHandleProperties": { ": " wont matchdoesnt matter " | [ ] | 2 | Unknown properties given (Return Empty Response) | { | |||||
4 | Empty value (valid) (Return CM Handles Returned that Match) | { "publicCmHandleProperties": { color": " doesnt matter" | [ | 3 | |||||||
5 | Multiple entries with one empty property (invalid) (BAD_REQUEST) | { "doesnt matter " } } Empty value (valid) (Return CM Handles Returned that Match){ | 4 | newemailforstore@bookstore.com" | { "color status": {"400 BAD_REQUEST", "details": "Missing property - please supply a valid property" | [ | |||||
5 | Multiple entries with one empty property (invalid) (BAD_REQUEST) | 6 | Apostrophe in cm handle (Exception) *** CPS can accept a cm handle with an apostrophe but fails to return when queried *** | { | , } | { | 400 BAD500 INTERNAL_SERVER_ | REQUESTERROR", | Invalid dataError while parsing cpsPath expression", | Missing property - please supply a valid propertyfailed to parse at line 1 due to extraneous input 't' expecting {']', 'and'}" |
Future Example (Out-of-scope)
...