Skip to content

Commit 44bc134

Browse files
authored
Adding acl name to several responses (#4315)
1 parent b464fe4 commit 44bc134

4 files changed

Lines changed: 30 additions & 12 deletions

File tree

api/src/main/java/org/apache/cloudstack/api/response/NetworkACLItemResponse.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ public class NetworkACLItemResponse extends BaseResponse {
7373
@Param(description = "the ID of the ACL this item belongs to")
7474
private String aclId;
7575

76+
@SerializedName(ApiConstants.ACL_NAME)
77+
@Param(description = "the name of the ACL this item belongs to")
78+
private String aclName;
79+
7680
@SerializedName(ApiConstants.NUMBER)
7781
@Param(description = "Number of the ACL Item")
7882
private Integer number;
@@ -133,6 +137,10 @@ public void setAclId(String aclId) {
133137
this.aclId = aclId;
134138
}
135139

140+
public void setAclName(String aclName) {
141+
this.aclName = aclName;
142+
}
143+
136144
public void setNumber(Integer number) {
137145
this.number = number;
138146
}

api/src/main/java/org/apache/cloudstack/api/response/NetworkResponse.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes
222222
@Param(description = "ACL Id associated with the VPC network")
223223
private String aclId;
224224

225+
@SerializedName(ApiConstants.ACL_NAME)
226+
@Param(description = "ACL name associated with the VPC network")
227+
private String aclName;
228+
225229
@SerializedName(ApiConstants.STRECHED_L2_SUBNET)
226230
@Param(description = "true if network can span multiple zones", since = "4.4")
227231
private Boolean strechedL2Subnet;
@@ -238,10 +242,6 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes
238242
@Param(description = "If the network has redundant routers enabled", since = "4.11.1")
239243
private Boolean redundantRouter;
240244

241-
@SerializedName(ApiConstants.ACL_NAME)
242-
@Param(description = "ACL name associated with the VPC network", since = "4.15.0")
243-
private String aclName;
244-
245245
public Boolean getDisplayNetwork() {
246246
return displayNetwork;
247247
}
@@ -443,6 +443,14 @@ public void setAclId(String aclId) {
443443
this.aclId = aclId;
444444
}
445445

446+
public String getAclName() {
447+
return aclName;
448+
}
449+
450+
public void setAclName(String aclName) {
451+
this.aclName = aclName;
452+
}
453+
446454
public void setStrechedL2Subnet(Boolean strechedL2Subnet) {
447455
this.strechedL2Subnet = strechedL2Subnet;
448456
}
@@ -462,12 +470,4 @@ public Boolean getRedundantRouter() {
462470
public void setRedundantRouter(Boolean redundantRouter) {
463471
this.redundantRouter = redundantRouter;
464472
}
465-
466-
public String getAclName() {
467-
return aclName;
468-
}
469-
470-
public void setAclName(String aclName) {
471-
this.aclName = aclName;
472-
}
473473
}

api/src/main/java/org/apache/cloudstack/api/response/PrivateGatewayResponse.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ public class PrivateGatewayResponse extends BaseResponse implements ControlledEn
101101
@Param(description = "ACL Id set for private gateway")
102102
private String aclId;
103103

104+
@SerializedName(ApiConstants.ACL_NAME)
105+
@Param(description = "ACL name set for private gateway")
106+
private String aclName;
107+
104108
@Override
105109
public String getObjectId() {
106110
return this.id;
@@ -183,4 +187,8 @@ public void setAclId(String aclId) {
183187
this.aclId = aclId;
184188
}
185189

190+
public void setAclName(String aclName) {
191+
this.aclName = aclName;
192+
}
193+
186194
}

server/src/main/java/com/cloud/api/ApiResponseHelper.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2409,6 +2409,7 @@ public NetworkACLItemResponse createNetworkACLItemResponse(NetworkACLItem aclIte
24092409
NetworkACL acl = ApiDBUtils.findByNetworkACLId(aclItem.getAclId());
24102410
if (acl != null) {
24112411
response.setAclId(acl.getUuid());
2412+
response.setAclName(acl.getName());
24122413
}
24132414

24142415
//set tag information
@@ -3003,6 +3004,7 @@ public PrivateGatewayResponse createPrivateGatewayResponse(PrivateGateway result
30033004
NetworkACL acl = ApiDBUtils.findByNetworkACLId(result.getNetworkACLId());
30043005
if (acl != null) {
30053006
response.setAclId(acl.getUuid());
3007+
response.setAclName(acl.getName());
30063008
}
30073009

30083010
response.setObjectName("privategateway");

0 commit comments

Comments
 (0)