cyverse-de / terrain

DE's main API entry-point service
Other
4 stars 9 forks source link

CORE-1983: add support for multiyear subscriptions #278

Closed slr71 closed 9 months ago

slr71 commented 9 months ago

This change introduces a couple of new concepts: Subscription Periods, and consumable resource types.

A subscription period refers to the period of time during which the subscription is active. All of our subscriptions are active for one year by default, so a single subscription period is equivalent to one year. With this change, a user may purchase a subscription for multiple subscription periods. For example, if a user chooses to purchase a three year subscription, the user would be given access to the allocations associated with their subscription for three years.

A consumable resource type is a type of resource is not reclaimable. For example, CPU hours can't be reclaimed because once a unit of compute time has been used, it can never be used again. Conversely, storage space can be reclaimed because deleting a file makes the space used to store the file available to be used again. Whether a resource type can be consumed or not is important when creating a new multiyear subscription. In general, we will want to multiply the default allocation associated with a consumable resource, but not a non-consumable resource, by the number of subscription periods when we're computing the quotas for a multiyear subscription.

slr71 commented 9 months ago

Thanks for the review!