-
Notifications
You must be signed in to change notification settings - Fork 1
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
Create GET "/api/ca_dashboard/stats"
endpoint
#852
Conversation
a72c9dc
to
636db77
Compare
GET "/api/dmp_assistant/stats"
endpointGET "/api/ca_dashboard/stats"
endpoint
636db77
to
1ace30b
Compare
|
||
json.partial! 'api/v1/standard_response' | ||
json.stats do | ||
json.totals @totals |
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.
Just a quick question @aaronskiba , why do we have the value "total_items": 0,
in the resulting json output?
Is that something we need ?
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.
Good question; I guess that's just being inherited from api/v1/standard_response
. I think it corresponds to the number of plans returned, which would always be zero for this new API endpoint:
I guess it does a similar thing when I check api/v1/heartbeat
:
{
"application": "DMP Assistant",
"source": "GET /api/v1/heartbeat",
"time": "2024-08-29T18:21:17+00:00",
"caller": "142.244.108.150",
"code": 200,
"message": "OK",
"total_items": 0,
"items": [
]
}
Here's an API request for a specific plan:
{
"application": "DMP Assistant",
"source": "GET /api/v1/plans/id_redacted",
"time": "2024-08-29T18:18:34+00:00",
"caller": "DMP Administrator",
"code": 200,
"message": "OK",
"page": 1,
"per_page": 100,
"total_items": 1,
"items": [
{
"dmp": {
"schema": "https://github.com/RDA-DMP-Common/RDA-DMP-Common-Standard/tree/master/examples/JSON/JSON-schema/1.0",
"title": "v4.1.3 Test"
...
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.
Changes proposed in this PR:
GET "/api/ca_dashboard/stats"
endpoint to fetch "stats"GET "/api/ca_dashboard/stats"
:"custom_range": { "plans": 2429, "orgs": 27, "users": 1848 }
part of the above JSON structure is only returned when the user specifies a validstart
and/orend
parameter when making the API request. Otherwise, the following JSON structure is returned: