...
After determining whether an anchor name or JSON payload is provided in the request the respective underlying controller will be called. So only the endpoints will be merged to a singular endpoint, and the underlying logic will remain same.
...
Alternative one: Single Endpoint
# | Sub interface | Method | Scenario | HTTP response code | Notes |
---|---|---|---|---|---|
1 | Data |
| Generate a delta report between a source anchor and target anchor or JSON payload |
|
...
Type | Format | Description |
---|---|---|
File | Yang file/Zip file | file containing the schema details. |
Text/String | Target anchor name or JSON payload as plain text |
|
Alternative
...
2: One Endpoint with Two Operations
In RESTful interface we can have same endpoint for multiple APIs, given they are performing different operations, for example POST and GET.
...
Sample endpoints after change
After the update only the names of the endpoint will be updated, the path and query parameters will remain as it is. So, the updated APIs would be as follows:
# |
---|
Existing Endpoint | Updated Endpoint | Path/Query Parameters | Response Codes |
---|---|---|---|
1 |
GET-/v2/dataspaces/{dataspace-name}/anchors/{anchor-name}/deltaAnchors | GET-/v2/dataspaces/{dataspace-name}/anchors/{source-anchor-name}/delta/{target-anchor-name} |
|
|
| ||||
2 |
POST- /v2/dataspaces/{dataspace-name}/anchors/{anchor-name}/deltaPayload | POST- /v2/dataspaces/{dataspace-name}/anchors/{source-anchor-name}/delta |
|
|
|