Skip to content

Commit fcca3e8

Browse files
authored
api,server: encryptformat in volume response (#9106)
Fixes #9014 * api,server: encryptformat in volume response * Apply suggestions from code review * remove passphrase db change
1 parent 3321971 commit fcca3e8

4 files changed

Lines changed: 19 additions & 2 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 encrypt format of the volume", since = "4.19.1")
302+
private String encryptFormat;
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 setEncryptFormat(String encryptFormat) {
851+
this.encryptFormat = encryptFormat;
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
@@ -180,6 +180,7 @@ public VolumeResponse newVolumeResponse(ResponseView view, VolumeJoinVO volume)
180180

181181
if (view == ResponseView.Full) {
182182
volResponse.setPath(volume.getPath());
183+
volResponse.setEncryptFormat(volume.getEncryptFormat());
183184
}
184185

185186
// populate owner.

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

Lines changed: 7 additions & 0 deletions
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 encryptFormat;
280+
278281
public VolumeJoinVO() {
279282
}
280283

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

616+
public String getEncryptFormat() {
617+
return encryptFormat;
618+
}
619+
613620
@Override
614621
public Class<?> getEntityType() {
615622
return Volume.class;

0 commit comments

Comments
 (0)