Versions Compared

Key

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

...

NCMP CMhandle registration endpoint receives multiple operations to create, update or delete cm-handles in a single request. As there are multiple operations, the endpoint response structure should be able to provide the status of all operations separately with consistent error-code to allow users to retrigger failed operations programmatically if possible.

Questions:


QuestionAgreed SolutionRemarks
1Are multiple operations for one cm-handle is considered invalid input?

2


Response Structure

HttpStatus

ScenarioStatus CodeResponseBody
All operations were successful204200Empty
All or few operations failed500With error details from each failed operation
Invalid Input400Error Details

Response Body

The response body should give enough information for each failed operation to retry them programmatically. For each failed operation we should send the below information 

NameDescriptionMandatory?
cmHandleidentifies the failed cm-handle
  •  Mandatory
errorCodeIdentify the error
  •  Mandatory
errorTextHuman-readable error text
  •  Mandatory
statusFailure/Success; To be discussed with the team
  •  Mandatory

The response body can be formed structured in three two ways

Group by operation type 

...

Code Block
titleResponse without grouping
linenumberstrue
collapsetrue
{
    "failedCreatedCmHandles": [ 
		{
 			"cmHandle": "cmHandle-1",
    		"error-code": "01",
			"error-text" : "cmhandle already exist"
		}
	],
	"failedUpdatedCmHandles": [ 
		{
 			"cmHandle": "cmHandle-2",
    		"error-code": "02" ,
			"error-text" : "cmhandle does not exist" 
		}
	],
 	"deletedCmHandles": [ 
		{
 			"cmHandle": "cmHandle-3",
    		"error-code": "02" ,
			"error-text" : "cmhandle does not exist"
		}
	]
}

Error handling

The error can be due to client input and they should try not to 

Input Issues

  1. Multiple operations for a single cm-handle
    1. If not allowed: Throw the error; it enables us to process them parallelly for better performance.
    2. If allowed: 
      1. Which operation type has higher precedence
        1. create → update → delete: 
        2. delete → create → update: It will help us to handle the case where the user wants to recreate the cmhandle
      2. Multiple In the same operation type
        1. create → Take the last one and show success or take the first one and let others fail.
        2. update → Process them sequentially because the update can be partial and order may matter here.
        3. delete → Process only once 
  2. Input is not in the correct expected format: For example, if the user has not defined the "cm-handle"Reject the request
Create CMHandles
  1. cm-handle already exist
  2. multiple create operations for one cm-handle
  3. unknown-error
Update CMHandles

...

  1. cm-handle does not exist: No error 
  2. unknown-error

Should we indicate  indicate if something can be fixed with retry?

...