This is an automated email from the ASF dual-hosted git repository.

DaanHoogland pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/main by this push:
     new 98ae513689d  validates the inputs for capacity bytes in update storage 
pool to be positive (#14219)
98ae513689d is described below

commit 98ae513689d25df8fc9fbc4182f90142378b59aa
Author: Sathvika <[email protected]>
AuthorDate: Tue Oct 20 19:14:52 2026 +0530

     validates the inputs for capacity bytes in update storage pool to be 
positive (#14219)
---
 .../api/command/admin/storage/CreateStoragePoolCmd.java      |  6 +++---
 .../api/command/admin/storage/UpdateStoragePoolCmd.java      | 12 ++++++------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git 
a/api/src/main/java/org/apache/cloudstack/api/command/admin/storage/CreateStoragePoolCmd.java
 
b/api/src/main/java/org/apache/cloudstack/api/command/admin/storage/CreateStoragePoolCmd.java
index 2aef856f58f..784b9e77bdb 100644
--- 
a/api/src/main/java/org/apache/cloudstack/api/command/admin/storage/CreateStoragePoolCmd.java
+++ 
b/api/src/main/java/org/apache/cloudstack/api/command/admin/storage/CreateStoragePoolCmd.java
@@ -19,8 +19,8 @@ package org.apache.cloudstack.api.command.admin.storage;
 import java.net.UnknownHostException;
 import java.util.Map;
 
-
 import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiArgValidator;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.ApiErrorCode;
 import org.apache.cloudstack.api.BaseCmd;
@@ -80,10 +80,10 @@ public class CreateStoragePoolCmd extends BaseCmd {
     @Parameter(name = ApiConstants.MANAGED, type = CommandType.BOOLEAN, 
required = false, description = "Whether the storage should be managed by 
CloudStack")
     private Boolean managed;
 
-    @Parameter(name = ApiConstants.CAPACITY_IOPS, type = CommandType.LONG, 
required = false, description = "IOPS CloudStack can provision from this 
storage pool")
+    @Parameter(name = ApiConstants.CAPACITY_IOPS, type = CommandType.LONG, 
required = false, description = "IOPS CloudStack can provision from this 
storage pool", validations = {ApiArgValidator.PositiveNumber})
     private Long capacityIops;
 
-    @Parameter(name = ApiConstants.CAPACITY_BYTES, type = CommandType.LONG, 
required = false, description = "Bytes CloudStack can provision from this 
storage pool")
+    @Parameter(name = ApiConstants.CAPACITY_BYTES, type = CommandType.LONG, 
required = false, description = "Bytes CloudStack can provision from this 
storage pool", validations = {ApiArgValidator.PositiveNumber})
     private Long capacityBytes;
 
     @Parameter(name = ApiConstants.HYPERVISOR,
diff --git 
a/api/src/main/java/org/apache/cloudstack/api/command/admin/storage/UpdateStoragePoolCmd.java
 
b/api/src/main/java/org/apache/cloudstack/api/command/admin/storage/UpdateStoragePoolCmd.java
index 4b0a6ba00b2..fa55b424eaf 100644
--- 
a/api/src/main/java/org/apache/cloudstack/api/command/admin/storage/UpdateStoragePoolCmd.java
+++ 
b/api/src/main/java/org/apache/cloudstack/api/command/admin/storage/UpdateStoragePoolCmd.java
@@ -19,20 +19,20 @@ package org.apache.cloudstack.api.command.admin.storage;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.cloudstack.api.ApiCommandResourceType;
-
 import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiArgValidator;
+import org.apache.cloudstack.api.ApiCommandResourceType;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.ApiErrorCode;
 import org.apache.cloudstack.api.BaseCmd;
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.response.StoragePoolResponse;
+import org.apache.commons.collections.MapUtils;
+import org.apache.commons.lang3.ObjectUtils;
 
 import com.cloud.storage.StoragePool;
 import com.cloud.user.Account;
-import org.apache.commons.collections.MapUtils;
-import org.apache.commons.lang3.ObjectUtils;
 
 @SuppressWarnings("rawtypes")
 @APICommand(name = "updateStoragePool", description = "Updates a storage 
pool.", responseObject = StoragePoolResponse.class, since = "3.0.0",
@@ -53,10 +53,10 @@ public class UpdateStoragePoolCmd extends BaseCmd {
     @Parameter(name = ApiConstants.TAGS, type = CommandType.LIST, 
collectionType = CommandType.STRING, description = "Comma-separated list of 
tags for the storage pool")
     private List<String> tags;
 
-    @Parameter(name = ApiConstants.CAPACITY_IOPS, type = CommandType.LONG, 
required = false, description = "IOPS CloudStack can provision from this 
storage pool")
+    @Parameter(name = ApiConstants.CAPACITY_IOPS, type = CommandType.LONG, 
required = false, description = "IOPS CloudStack can provision from this 
storage pool", validations={ApiArgValidator.PositiveNumber})
     private Long capacityIops;
 
-    @Parameter(name = ApiConstants.CAPACITY_BYTES, type = CommandType.LONG, 
required = false, description = "Bytes CloudStack can provision from this 
storage pool")
+    @Parameter(name = ApiConstants.CAPACITY_BYTES, type = CommandType.LONG, 
required = false, description = "Bytes CloudStack can provision from this 
storage pool",validations={ApiArgValidator.PositiveNumber})
     private Long capacityBytes;
 
     @Parameter(name = ApiConstants.ENABLED, type = CommandType.BOOLEAN, 
required = false, description = "False to disable the pool for allocation of 
new volumes, true to" +

Reply via email to