-
Notifications
You must be signed in to change notification settings - Fork 0
CSTACKEX-299: validates the inputs for capacity bytes in update storage pool to be positive. #101
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,20 +19,20 @@ | |
| 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", | ||
|
|
@@ -56,7 +56,7 @@ public class UpdateStoragePoolCmd extends BaseCmd { | |
| @Parameter(name = ApiConstants.CAPACITY_IOPS, type = CommandType.LONG, required = false, description = "IOPS CloudStack can provision from this storage pool") | ||
| 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}) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lets validate the regression scope for this change since it is in common place
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. similar to the storage_pool capacity bytes, even volumes in DB have the size parameter as |
||
| 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" + | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why these imports are required for this validation?