-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coar Notify Integration - Administer/Log #251
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
69eb504
added a new contract for ldnmessages endpoints
e77e18b
refactoring
1de439c
Merged in coar-notify-7-part-two_CST-13103 (pull request #53)
eskander17 f3568d2
Merged coar-notify-7-part-two into coar-notify-7-part-two_CST-12401
steph-ieffam 41d93af
Merged in coar-notify-7-part-two_CST-12401 (pull request #54)
eskander17 7bbb79a
Merge remote-tracking branch 'origin/coar-notify-7' into coar-notify-…
steph-ieffam 0ee49c6
Merge remote-tracking branch 'dspacegithub/main' into coar-notify-7-p…
frabacche 0f9e43d
move to POST /api/ldn/ldnmessages/<id>/enqueueretry
frabacche File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
# LDN Messages Endpoints | ||
[Back to the list of all defined endpoints](endpoints.md) | ||
|
||
## Main Endpoint | ||
**/api/ldn/ldnmessages** | ||
|
||
Provide access to the ldn messages. List all the LDN messages | ||
|
||
A sample can be found at https://api7.dspace.org/server/#/server/api/ldn/ldnmessages | ||
|
||
Return codes: | ||
* 200 OK - if the operation succeed | ||
* 401 Unauthorized - if you are not authenticated | ||
* 403 Forbidden - if you are not logged in with sufficient permissions. Only system administrators can access | ||
|
||
## Single LDN Message | ||
**/api/ldn/ldnmessages/<:id>** | ||
|
||
```json | ||
{ | ||
"id" : "urn:uuid:94ecae35-dcfd-4182-8550-22c7164fe23f", | ||
"notificationId" : "urn:uuid:94ecae35-dcfd-4182-8550-22c7164fe23f", | ||
"queueStatus" : 1, | ||
"queueStatusLabel" : "QUEUE_STATUS_QUEUED", | ||
"context" : "7d95587b-8e26-4302-9911-3e0f40fc6e4b", | ||
"object" : "7d95587b-8e26-4302-9911-3e0f40fc6e4b", | ||
"target" : null, | ||
"origin" : 1, | ||
"inReplyTo" : null, | ||
"activityStreamType" : "Announce", | ||
"coarNotifyType" : "coar-notify:EndorsementAction", | ||
"queueAttempts" : 0, | ||
"queueLastStartTime" : null, | ||
"queueTimeout" : "2024-01-03T10:56:41.737+00:00", | ||
"notificationType" : "Incoming", | ||
"type" : "message", | ||
"_links" : { | ||
"self" : { | ||
"href" : "http://localhost/api/ldn/messages/urn:uuid:94ecae35-dcfd-4182-8550-22c7164fe23f" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
Status codes: | ||
* 200 OK - if the operation succeed | ||
* 401 Unauthorized - if you are not authenticated | ||
* 403 Forbidden - if you are not logged in with sufficient permissions. Only system administrators can access | ||
* 404 Not found - if no LDN Message exists with such id | ||
|
||
## Creating a new LDN Message | ||
**POST /api/ldn/ldnmessages** | ||
|
||
Creation of LDN Message is not supported via Endpoint | ||
|
||
Status codes: | ||
* 405 Method Not Allowed | ||
|
||
## PATCH | ||
|
||
Patch of LDN Message is not supported via Endpoint | ||
|
||
Status codes: | ||
* 405 Method Not Allowed | ||
|
||
## DELETE | ||
|
||
Deletion of LDN Message is not supported via Endpoint | ||
|
||
Status codes: | ||
* 405 Method Not Allowed | ||
|
||
## enqueueRetry | ||
**/api/ldn/ldnmessages/enqueueretry/<:id>** | ||
|
||
this endpoint is responsible for requesting a reprocessing of LDN Message | ||
by changing `queueStatusLabel` to be "QUEUE_STATUS_QUEUED_FOR_RETRY" | ||
```json | ||
{ | ||
"id" : "urn:uuid:94ecae35-dcfd-4182-8550-22c7164fe23f", | ||
"notificationId" : "urn:uuid:94ecae35-dcfd-4182-8550-22c7164fe23f", | ||
"queueStatus" : 7, | ||
"queueStatusLabel" : "QUEUE_STATUS_QUEUED_FOR_RETRY", | ||
"context" : "c433ac1a-949a-4435-bf3d-181dcaac1c56", | ||
"object" : "c433ac1a-949a-4435-bf3d-181dcaac1c56", | ||
"target" : null, | ||
"origin" : 1, | ||
"inReplyTo" : null, | ||
"activityStreamType" : "Announce", | ||
"coarNotifyType" : "coar-notify:EndorsementAction", | ||
"queueAttempts" : 0, | ||
"queueLastStartTime" : null, | ||
"queueTimeout" : 1704281265044, | ||
"notificationType" : "Incoming", | ||
"type" : "message" | ||
} | ||
``` | ||
|
||
Status codes: | ||
* 200 OK - if the operation succeed | ||
* 401 Unauthorized - if you are not authenticated | ||
* 403 Forbidden - if you are not logged in with sufficient permissions. Only system administrators can access | ||
* 404 Not found - if no LDN Message exists with such id |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abollin & @steph-ieffam i : Please correct me if I'm wrong, but this doesn't seem to align with our REST Contract? https://github.com/DSpace/RestContract/blob/main/README.md#on-sub-path-of-a-single-resource-endpoint-associations
This looks like it should be an "association" style endpoint, but it's not structured as such. I don't recall any other endpoints that have a structure of
/api/[category]/[endpoint-name]/[subpath]/[uuid]
. Am I misunderstanding this endpoint?I also find this design odd that you have to send a
GET
request to perform an "action" (trying to add back into the queue). In other endpoints, this seems to be a POST or PUT style endpoint.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should the path be
**/api/ldn/ldnmessages/<:id>/enqueueretry**
instead of**/api/ldn/ldnmessages/enqueueretry/<:id>**
as it currently is?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@frabacche : I'd recommending asking that question to @abollini . I'm not sure I understand this endpoint completely yet. But, it seems incorrectly designed to me. I think making it
/api/ldn/ldnmessages/<:id>/enqueueretry
seems more correct... but I still don't know that it should be aGET
request either. It's very odd looking to me and I'm not sure I have a recommendation yet.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tdonohue the GET is an awful typo, sorry for that it should be POST actually and also the URL should be changed as noted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@steph-ieffam : The current implementation in
LDNMessageRestController
is usingGET
. You can see that in the LDNMessageRestControllerIT in DSpace/DSpace#9268 So, the implementation would also require an update as it appears to be using GET as far as I can tell.