From b68661c54b324e17af29f8e90a5955ccb25293d7 Mon Sep 17 00:00:00 2001 From: vishesh92 Date: Mon, 23 Mar 2026 15:30:17 +0530 Subject: [PATCH] fixups --- .../cloudstack/api/ResponseGenerator.java | 2 - .../api/command/user/kms/CreateKMSKeyCmd.java | 9 ---- .../api/command/user/kms/ListKMSKeysCmd.java | 9 ---- .../api/response/KMSKeyResponse.java | 12 ----- .../java/com/cloud/api/ApiResponseHelper.java | 44 ------------------- .../apache/cloudstack/kms/KMSManagerImpl.java | 5 +-- 6 files changed, 2 insertions(+), 79 deletions(-) diff --git a/api/src/main/java/org/apache/cloudstack/api/ResponseGenerator.java b/api/src/main/java/org/apache/cloudstack/api/ResponseGenerator.java index 2e3832f29b3..219ab4dbc5e 100644 --- a/api/src/main/java/org/apache/cloudstack/api/ResponseGenerator.java +++ b/api/src/main/java/org/apache/cloudstack/api/ResponseGenerator.java @@ -609,6 +609,4 @@ public interface ResponseGenerator { ApiKeyPairResponse createKeyPairResponse(ApiKeyPair keyPair); ListResponse createKeypairPermissionsResponse(List permissions); - - KMSKeyResponse createKMSKeyResponse(KMSKey kmsKey); } diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/kms/CreateKMSKeyCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/kms/CreateKMSKeyCmd.java index c48c1343fa0..c2b8fb6fe09 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/kms/CreateKMSKeyCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/kms/CreateKMSKeyCmd.java @@ -63,11 +63,6 @@ public class CreateKMSKeyCmd extends BaseCmd implements UserCmd { description = "Description of the KMS key") private String description; - @Parameter(name = ApiConstants.PURPOSE, - type = CommandType.STRING, - description = "Purpose of the key: volume, tls. (default: volume)") - private String purpose; - @Parameter(name = ApiConstants.ZONE_ID, required = true, type = CommandType.UUID, @@ -112,10 +107,6 @@ public class CreateKMSKeyCmd extends BaseCmd implements UserCmd { return description; } - public String getPurpose() { - return purpose == null ? "volume" : purpose; - } - public Long getZoneId() { return zoneId; } diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/kms/ListKMSKeysCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/kms/ListKMSKeysCmd.java index 3856cc9fed5..c6e4292099f 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/kms/ListKMSKeysCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/kms/ListKMSKeysCmd.java @@ -54,11 +54,6 @@ public class ListKMSKeysCmd extends BaseListProjectAndAccountResourcesCmd implem description = "List KMS key by UUID") private Long id; - @Parameter(name = ApiConstants.PURPOSE, - type = CommandType.STRING, - description = "Filter by purpose: volume, tls") - private String purpose; - @Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class, @@ -80,10 +75,6 @@ public class ListKMSKeysCmd extends BaseListProjectAndAccountResourcesCmd implem return id; } - public String getPurpose() { - return purpose; - } - public Long getZoneId() { return zoneId; } diff --git a/api/src/main/java/org/apache/cloudstack/api/response/KMSKeyResponse.java b/api/src/main/java/org/apache/cloudstack/api/response/KMSKeyResponse.java index b9fdb1644ce..cd7a360a497 100644 --- a/api/src/main/java/org/apache/cloudstack/api/response/KMSKeyResponse.java +++ b/api/src/main/java/org/apache/cloudstack/api/response/KMSKeyResponse.java @@ -44,10 +44,6 @@ public class KMSKeyResponse extends BaseResponse implements ControlledViewEntity @Param(description = "the description of the key") private String description; - @SerializedName(ApiConstants.PURPOSE) - @Param(description = "the purpose of the key (VOLUME_ENCRYPTION, TLS_CERT)") - private String purpose; - @SerializedName(ApiConstants.ACCOUNT) @Param(description = "the account owning the key") private String accountName; @@ -140,14 +136,6 @@ public class KMSKeyResponse extends BaseResponse implements ControlledViewEntity this.description = description; } - public String getPurpose() { - return purpose; - } - - public void setPurpose(String purpose) { - this.purpose = purpose; - } - public String getAccountName() { return accountName; } diff --git a/server/src/main/java/com/cloud/api/ApiResponseHelper.java b/server/src/main/java/com/cloud/api/ApiResponseHelper.java index 541e03b4640..cf98df0da24 100644 --- a/server/src/main/java/com/cloud/api/ApiResponseHelper.java +++ b/server/src/main/java/com/cloud/api/ApiResponseHelper.java @@ -5802,48 +5802,4 @@ protected Map getResourceIconsUsingOsCategory(List sc = searchBuilder.create(); accountManager.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); - KeyPurpose keyPurpose = parseKeyPurpose(cmd.getPurpose()); + KeyPurpose keyPurpose = parseKeyPurpose("volume"); if (cmd.getId() != null) { sc.setParameters("id", cmd.getId()); }