Skip to content
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

Usage in the quota counts the inactive (archived) usages #52

Open
taojing2002 opened this issue Jul 9, 2020 · 1 comment
Open

Usage in the quota counts the inactive (archived) usages #52

taojing2002 opened this issue Jul 9, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@taojing2002
Copy link
Contributor

The curl command:

curl -k  -v  -H "Authorization: Bearer ${token}" "https://api.test.dataone.org:30443/bookkeeper/v1/quotas?subscriber=CN=opc,DC=dataone,DC=org&quotaType=portal"

It returns a quota with usage 2.0

{"quotas":[{"id":4,"object":"quota","quotaType":"portal","softLimit":5.0,"hardLimit":5.0,"usage":2.0,"unit":"portal","subscriptionId":1,"subject":"CN=opc,DC=dataone,DC=org"}]}

However, when I list the usages associated with subscriber. It got two usages. However, one is inactive and it should NOT be counted. So the quota should have one usage rather than two.

curl -k  -v  -H "Authorization: Bearer ${token}" "https://api.test.dataone.org:30443/bookkeeper/v1/usages?subscriber=CN=opc,DC=dataone,DC=org&quotaType=portal"

It return with two usages. But one is inactive:

{"usages":[{"id":60,"object":"usage","quotaId":4,"instanceId":"urn:uuidc11e3c52-dad2-4ddb-8aeb-099e1ffe6533","quantity":1.0,"status":"active","nodeId":"urn:node:METACAT_TEST"},
{"id":61,"object":"usage","quotaId":4,"instanceId":"urn:uuidd991d85a-99ca-46b3-8f04-c8c560083505","quantity":1.0,"status":"inactive","nodeId":"urn:node:METACAT_TEST"}]}
@taojing2002 taojing2002 added the bug Something isn't working label Jul 9, 2020
@csjx csjx self-assigned this Jul 9, 2020
csjx added a commit that referenced this issue Jul 19, 2020
If the usage status is “inactive”, don’t include it in the summation.

Refs #52
@csjx
Copy link
Member

csjx commented Jul 19, 2020

This is fixed, and will be tested before I close the ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants