You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "GutoVeronezi (via GitHub)" <gi...@apache.org> on 2023/01/31 02:17:58 UTC

[GitHub] [cloudstack] GutoVeronezi opened a new pull request, #7146: Adjusts in quota tariff APIs

GutoVeronezi opened a new pull request, #7146:
URL: https://github.com/apache/cloudstack/pull/7146

   ### Description
   
   PR #5909 was created during the release 4.17.0.0 and the parameter `since` in APIs was written as `4.17.0.0`; however, #5909 was really introduced only in 4.18.0.0.
   
   This PR intends to adjust the `since` in the introduced APIs and parameters and also:
   - improve the parameters documentation;
   - adjust parameters length, according to the field in the database;
   - rename parameter `UUID` of `quotaTariffDelete` to `ID`, to follow the pattern we use along other APIs;
   - cleanup some unused/unnecessary code in the Cmd classes;
   
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [X] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [X] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [X] Minor
   - [ ] Trivial
   
   ### How Has This Been Tested?
   
   I retested the whole tariff CRUD, as follows:
   <details><summary>Creating a tariff</summary>
   
     ```
     (lab)  > quota tariffcreate name='test-aadjusts' usagetype=12 value=0 description="a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose"
     {
       "quotatariff": {
         "currency": "$",
         "description": "a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose",
         "effectiveDate": "2023-01-31T01:50:38+0000",
         "name": "test-adjusts",
         "tariffValue": 0,
         "usageDiscriminator": "None",
         "usageName": "PORT_FORWARDING_RULE",
         "usageType": 12,
         "usageTypeDescription": "Port Forwarding Usage",
         "usageUnit": "Policy*Month",
         "uuid": "c30cacf7-a378-4e43-8ec0-6c5ad2d0d9e9"
       }
     }
     ```
   </details>
   
   
   
   <details><summary>Listing the tariffs after creating</summary>
   
     ```
     (lab)  > quota tarifflist name=test-adjusts listall=true
     {
       "count": 1,
       "quotatariff": [
         {
           "currency": "$",
           "description": "a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose",
           "effectiveDate": "2023-01-31T01:50:38+0000",
           "name": "test-adjusts",
           "tariffValue": 0,
           "usageDiscriminator": "None",
           "usageName": "PORT_FORWARDING_RULE",
           "usageType": 12,
           "usageTypeDescription": "Port Forwarding Usage",
           "usageUnit": "Policy*Month",
           "uuid": "c30cacf7-a378-4e43-8ec0-6c5ad2d0d9e9"
         }
       ]
     }
     ```
   </details>
   
   <details><summary>Updating the tariff</summary>
   
     ```
     (lab)  > quota tariffupdate name=test-adjusts activationrule="a rule" description="a simple description"
     {
       "quotatariff": {
         "activationRule": "a rule",
         "currency": "$",
         "description": "a simple description",
         "effectiveDate": "2023-01-31T01:50:38+0000",
         "name": "test-adjusts",
         "tariffValue": 0,
         "usageDiscriminator": "None",
         "usageName": "PORT_FORWARDING_RULE",
         "usageType": 12,
         "usageTypeDescription": "Port Forwarding Usage",
         "usageUnit": "Policy*Month",
         "uuid": "2d9afee9-960d-4b32-9a68-6a4939e59b6b"
       }
     }
     ``` 
   </details>
   
   
   <details><summary>Listing the tariffs after updating</summary>
   
     ```
     (lab)  > quota tarifflist name=test-adjusts listall=true
     {
       "count": 2,
       "quotatariff": [
         {
           "currency": "$",
           "description": "a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose",
           "effectiveDate": "2023-01-31T01:50:38+0000",
           "name": "test-adjusts",
           "removed": "2023-01-31T01:51:58+0000",
           "tariffValue": 0,
           "usageDiscriminator": "None",
           "usageName": "PORT_FORWARDING_RULE",
           "usageType": 12,
           "usageTypeDescription": "Port Forwarding Usage",
           "usageUnit": "Policy*Month",
           "uuid": "c30cacf7-a378-4e43-8ec0-6c5ad2d0d9e9"
         },
         {
           "activationRule": "a rule",
           "currency": "$",
           "description": "a simple description",
           "effectiveDate": "2023-01-31T01:50:38+0000",
           "name": "test-adjusts",
           "tariffValue": 0,
           "usageDiscriminator": "None",
           "usageName": "PORT_FORWARDING_RULE",
           "usageType": 12,
           "usageTypeDescription": "Port Forwarding Usage",
           "usageUnit": "Policy*Month",
           "uuid": "2d9afee9-960d-4b32-9a68-6a4939e59b6b"
         }
       ]
     }
     ```
   </details>
   
   
   <details><summary>Removing the tariff</summary>
   
     ```
     (lab)  > quota tariffdelete id=2d9afee9-960d-4b32-9a68-6a4939e59b6b
     {
       "success": true
     }
     ```
   </details>
   
   
   <details><summary>Listing the tariffs after removing</summary>
   
     ```
     (lab)  > quota tarifflist name=test-adjusts listall=true
     {
       "count": 2,
       "quotatariff": [
         {
           "currency": "$",
           "description": "a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose | a long description that will describe the tariff's purpose",
           "effectiveDate": "2023-01-31T01:50:38+0000",
           "name": "test-adjusts",
           "removed": "2023-01-31T01:51:58+0000",
           "tariffValue": 0,
           "usageDiscriminator": "None",
           "usageName": "PORT_FORWARDING_RULE",
           "usageType": 12,
           "usageTypeDescription": "Port Forwarding Usage",
           "usageUnit": "Policy*Month",
           "uuid": "c30cacf7-a378-4e43-8ec0-6c5ad2d0d9e9"
         },
         {
           "activationRule": "a rule",
           "currency": "$",
           "description": "a simple description",
           "effectiveDate": "2023-01-31T01:50:38+0000",
           "name": "test-adjusts",
           "removed": "2023-01-31T01:52:34+0000",
           "tariffValue": 0,
           "usageDiscriminator": "None",
           "usageName": "PORT_FORWARDING_RULE",
           "usageType": 12,
           "usageTypeDescription": "Port Forwarding Usage",
           "usageUnit": "Policy*Month",
           "uuid": "2d9afee9-960d-4b32-9a68-6a4939e59b6b"
         }
       ]
     }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7146: Adjusts/fixes in quota tariff APIs

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7146:
URL: https://github.com/apache/cloudstack/pull/7146#issuecomment-1411000219

   <b>Trillian test result (tid-6038)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 41626 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7146-t6038-kvm-centos7.zip
   Smoke tests completed. 107 look OK, 0 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] GutoVeronezi commented on pull request #7146: Adjusts/fixes in quota tariff APIs

Posted by "GutoVeronezi (via GitHub)" <gi...@apache.org>.
GutoVeronezi commented on PR #7146:
URL: https://github.com/apache/cloudstack/pull/7146#issuecomment-1409646774

   @DaanHoogland, can we add these adjusts/fixes to 4.18.0.0?
   
   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7146: Adjusts/fixes in quota tariff APIs

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7146:
URL: https://github.com/apache/cloudstack/pull/7146#issuecomment-1409683753

   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: el9 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 5448


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] sonarcloud[bot] commented on pull request #7146: Adjusts/fixes in quota tariff APIs

Posted by sonarcloud.
sonarcloud[bot] commented on PR #7146:
URL: https://github.com/apache/cloudstack/pull/7146#issuecomment-1409688454

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=7146)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7146&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7146&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7146&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7146&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7146&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7146&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=7146&resolved=false&types=SECURITY_HOTSPOT) [![E](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/E-16px.png 'E')](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=7146&resolved=false&types=SECURITY_HOTSPOT) [7 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=7146&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7146&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7146&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7146&resolved=false&types=CODE_SMELL)
   
   [![33.3%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '33.3%')](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7146&metric=new_coverage&view=list) [33.3% Coverage](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7146&metric=new_coverage&view=list)  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7146&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7146&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7146: Adjusts/fixes in quota tariff APIs

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7146:
URL: https://github.com/apache/cloudstack/pull/7146#issuecomment-1409647176

   @GutoVeronezi a Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland merged pull request #7146: Adjusts/fixes in quota tariff APIs

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland merged PR #7146:
URL: https://github.com/apache/cloudstack/pull/7146


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on a diff in pull request #7146: Adjusts/fixes in quota tariff APIs

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #7146:
URL: https://github.com/apache/cloudstack/pull/7146#discussion_r1091589057


##########
plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaTariffListCmd.java:
##########
@@ -43,22 +43,22 @@ public class QuotaTariffListCmd extends BaseListCmd {
     @Inject
     QuotaResponseBuilder _responseBuilder;
 
-    @Parameter(name = ApiConstants.USAGE_TYPE, type = CommandType.INTEGER, required = false, description = "Usage type of the resource")
+    @Parameter(name = ApiConstants.USAGE_TYPE, type = CommandType.INTEGER, description = "Usage type of the resource")

Review Comment:
   these have note become required, but the default is just removed !!?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] GutoVeronezi commented on pull request #7146: Adjusts/fixes in quota tariff APIs

Posted by "GutoVeronezi (via GitHub)" <gi...@apache.org>.
GutoVeronezi commented on PR #7146:
URL: https://github.com/apache/cloudstack/pull/7146#issuecomment-1410192301

   Thanks, @DaanHoogland 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7146: Adjusts/fixes in quota tariff APIs

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7146:
URL: https://github.com/apache/cloudstack/pull/7146#issuecomment-1409939968

   @DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on pull request #7146: Adjusts/fixes in quota tariff APIs

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #7146:
URL: https://github.com/apache/cloudstack/pull/7146#issuecomment-1409938783

   @blueorangutan test


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] GutoVeronezi commented on a diff in pull request #7146: Adjusts/fixes in quota tariff APIs

Posted by "GutoVeronezi (via GitHub)" <gi...@apache.org>.
GutoVeronezi commented on code in PR #7146:
URL: https://github.com/apache/cloudstack/pull/7146#discussion_r1091797468


##########
plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaTariffListCmd.java:
##########
@@ -43,22 +43,22 @@ public class QuotaTariffListCmd extends BaseListCmd {
     @Inject
     QuotaResponseBuilder _responseBuilder;
 
-    @Parameter(name = ApiConstants.USAGE_TYPE, type = CommandType.INTEGER, required = false, description = "Usage type of the resource")
+    @Parameter(name = ApiConstants.USAGE_TYPE, type = CommandType.INTEGER, description = "Usage type of the resource")

Review Comment:
   The default value of `required` is `false`; therefore, there is no need to inform it as `false`:
   
   https://github.com/apache/cloudstack/blob/d8c7e34b383d6e6ab4d00f3a07e3b2ab467eca36/api/src/main/java/org/apache/cloudstack/api/Parameter.java#L35



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org