diff --git a/api/src/main/java/org/apache/cloudstack/api/response/NetworkResponse.java b/api/src/main/java/org/apache/cloudstack/api/response/NetworkResponse.java index 243579e2f710..d34f949372ae 100644 --- a/api/src/main/java/org/apache/cloudstack/api/response/NetworkResponse.java +++ b/api/src/main/java/org/apache/cloudstack/api/response/NetworkResponse.java @@ -163,6 +163,10 @@ public class NetworkResponse extends BaseResponseWithAssociatedNetwork implement @Param(description = "the domain name of the network owner") private String domain; + @SerializedName(ApiConstants.DOMAIN_PATH) + @Param(description = "path of the Domain the network belongs to", since = "4.19.0.0") + private String domainPath; + @SerializedName("isdefault") @Param(description = "true if network is default, false otherwise") private Boolean isDefault; @@ -420,6 +424,10 @@ public void setDomainName(String domain) { this.domain = domain; } + public void setDomainPath(String domainPath) { + this.domainPath = domainPath; + } + public void setNetworkOfferingAvailability(String networkOfferingAvailability) { this.networkOfferingAvailability = networkOfferingAvailability; } diff --git a/server/src/main/java/com/cloud/api/ApiResponseHelper.java b/server/src/main/java/com/cloud/api/ApiResponseHelper.java index 7ed31e21bc38..5b723a51cc88 100644 --- a/server/src/main/java/com/cloud/api/ApiResponseHelper.java +++ b/server/src/main/java/com/cloud/api/ApiResponseHelper.java @@ -2572,6 +2572,10 @@ public NetworkResponse createNetworkResponse(ResponseView view, Network network) Domain domain = ApiDBUtils.findDomainById(domainNetworkDetails.first()); if (domain != null) { response.setDomainId(domain.getUuid()); + + StringBuilder domainPath = new StringBuilder("ROOT"); + (domainPath.append(domain.getPath())).deleteCharAt(domainPath.length() - 1); + response.setDomainPath(domainPath.toString()); } } response.setSubdomainAccess(domainNetworkDetails.second()); diff --git a/ui/src/config/section/network.js b/ui/src/config/section/network.js index 153e6c5df5f0..070b266a3ba0 100644 --- a/ui/src/config/section/network.js +++ b/ui/src/config/section/network.js @@ -34,20 +34,20 @@ export default { permission: ['listNetworks'], resourceType: 'Network', columns: () => { - var fields = ['name', 'state', 'type', 'vpcname', 'cidr', 'ip6cidr', 'broadcasturi', 'account', 'domain', 'zonename'] + var fields = ['name', 'state', 'type', 'vpcname', 'cidr', 'ip6cidr', 'broadcasturi', 'domainpath', 'account', 'zonename'] if (!isAdmin()) { fields = fields.filter(function (e) { return e !== 'broadcasturi' }) } return fields }, details: () => { - var fields = ['name', 'id', 'description', 'type', 'traffictype', 'vpcid', 'vlan', 'broadcasturi', 'cidr', 'ip6cidr', 'netmask', 'gateway', 'aclname', 'ispersistent', 'restartrequired', 'reservediprange', 'redundantrouter', 'networkdomain', 'egressdefaultpolicy', 'zonename', 'account', 'domain', 'associatednetwork', 'associatednetworkid', 'ip6firewall', 'ip6routing', 'ip6routes', 'dns1', 'dns2', 'ip6dns1', 'ip6dns2', 'publicmtu', 'privatemtu'] + var fields = ['name', 'id', 'description', 'type', 'traffictype', 'vpcid', 'vlan', 'broadcasturi', 'cidr', 'ip6cidr', 'netmask', 'gateway', 'aclname', 'ispersistent', 'restartrequired', 'reservediprange', 'redundantrouter', 'networkdomain', 'egressdefaultpolicy', 'zonename', 'account', 'domainpath', 'associatednetwork', 'associatednetworkid', 'ip6firewall', 'ip6routing', 'ip6routes', 'dns1', 'dns2', 'ip6dns1', 'ip6dns2', 'publicmtu', 'privatemtu'] if (!isAdmin()) { fields = fields.filter(function (e) { return e !== 'broadcasturi' }) } return fields }, - filters: ['all', 'account', 'domain', 'shared'], + filters: ['all', 'account', 'domainpath', 'shared'], searchFilters: ['keyword', 'zoneid', 'domainid', 'account', 'type', 'tags'], related: [{ name: 'vm',