api: add vpcname to networkacl response (#6207)

This PR fixes the vpc uuid in info card of network acls
This commit is contained in:
Wei Zhou 2022-04-06 06:03:28 +02:00 committed by GitHub
parent 9cc8da2a30
commit ca8782b703
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;