Skip to content

Commit ace138e

Browse files
committed
add encryption type to volume response
1 parent a58ae36 commit ace138e

4 files changed

Lines changed: 19 additions & 3 deletions

File tree

‎api/src/main/java/org/apache/cloudstack/api/response/VolumeResponse.java‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,13 +290,17 @@ public class VolumeResponse extends BaseResponseWithTagInformation implements Co
290290
private String externalUuid;
291291

292292
@SerializedName(ApiConstants.VOLUME_CHECK_RESULT)
293-
@Param(description = "details for the volume check result, they may vary for different hypervisors, since = 4.19.1")
293+
@Param(description = "details for the volume check result, they may vary for different hypervisors", since = "4.19.1")
294294
private Map<String, String> volumeCheckResult;
295295

296296
@SerializedName(ApiConstants.VOLUME_REPAIR_RESULT)
297-
@Param(description = "details for the volume repair result, they may vary for different hypervisors, since = 4.19.1")
297+
@Param(description = "details for the volume repair result, they may vary for different hypervisors", since = "4.19.1")
298298
private Map<String, String> volumeRepairResult;
299299

300+
@SerializedName(ApiConstants.ENCRYPT_FORMAT)
301+
@Param(description = "the format of the disk encryption if applicable", since = "4.19.1")
302+
private String encryptionFormat;
303+
300304
public String getPath() {
301305
return path;
302306
}
@@ -842,4 +846,8 @@ public Map<String, String> getVolumeRepairResult() {
842846
public void setVolumeRepairResult(Map<String, String> volumeRepairResult) {
843847
this.volumeRepairResult = volumeRepairResult;
844848
}
849+
850+
public void setEncryptionFormat(String encryptionFormat) {
851+
this.encryptionFormat = encryptionFormat;
852+
}
845853
}

‎engine/schema/src/main/resources/META-INF/db/views/cloud.volume_view.sql‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ SELECT
3939
`volumes`.`path` AS `path`,
4040
`volumes`.`chain_info` AS `chain_info`,
4141
`volumes`.`external_uuid` AS `external_uuid`,
42+
`volumes`.`encrypt_format` AS `encrypt_format`,
4243
`account`.`id` AS `account_id`,
4344
`account`.`uuid` AS `account_uuid`,
4445
`account`.`account_name` AS `account_name`,

‎server/src/main/java/com/cloud/api/query/dao/VolumeJoinDaoImpl.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ public VolumeResponse newVolumeResponse(ResponseView view, VolumeJoinVO volume)
278278

279279
volResponse.setObjectName("volume");
280280
volResponse.setExternalUuid(volume.getExternalUuid());
281+
volResponse.setEncryptionFormat(volume.getEncryptionFormat());
281282
return volResponse;
282283
}
283284

‎server/src/main/java/com/cloud/api/query/vo/VolumeJoinVO.java‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@ public class VolumeJoinVO extends BaseViewWithTagInformationVO implements Contro
275275
@Column(name = "external_uuid")
276276
private String externalUuid = null;
277277

278+
@Column(name = "encrypt_format")
279+
private String encryptionFormat = null;
280+
278281
public VolumeJoinVO() {
279282
}
280283

@@ -610,9 +613,12 @@ public void setExternalUuid(String externalUuid) {
610613
this.externalUuid = externalUuid;
611614
}
612615

616+
public String getEncryptionFormat() {
617+
return encryptionFormat;
618+
}
619+
613620
@Override
614621
public Class<?> getEntityType() {
615622
return Volume.class;
616623
}
617-
618624
}

0 commit comments

Comments
 (0)