You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2022/04/06 04:03:32 UTC
[cloudstack] branch main updated: api: add vpcname to networkacl response (#6207)
This is an automated email from the ASF dual-hosted git repository.
rohit pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/main by this push:
new ca8782b703 api: add vpcname to networkacl response (#6207)
ca8782b703 is described below
commit ca8782b703acc061441df5c37ef207ca8519544d
Author: Wei Zhou <we...@apache.org>
AuthorDate: Wed Apr 6 06:03:28 2022 +0200
api: add vpcname to networkacl response (#6207)
This PR fixes the vpc uuid in info card of network acls
---
.../org/apache/cloudstack/api/response/NetworkACLResponse.java | 8 ++++++++
server/src/main/java/com/cloud/api/ApiResponseHelper.java | 1 +
2 files changed, 9 insertions(+)
diff --git a/api/src/main/java/org/apache/cloudstack/api/response/NetworkACLResponse.java b/api/src/main/java/org/apache/cloudstack/api/response/NetworkACLResponse.java
index fca8bcdc4c..72ee80a2b0 100644
--- a/api/src/main/java/org/apache/cloudstack/api/response/NetworkACLResponse.java
+++ b/api/src/main/java/org/apache/cloudstack/api/response/NetworkACLResponse.java
@@ -43,6 +43,10 @@ public class NetworkACLResponse extends BaseResponse {
@Param(description = "Id of the VPC this ACL is associated with")
private String vpcId;
+ @SerializedName(ApiConstants.VPC_NAME)
+ @Param(description = "Name of the VPC this ACL is associated with")
+ private String vpcName;
+
@SerializedName(ApiConstants.FOR_DISPLAY)
@Param(description = "is ACL for display to the regular user", since = "4.4", authorized = {RoleType.Admin})
private Boolean forDisplay;
@@ -63,6 +67,10 @@ public class NetworkACLResponse extends BaseResponse {
this.vpcId = vpcId;
}
+ public void setVpcName(String vpcName) {
+ this.vpcName = vpcName;
+ }
+
public void setForDisplay(Boolean forDisplay) {
this.forDisplay = forDisplay;
}
diff --git a/server/src/main/java/com/cloud/api/ApiResponseHelper.java b/server/src/main/java/com/cloud/api/ApiResponseHelper.java
index 98fb8cd499..e0cc8509d0 100644
--- a/server/src/main/java/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/main/java/com/cloud/api/ApiResponseHelper.java
@@ -4438,6 +4438,7 @@ public class ApiResponseHelper implements ResponseGenerator {
Vpc vpc = ApiDBUtils.findVpcById(networkACL.getVpcId());
if (vpc != null) {
response.setVpcId(vpc.getUuid());
+ response.setVpcName(vpc.getName());
}
response.setObjectName("networkacllist");
return response;