-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling removing of existing quota in API #438
Comments
Hi @gcornacchia, |
Hi @gcornacchia, I have added some Junit test cases and existing code is working as expected. The only place I might see the issue is the source contains "applicationQuota": {
"restrictions": [
]
} and destination contains "applicationQuota": {
} it throws exception. Do you see anything different? Please review the code 730a52f and let me know if i miss anything? |
Hello about this problem in removing existing quotas on a specific API, we see Apim-cli is working. |
Fixed as part of 1.14.3 release |
APIM-CLI version
1.14.2
API-Management version
7.7.20211130
Bug description
After testing different scenarios in adding/removing quotas on APIs I've found a strange behavior that I describe below.
Steps to reproduce
STEP 1) Consider an API with already 2 application default quotas and 2 system quotas as in this config file
STEP 2) Remove one application default quota and one system quota
When importing this config file with quotaMode=replace the existing quotas on API Manager are correctly removed. OK
2023-09-05 15:23:24,258 [APIQuotaManager] INFO : Updating System default quota for API: PublicAPI_v1
2023-09-05 15:23:24,260 [APIQuotaManager] INFO : Removing existing Quotas for API: PublicAPI_v1 as quotaMode is set to replace.
2023-09-05 15:23:25,306 [APIQuotaManager] INFO : Updating Application default quota for API: PublicAPI_v1
2023-09-05 15:23:25,306 [APIQuotaManager] INFO : Removing existing Quotas for API: PublicAPI_v1 as quotaMode is set to replace.
STEP 3) I try to remove all quotas not serializing applicationQuota and systemQuota field in json but no differences are found
No changes detected between Import- and API-Manager-API
But...
STEP 4.1) I try to remove only the application quota
The application quota is correctly removed from API Manager but I don't understand the first two lines of log (as system quotas are untouched)
2023-09-05 15:30:16,648 [APIQuotaManager] INFO : Updating System default quota for API: PublicAPI_v1
2023-09-05 15:30:16,649 [APIQuotaManager] INFO : Removing existing Quotas for API: PublicAPI_v1 as quotaMode is set to replace.
2023-09-05 15:30:17,093 [APIQuotaManager] INFO : Updating Application default quota for API: PublicAPI_v1
2023-09-05 15:30:17,094 [APIQuotaManager] INFO : Removing existing Quotas for API: PublicAPI_v1 as quotaMode is set to replace.
BUT...
STEP 4.1) After step 3 if I try to remove only the system quota instead of application quota.
the system quota is not removed from API Manager
No changes detected between Import- and API-Manager-API
Maybe there's a need for uniformity in handling the semantics of null fields (not existent in JSON input file) or fields with empty values for "applicationQuota" and "systemQuota" fields.
"applicationQuota": {
restrictions: []
}
@rathnapandi what do you think?
Relevant log output
No response
The text was updated successfully, but these errors were encountered: