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

Compare with Current View Page History

« Previous Version 10 Next »



CPS-731 - Getting 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:

  1. Demo - with "and" behavior
  2. CI Test - two attributes


Issues/Decisions



IssueNotesDecision
1Does 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.
2Do we need to consider if cm handle exists?

3



Analysis


High level steps:

  1. Update openapi specification for new endpoint
  2. Update Controller for new endpoint
  3. Add new SQL query to return data
    1. If no data found return all cm handles 
    2. else return data
  4. Implement 400 if request does not follow structure
  5. Create CSIT test with two attributes
  6. Demo functionality


Below is the implementation proposal for this story.

Interface Proposal

#URISQL QueryDesign NotesComment
1POST /ncmp/v1/data/ch/searches

Scenario :  Request received to return all cm handles matching properties given
Method   : POST
URI          : {ncmpRoot}/ncmp/v1/data/ch/searches 
Header    : Content-Type: application/json

Request Body

{
  "publicCmHandleProperties" : {           
        "module1": "revision1",
		"module2": "revision2"    }
}


Response Body

[
	"cmHandle1",
	"cmHandle2",
	...,
	"cmHandleN"
]

Below is a sample yaml for OpenAPI.

Sample OpenAPI yAML
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'

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.

References



  • No labels