Skip to content

Commit 333a395

Browse files
Added capacitybytes parameter to the storage pool response in sync with the capacityiops response parameter and createStoragePool cmd request parameter (existing disksizetotal parameter in the storage pool response can be deprecated)
1 parent 6adf4d3 commit 333a395

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

api/src/main/java/org/apache/cloudstack/api/response/StoragePoolResponse.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,24 @@ public class StoragePoolResponse extends BaseResponseWithAnnotations {
7777
@Param(description = "the name of the cluster for the storage pool")
7878
private String clusterName;
7979

80+
@SerializedName(ApiConstants.CAPACITY_BYTES)
81+
@Param(description = "bytes CloudStack can provision from this storage pool", since = "4.19.3")
82+
private Long capacityBytes;
83+
84+
@Deprecated(since = "4.19.3")
8085
@SerializedName("disksizetotal")
8186
@Param(description = "the total disk size of the storage pool")
8287
private Long diskSizeTotal;
8388

8489
@SerializedName("disksizeallocated")
85-
@Param(description = "the host's currently allocated disk size")
90+
@Param(description = "the pool's currently allocated disk size")
8691
private Long diskSizeAllocated;
8792

8893
@SerializedName("disksizeused")
89-
@Param(description = "the host's currently used disk size")
94+
@Param(description = "the pool's currently used disk size")
9095
private Long diskSizeUsed;
9196

92-
@SerializedName("capacityiops")
97+
@SerializedName(ApiConstants.CAPACITY_IOPS)
9398
@Param(description = "IOPS CloudStack can provision from this storage pool")
9499
private Long capacityIops;
95100

@@ -280,6 +285,14 @@ public void setClusterName(String clusterName) {
280285
this.clusterName = clusterName;
281286
}
282287

288+
public Long getCapacityBytes() {
289+
return capacityBytes;
290+
}
291+
292+
public void setCapacityBytes(Long capacityBytes) {
293+
this.capacityBytes = capacityBytes;
294+
}
295+
283296
public Long getDiskSizeTotal() {
284297
return diskSizeTotal;
285298
}

server/src/main/java/com/cloud/api/query/dao/StoragePoolJoinDaoImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ public StoragePoolResponse newStoragePoolResponse(StoragePoolJoinVO pool, boolea
141141
}
142142
}
143143
}
144+
poolResponse.setCapacityBytes(pool.getCapacityBytes());
144145
poolResponse.setDiskSizeTotal(pool.getCapacityBytes());
145146
poolResponse.setDiskSizeAllocated(allocatedSize);
146147
poolResponse.setCapacityIops(pool.getCapacityIops());
@@ -231,6 +232,7 @@ public StoragePoolResponse newStoragePoolForMigrationResponse(StoragePoolJoinVO
231232
}
232233

233234
long allocatedSize = pool.getUsedCapacity();
235+
poolResponse.setCapacityBytes(pool.getCapacityBytes());
234236
poolResponse.setDiskSizeTotal(pool.getCapacityBytes());
235237
poolResponse.setDiskSizeAllocated(allocatedSize);
236238
poolResponse.setCapacityIops(pool.getCapacityIops());

0 commit comments

Comments
 (0)