winterhazel commented on code in PR #13288:
URL: https://github.com/apache/cloudstack/pull/13288#discussion_r3333980218


##########
api/src/main/java/com/cloud/configuration/Resource.java:
##########
@@ -30,6 +30,7 @@ enum ResourceType { // Primary and Secondary storage are 
allocated_storage and n
         project("project", 5),
         network("network", 6),
         vpc("vpc", 7),
+        vm_snapshot("vm_snapshot", 12),

Review Comment:
   I think it makes more sense instance_snapshot instead to match what is shown 
in the UI (this change implies adjusting other files as well. Also remembering 
that Instance Snapshots should be capitalized in messages and labels according 
to the conventions initiative in 
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Object+Naming+and+Title+Case+Convention)



##########
api/src/main/java/org/apache/cloudstack/api/response/AccountResponse.java:
##########
@@ -127,6 +127,18 @@ public class AccountResponse extends BaseResponse 
implements ResourceLimitAndCou
     @Param(description = "The total number of Snapshots available for this 
Account")
     private String snapshotAvailable;
 
+    @SerializedName(ApiConstants.VM_SNAPSHOT_LIMIT)
+    @Param(description = "the number of VM snapshots that can be stored by 
this account")
+    private String vmSnapshotLimit;
+
+    @SerializedName(ApiConstants.VM_SNAPSHOT_TOTAL)
+    @Param(description = "the number of VM snapshots stored by this account")
+    private Long vmSnapshotTotal;
+
+    @SerializedName(ApiConstants.VM_SNAPSHOT_AVAILABLE)
+    @Param(description = "the number of VM snapshots available for this 
account")

Review Comment:
   ```suggestion
       @Param(description = "the number of Instance Snapshots that can be 
stored by this Account")
       private String vmSnapshotLimit;
   
       @SerializedName(ApiConstants.VM_SNAPSHOT_TOTAL)
       @Param(description = "the number of Instance Snapshots stored by this 
Account")
       private Long vmSnapshotTotal;
   
       @SerializedName(ApiConstants.VM_SNAPSHOT_AVAILABLE)
       @Param(description = "the number of Instance Snapshots available for 
this Account")
   ```
   
   `Account` should be capitalized too according to the conventions



##########
api/src/main/java/org/apache/cloudstack/api/response/ProjectResponse.java:
##########
@@ -188,6 +188,19 @@ public class ProjectResponse extends BaseResponse 
implements ResourceLimitAndCou
     @Param(description = "The total number of Snapshots available for this 
project", since = "4.2.0")
     private String snapshotAvailable;
 
+    @SerializedName(ApiConstants.VM_SNAPSHOT_LIMIT)
+    @SerializedName(ApiConstants.VM_SNAPSHOT_LIMIT)

Review Comment:
   ```suggestion
       @SerializedName(ApiConstants.VM_SNAPSHOT_LIMIT)
   ```
   
   Duplicated line



##########
api/src/main/java/org/apache/cloudstack/api/response/ProjectResponse.java:
##########
@@ -188,6 +188,19 @@ public class ProjectResponse extends BaseResponse 
implements ResourceLimitAndCou
     @Param(description = "The total number of Snapshots available for this 
project", since = "4.2.0")
     private String snapshotAvailable;
 
+    @SerializedName(ApiConstants.VM_SNAPSHOT_LIMIT)
+    @SerializedName(ApiConstants.VM_SNAPSHOT_LIMIT)
+    @Param(description = "the number of VM snapshots that can be stored by 
this project")

Review Comment:
   ```suggestion
       @Param(description = "the number of Instance Snapshots that can be 
stored by this Project")
   ```
   
   `Project` should be capitalized according to the conventions too. Please 
also adjust the other cases in this file



##########
server/src/main/java/com/cloud/api/query/dao/DomainJoinDaoImpl.java:
##########
@@ -151,6 +151,14 @@ public void setResourceLimits(DomainJoinVO domain, boolean 
fullView, ResourceLim
         response.setSnapshotTotal(snapshotTotal);
         response.setSnapshotAvailable(snapshotAvail);
 
+        Long vmSnapshotLimit = 
ApiDBUtils.findCorrectResourceLimitForDomain(domain.getVmSnapshotLimit(), 
ResourceType.vm_snapshot, domain.getId());

Review Comment:
   Both methods seem to do the same thing. I don't think that this change is 
required



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to