mirror of https://github.com/apache/cloudstack.git
bug 9651: added tags to network response for ui
This commit is contained in:
parent
0a1e93e957
commit
246c01b1ab
|
|
@ -116,6 +116,9 @@ public class NetworkResponse extends BaseResponse{
|
|||
@SerializedName(ApiConstants.SECURITY_GROUP_EANBLED) @Param(description="true if security group is enabled, false otherwise")
|
||||
private Boolean isSecurityGroupEnabled;
|
||||
|
||||
@SerializedName(ApiConstants.TAGS) @Param(description="comma separated tag")
|
||||
private String tags;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
|
@ -356,4 +359,17 @@ public class NetworkResponse extends BaseResponse{
|
|||
this.isSecurityGroupEnabled = sgEnabled;
|
||||
}
|
||||
|
||||
public void setTags(List<String> tags) {
|
||||
if (tags == null || tags.size() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
StringBuilder buf = new StringBuilder();
|
||||
for (String tag : tags) {
|
||||
buf.append(tag).append(",");
|
||||
}
|
||||
|
||||
this.tags = buf.delete(buf.length()-1, buf.length()).toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -956,7 +956,7 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
FirewallRuleResponse response = new FirewallRuleResponse();
|
||||
response.setId(fwRule.getId());
|
||||
response.setPrivateStartPort(Integer.toString(fwRule.getDestinationPortStart()));
|
||||
response.setPrivateEndPort(Integer.toString(fwRule.getDestinationPortEnd()));
|
||||
response.setPrivateEndPort(Integer.toString(fwRule.getDestinationPortEnd()));
|
||||
response.setProtocol(fwRule.getProtocol());
|
||||
response.setPublicStartPort(Integer.toString(fwRule.getSourcePortStart()));
|
||||
response.setPublicEndPort(Integer.toString(fwRule.getSourcePortEnd()));
|
||||
|
|
@ -2488,6 +2488,7 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
response.setDns2(profile.getDns2());
|
||||
|
||||
response.setIsSecurityGroupEnabled(network.isSecurityGroupEnabled());
|
||||
response.setTags(network.getTags());
|
||||
|
||||
// populate capability
|
||||
Map<Service, Map<Capability, String>> serviceCapabilitiesMap = ApiDBUtils.getNetworkCapabilities(networkOffering.getId(), network.getDataCenterId());
|
||||
|
|
|
|||
Loading…
Reference in New Issue