Pay-per-Use licensing model limits the quantity of the license uses, in addition to the license validity. User buys one or more licenses for a certain total quantity, which is written off according to the reported usage. At any time user can extend available quantity by buying additional licenses.
The usage may be defined by various metrics such as CPU load, network bandwidth utilization, or something related to the nature of your application.
The billing is tied to the usage model, which can be:
- Time based: billing on the duration of use
- Count based: billing on the number of uses
- Volume based: billing on the amount of resource use
In either case, NetLicensing keeps track of the used quantity by a simple unitless integer counter, you decide what unit to associate with this counter.
To use this licensing model you must define one or more license templates of type QUANTITY, each specifying the quantity and a purchase price. Multiple license templates allow to configure discounts, e.g.:
- 10 units for 5 EUR
- 100 units for 45 EUR
- 1000 units for 400 EUR
Additional properties specific to the QUANTITY license templates:
- Integer quantity (required) - specifies default quantity (unitless), which is assigned to the licenses created off this template.
Additional properties specific to the QUANTITY licenses:
- Integer quantity (required) - specifies the quantity (unitless), that will be written off on validate calls with usedQuantity parameter. Normally it is copied from the corresponding license template, but can be changed later for each license individually. When multiple QUANTITY licenses purchased, the total quantity is the sum of quantity of all active licenses.
- Integer usedQuantity (optional) - specifies the amount of written off quantity. When not present, it is equivalent to usedQuantity=0. This property is updated automatically according to the usedQuantity parameter passed on validate. usedQuantity equal to quantity means entire quantity of this license is used up.
On validation, this licensing model uses the following validate parameters:
- productModuleNumber=<productModuleNumber> - specifies the product module, that uses Pay-per-Use licensing model
- usedQuantity=<non-negative integer> - specifies quantity used by the application since previous validate call. The application should take care that the remaining quantity returned by the previous validate call is not exceeded. Once all remaining quantity is used up, the application would direct the user to the appropriate renewal / extension step, or cease operating, depending to the chosen licensing scheme. If this parameter is omitted, it is equivalent to usedQuantity=0. If you need to call validate to only read-out the remaining quantity, it is suggested to pass usedQuantity=0 explicitly.
Validation returns values:
- Boolean valid - true if total quantity of all active licenses is bigger than the total usedQuantity of these licenses.
- Integer remainingQuantity - the difference between the total quantity and total usedQuantity of all active licenses.
Validation response examples: