DataONEorg / bookkeeper

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

Change param 'subscribers' to 'subscriber' #46

Closed gothub closed 4 years ago

gothub commented 4 years ago

As suggested by @taojing2002, the URL parameter name 'subscribers' will be changed to 'subscriber'. The argument for this parameter will be a single subscriber subject. This parameter is available list either quotas or usages. If it is desired to retrieve usages or quotas for multiple subscribers in a single call, the parameter can be repeated, for example (on my local test server):

locahost:8080/bookkeeper/v1/usages?quotaType=portal&subscriber=http://orcid.org/0000-0002-2192-403X&subscriber=CN=SASAP,DC=dataone,DC=org&subscriber=http://orcid.org/0000-0003-1501-0861"

which will return portal usages associated with the three subscribers specified. Here is the result:

{
    "usages": [
        {
            "id": 1,
            "instanceId": "urn:urn:0001-0001",
            "nodeId": "urn:node:mnOPC",
            "object": "usage",
            "quantity": 1.0,
            "quotaId": 4,
            "status": "active"
        },
        {
            "id": 2,
            "instanceId": "urn:urn:0002-0001",
            "nodeId": "urn:node:mnSASAP",
            "object": "usage",
            "quantity": 1.0,
            "quotaId": 6,
            "status": "active"
        },
        {
            "id": 3,
            "instanceId": "urn:urn:0003-0001",
            "nodeId": "urn:node:mnPCS",
            "object": "usage",
            "quantity": 1.0,
            "quotaId": 8,
            "status": "active"
        }
    ]
}
gothub commented 4 years ago

This change was made in commit 66e82a22695bb5a8ee07be8999d57375a6b748a4