DataONEorg / bookkeeper

Bookkeeper keeps track of DataONE product subscriptions and quotas for researchers using the extended services.
Other
1 stars 2 forks source link

List usages rest command return a list of usages rather than an UsageList object #44

Closed taojing2002 closed 4 years ago

taojing2002 commented 4 years ago

In our design document, the rest call looks like:

UsageList = listUsage():    GET     /usage?quotaType=:quotaType&instanceId=:instanceId&subscriber=:subscriber

So the Jason String should be a UsageList object which contains a list of usage. However, it directly returns a list of usages.

curl -k   -H "Authorization: Bearer ${token}" "https://docker-dev-ucsb-1.test.dataone.org:30443/bookkeeper/v1/usages/?quotaId=4&instanceId=urn%3Auuidfa4df84d-31c0-430c-bb2d-506662cec307"
[{"id":4,"object":"usage","quotaId":4,"instanceId":"urn:uuidfa4df84d-31c0-430c-bb2d-506662cec307","quantity":1.0,"status":"active","nodeId":"urn:node:METACAT_TEST"}]
taojing2002 commented 4 years ago

The current returned result is not a list of usage objects, but pairs of name/value.

gothub commented 4 years ago

UsagesResource.listUsages() now returns a UsageList object. Fixed in commit 2b7a33f501589b56153e1346d806e1cfbb7b75f6