Skip to content

Commit 75c3d71

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 45aa0df commit 75c3d71

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

@@ -288,6 +293,14 @@ public void setClusterName(String clusterName) {
288293
this.clusterName = clusterName;
289294
}
290295

296+
public Long getCapacityBytes() {
297+
return capacityBytes;
298+
}
299+
300+
public void setCapacityBytes(Long capacityBytes) {
301+
this.capacityBytes = capacityBytes;
302+
}
303+
291304
public Long getDiskSizeTotal() {
292305
return diskSizeTotal;
293306
}

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
@@ -153,6 +153,7 @@ public StoragePoolResponse newStoragePoolResponse(StoragePoolJoinVO pool, boolea
153153
}
154154
}
155155
}
156+
poolResponse.setCapacityBytes(pool.getCapacityBytes());
156157
poolResponse.setDiskSizeTotal(pool.getCapacityBytes());
157158
poolResponse.setDiskSizeAllocated(allocatedSize);
158159
poolResponse.setDiskSizeUsed(pool.getUsedBytes());
@@ -255,6 +256,7 @@ public StoragePoolResponse newStoragePoolForMigrationResponse(StoragePoolJoinVO
255256
}
256257

257258
long allocatedSize = pool.getUsedCapacity();
259+
poolResponse.setCapacityBytes(pool.getCapacityBytes());
258260
poolResponse.setDiskSizeTotal(pool.getCapacityBytes());
259261
poolResponse.setDiskSizeAllocated(allocatedSize);
260262
poolResponse.setCapacityIops(pool.getCapacityIops());

0 commit comments

Comments
 (0)