DataONEorg / bookkeeper

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

Add UsagesResource class #6

Closed gothub closed 4 years ago

gothub commented 4 years ago

During multiple developer meetings, it was determined that the quotas and usages REST endpoints should be updated to conform to this list:

QuotaList = listQuotas():   GET     /quotas?\
                                            subscriber=:subscriber&\
                                            quotaType=:quotaType&\
                                            requestor=:requestor
Quota     = createQuota():  POST    /quotas
Quota     = getQuota():     GET     /quotas/:id
Quota     = updateQuota():  PUT     /quotas/:id
boolean   = deleteQuota():  DELETE  /quotas/:id
Usage     = getUsage():     GET     /usage/:id
UsageList = listUsage():    GET     /usage?quotaType=:quotaType\
                                            &instanceId=:instanceId&\
                                            subscriber=:subscriber
Usage     = createUsage():  POST    /usage
Usage     = updateUsage():  PUT     /usage/:id
boolean   = deleteUsage():  DELETE  /usage/:id

This will require a new UsagesResource class that will handle the /usage endpoints. The usage methods will be removed from QuotasResource. The new class/method configuration will be:

gothub commented 4 years ago

@csjx If the method naming convention follows the other resource classes (including QuotasResource), the names for the new UsagesResource would be:

gothub commented 4 years ago

The UsagesResource class was created, and the associated usage functions removed from QuotasResource in commit 03bc8eaa194b1796f969e3097efd4450b9e5a9b8