Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@ public class NetworkResponse extends BaseResponseWithAssociatedNetwork implement
@Param(description = ApiConstants.PARAMETER_DESCRIPTION_KEEP_MAC_ADDRESS_ON_PUBLIC_NIC, since = "4.23.0")
private Boolean keepMacAddressOnPublicNic;

@SerializedName(ApiConstants.NETWORKRATE)
@Param(description = "Data transfer rate in megabits per second allowed.", since = "4.20.0")
private Integer networkRate;

public NetworkResponse() {}

public Boolean getDisplayNetwork() {
Expand Down Expand Up @@ -710,4 +714,12 @@ public void setIpv6Dns2(String ipv6Dns2) {
public void setKeepMacAddressOnPublicNic(Boolean keepMacAddressOnPublicNic) {
this.keepMacAddressOnPublicNic = keepMacAddressOnPublicNic;
}

public Integer getNetworkRate() {
return networkRate;
}

public void setNetworkRate(Integer networkRate) {
this.networkRate = networkRate;
}
}
1 change: 1 addition & 0 deletions server/src/main/java/com/cloud/api/ApiResponseHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -2678,6 +2678,7 @@ public NetworkResponse createNetworkResponse(ResponseView view, Network network)
response.setNetworkOfferingAvailability(networkOffering.getAvailability().toString());
response.setIsPersistent(networkOffering.isPersistent());
response.setSpecifyVlan(networkOffering.isSpecifyVlan());
response.setNetworkRate(ApiDBUtils.getNetworkRate(networkOffering.getId()));
if (Network.GuestType.Isolated.equals(network.getGuestType()) && network.getVpcId() == null) {
response.setEgressDefaultPolicy(networkOffering.isEgressDefaultPolicy());
}
Expand Down
2 changes: 1 addition & 1 deletion ui/src/config/section/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default {
return fields
},
details: () => {
const fields = ['name', 'id', 'description', 'type', 'traffictype', 'vpcid', 'vlan', 'cidr', 'ip6cidr', 'netmask', 'gateway', 'asnumber', 'aclname', 'ispersistent', 'restartrequired', 'reservediprange', 'redundantrouter', 'networkdomain', 'egressdefaultpolicy', 'zonename', 'account', 'domainpath', 'associatednetwork', 'associatednetworkid', 'ip4routing', 'ip6firewall', 'ip6routing', 'ip6routes', 'dns1', 'dns2', 'ip6dns1', 'ip6dns2', 'publicmtu', 'privatemtu']
const fields = ['name', 'id', 'description', 'type', 'traffictype', 'networkrate', 'vpcid', 'vlan', 'cidr', 'ip6cidr', 'netmask', 'gateway', 'asnumber', 'aclname', 'ispersistent', 'restartrequired', 'reservediprange', 'redundantrouter', 'networkdomain', 'egressdefaultpolicy', 'zonename', 'account', 'domainpath', 'associatednetwork', 'associatednetworkid', 'ip4routing', 'ip6firewall', 'ip6routing', 'ip6routes', 'dns1', 'dns2', 'ip6dns1', 'ip6dns2', 'publicmtu', 'privatemtu']
if (isAdmin()) {
const vlanIndex = fields.findIndex(detail => detail === 'vlan')
fields.splice(vlanIndex + 1, 0, 'broadcasturi')
Expand Down
8 changes: 4 additions & 4 deletions ui/src/config/section/offering.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ export default {
return params
},
filters: ['active', 'inactive'],
columns: ['name', 'displaytext', 'state', 'cpunumber', 'cpuspeed', 'memory', 'gpu', 'domain', 'zone', 'order'],
columns: ['name', 'displaytext', 'state', 'cpunumber', 'cpuspeed', 'memory', 'networkrate', 'gpu', 'domain', 'zone', 'order'],
details: () => {
var fields = ['name', 'id', 'displaytext', 'offerha', 'provisioningtype', 'storagetype', 'iscustomized', 'iscustomizediops', 'limitcpuuse', 'cpunumber', 'cpuspeed', 'memory', 'hosttags', 'tags', 'storageaccessgroups', 'storagetags', 'domain', 'zone', 'created', 'dynamicscalingenabled', 'diskofferingstrictness', 'encryptroot', 'purgeresources', 'leaseduration', 'gpucardid', 'gpucardname', 'vgpuprofileid', 'vgpuprofilename', 'gpucount', 'gpudisplay', 'leaseexpiryaction', 'externaldetails']
var fields = ['name', 'id', 'displaytext', 'offerha', 'provisioningtype', 'storagetype', 'iscustomized', 'iscustomizediops', 'limitcpuuse', 'cpunumber', 'cpuspeed', 'memory', 'networkrate', 'hosttags', 'tags', 'storageaccessgroups', 'storagetags', 'domain', 'zone', 'created', 'dynamicscalingenabled', 'diskofferingstrictness', 'encryptroot', 'purgeresources', 'leaseduration', 'gpucardid', 'gpucardname', 'vgpuprofileid', 'vgpuprofilename', 'gpucount', 'gpudisplay', 'leaseexpiryaction', 'externaldetails']
if (store.getters.apis.createServiceOffering &&
store.getters.apis.createServiceOffering.params.filter(x => x.name === 'storagepolicy').length > 0) {
fields.splice(6, 0, 'vspherestoragepolicy')
Expand Down Expand Up @@ -161,9 +161,9 @@ export default {
permission: ['listServiceOfferings', 'listInfrastructure'],
searchFilters: ['name', 'zoneid', 'domainid', 'cpunumber', 'cpuspeed', 'memory'],
params: { issystem: 'true', isrecursive: 'true' },
columns: ['name', 'state', 'systemvmtype', 'cpunumber', 'cpuspeed', 'memory', 'storagetype', 'offerha', 'order'],
columns: ['name', 'state', 'systemvmtype', 'cpunumber', 'cpuspeed', 'memory', 'networkrate', 'storagetype', 'offerha', 'order'],
filters: ['active', 'inactive'],
details: ['name', 'id', 'displaytext', 'systemvmtype', 'provisioningtype', 'storagetype', 'iscustomized', 'limitcpuuse', 'cpunumber', 'cpuspeed', 'memory', 'storagetags', 'hosttags', 'tags', 'domain', 'zone', 'created', 'dynamicscalingenabled', 'diskofferingstrictness'],
details: ['name', 'id', 'displaytext', 'systemvmtype', 'provisioningtype', 'storagetype', 'iscustomized', 'limitcpuuse', 'cpunumber', 'cpuspeed', 'memory', 'networkrate', 'storagetags', 'hosttags', 'tags', 'domain', 'zone', 'created', 'dynamicscalingenabled', 'diskofferingstrictness'],
resourceType: 'ServiceOffering',
tabs: [
{
Expand Down