Quota tariff order#8347
Merged
DaanHoogland merged 19 commits intoapache:mainfrom Jul 14, 2024
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Quota tariffs have been extended to make it possible to define the order of their execution. To achieve this, the
positionparameter was added to thequotaTariffCreateandquotaTariffUpdateAPIs. This parameter is used to define the tariff execution sequence of tariffs with the same usage type. This order is ascending, that is, a tariff withpositionequal to 1 will be executed before a tariff withpositionequal to 2. If two tariffs of the same usage type have equal positions, the most recent one will be executed first.During the processing of Quota tariffs, ACS will execute them in the defined order and inject the values into subsequent rates. To enable tariff injection, the preset variable
lastTariffswas created. It will have a list of objects containing theidandvalueattributes of the tariffs executed before it. Below is an example of the variable value when executing 3 tariffs (A,BandC) of the same usage type:A, the value oflastTariffswill be:B,lastTariffswill have the value:C,lastTariffswill have the values:Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
How Has This Been Tested?
About the
quotaTariffCreateandquotaTariffUpdateAPIsAbout the
lastTariffspreset variable:I created three tariffs with activation rules:
lastTariffs[0].value + 7lastTariffs[0].value + lastTariffs[1].value.When running
quotaUpdate, I looked in the logs for which values were calculated according to the tariffs, the first returned 10, the second 17 and the third 27.