Display acl name in listNetworks response (#4317)

* Display acl name in listNetworks response

Display acl name along with its id so that we
dont need to make extra api call to get acl name

* Add since tag
This commit is contained in:
Rakesh 2020-09-11 14:36:20 +02:00 committed by GitHub
parent 1fb50de9e8
commit 43a25c78f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View File

@ -719,6 +719,7 @@ public class ApiConstants {
public static final String AFFINITY_GROUP_ID = "affinitygroupid";
public static final String DEPLOYMENT_PLANNER = "deploymentplanner";
public static final String ACL_ID = "aclid";
public static final String ACL_NAME = "aclname";
public static final String NUMBER = "number";
public static final String IS_DYNAMICALLY_SCALABLE = "isdynamicallyscalable";
public static final String ROUTING = "isrouting";

View File

@ -238,6 +238,10 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes
@Param(description = "If the network has redundant routers enabled", since = "4.11.1")
private Boolean redundantRouter;
@SerializedName(ApiConstants.ACL_NAME)
@Param(description = "ACL name associated with the VPC network", since = "4.15.0")
private String aclName;
public Boolean getDisplayNetwork() {
return displayNetwork;
}
@ -458,4 +462,12 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes
public void setRedundantRouter(Boolean redundantRouter) {
this.redundantRouter = redundantRouter;
}
public String getAclName() {
return aclName;
}
public void setAclName(String aclName) {
this.aclName = aclName;
}
}

View File

@ -2279,6 +2279,7 @@ public class ApiResponseHelper implements ResponseGenerator {
NetworkACL acl = ApiDBUtils.findByNetworkACLId(network.getNetworkACLId());
if (acl != null) {
response.setAclId(acl.getUuid());
response.setAclName(acl.getName());
}
}