Versions Compared

Key

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

...


IssueNotesDecision
1Does request body need to declare "publicCmHandleProperties"?

Do we need to explicitly declare "publicCmHandleProperties"? 

Will there be another possible variation to this in the future?

Code Block
languageyml
{
  "publicCmHandleProperties" : {
          "Colour": "red",
          "Size": "large"
   }
}


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 

Code Block
languageyml
{
	"name": "Colour",
	"value": "red"
},
{
	"name": "Size",
	"value": "large"
}


Yes. But all this is hidden when using CpsPath type query

3Will 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
4Does the order matter?

Does

Code Block
languageyml
{
  "publicCmHandleProperties" : {
          "Colour" : "green",
          "Size" : "small"
   }
}

==

Code Block
languageyml
{
  "publicCmHandleProperties" : {
          "Size" : "small"
          "Colour" : "green",
     }
}


No
But all this is hidden when using CpsPath type query
5Should 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
6What format should the response take?

We have two options currently:


  1. Return List<String>
Code Block
languageyml
[
    "cmHandle1",
    "cmHandle2",
    ...,
    "cmHandleN"
]


2. Return CM Handle Objects

    1. Already defined in CPS
    2. <Example Pending>

Contact Tony Finnerty & kieran mccarthy regarding this.
Tony Finnerty Has no opinion on this matter


7what 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.



Analysis/Implementation Proposal

...

Code Block
languageyml
titleSample OpenAPI yAML
collapsetrue
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'
      401:
        $ref: 'components.yaml#/components/responses/Unauthorized'
      403:
        $ref: 'components.yaml#/components/responses/Forbidden'
      404:
        $ref: 'components.yaml#/components/responses/NotFound'
      500:
        $ref: 'components.yaml#/components/responses/InternalServerError'

Public Properties are stored in the fragment table in CPS as seen below:

Image Removed

PoC Gerrit Review

A PoC has been coded and can be found here: https://gerrit.onap.org/r/c/cps/+/127541

...


Testing

...


Edge Cases

  • Null name, Value
  • Empty name, Value
  • no key value pairs at all 


Manual Testing


Image Added



#ScenarioScreenshot
1

Both properties match

(CM Handles Returned that Match)

Image Removed


2

One property doesn't match 

(Nothing Returned)

Image Removed


3

No properties given - all cm handles returned

(that contain public properties)

Image Removed


4

Return 400

(BAD_REQUEST)

Image Removed

Testing

Edge Cases

...





Future Example (Out-of-scope)

...