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

Compare with Current View Page History

« Previous Version 5 Next »

CPS-896 - Getting issue details... STATUS

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
1


2


Response Structure

HttpStatus

ScenarioStatus CodeResponseBody
All operations were successful204Empty
All or few operations failed500With error details from each failed operation

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 in three ways

Group by operation type 

The interface is generic and if we need to send the status of all operations in the future it can be achieved without any breaking change.

Response Structure
{
    "createdCmHandles": [ 
		{
 			"cmHandle": "cmHandle-1",
    		"status": "FAILURE", // Extra field to indicate the status
    		"error-code": "01",
			"error-text" : "cmhandle already exist"
		}
	],
	"updatedCmHandles": [ 
		{
 			"cmHandle": "cmHandle-2",
    		"status": "FAILURE" ,
    		"error-code": "02" ,
			"error-text" : "cmhandle does not exist" 
		}
	],
 	"faileddeletedCmHandles": [ 
		{
 			"cmHandle": "cmHandle-3",
    		"status": "FAILURE" ,
    		"error-code": "02" ,
			"error-text" : "cmhandle does not exist"
		}
	]
}
Group by operation type but only for failed operations

This approach meets the current requirement and has a smaller payload size (no extra field for the status).

Response without grouping
{
    "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


Input Issues

  1. Multiple operations for a single cm-handle. 
  2. Input is not in the correct format: For example, if the user has not defined the "cm-handle"
Create CMHandles
  1. cm-handle already exist
  2. unknown-error
Update CMHandles
  1. cm-handle does not exist
  2. unknown-error
Remove CMHandles
  1. cm-handle does not exist: No error 
  2. unknown-error

Should we indicate  if something can be fixed with retry ?


CodeSloganApplicable to
CreateUpdateRemove
00unknown/otherYesYesYes
01cm-handle does not existNoYesNo*
02

cm-handle already exist

YesNoNo
03not allowed**?YesYes

Notes
* remove will ignore non-existing cm handles (not an error, assume already deleted)
** suggested future error (for illustration purposes)



  • No labels