Skip to content

Commit 256f7a6

Browse files
committed
Merge remote-tracking branch 'apache/main' into add-feature-webhooks
2 parents 980dfb5 + 6dc3d06 commit 256f7a6

230 files changed

Lines changed: 11571 additions & 696 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

api/src/main/java/com/cloud/agent/api/to/NicTO.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ public class NicTO extends NetworkTO {
3232
Map<NetworkOffering.Detail, String> details;
3333
boolean dpdkEnabled;
3434
Integer mtu;
35+
Long networkId;
36+
37+
String networkSegmentName;
3538

3639
public NicTO() {
3740
super();
@@ -127,4 +130,20 @@ public Integer getMtu() {
127130
public void setMtu(Integer mtu) {
128131
this.mtu = mtu;
129132
}
133+
134+
public Long getNetworkId() {
135+
return networkId;
136+
}
137+
138+
public void setNetworkId(Long networkId) {
139+
this.networkId = networkId;
140+
}
141+
142+
public String getNetworkSegmentName() {
143+
return networkSegmentName;
144+
}
145+
146+
public void setNetworkSegmentName(String networkSegmentName) {
147+
this.networkSegmentName = networkSegmentName;
148+
}
130149
}

api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public class VirtualMachineTO {
8282

8383
Map<String, String> guestOsDetails = new HashMap<String, String>();
8484
Map<String, String> extraConfig = new HashMap<>();
85+
Map<Long, String> networkIdToNetworkNameMap = new HashMap<>();
8586
DeployAsIsInfoTO deployAsIsInfo;
8687

8788
public VirtualMachineTO(long id, String instanceName, VirtualMachine.Type type, int cpus, Integer speed, long minRam, long maxRam, BootloaderType bootloader,
@@ -392,6 +393,14 @@ public Map<String, String> getExtraConfig() {
392393
return extraConfig;
393394
}
394395

396+
public Map<Long, String> getNetworkIdToNetworkNameMap() {
397+
return networkIdToNetworkNameMap;
398+
}
399+
400+
public void setNetworkIdToNetworkNameMap(Map<Long, String> networkIdToNetworkNameMap) {
401+
this.networkIdToNetworkNameMap = networkIdToNetworkNameMap;
402+
}
403+
395404
public String getBootType() {
396405
return bootType;
397406
}

api/src/main/java/com/cloud/kubernetes/cluster/KubernetesClusterHelper.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@
2222
public interface KubernetesClusterHelper extends Adapter {
2323

2424
ControlledEntity findByUuid(String uuid);
25+
ControlledEntity findByVmId(long vmId);
2526
}

api/src/main/java/com/cloud/network/IpAddress.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,6 @@ enum Purpose {
9797

9898
void setRuleState(State ruleState);
9999

100+
boolean isForSystemVms();
101+
100102
}

api/src/main/java/com/cloud/network/Network.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ public static class Provider {
205205
//Add Tungsten Fabric provider
206206
public static final Provider Tungsten = new Provider("Tungsten", false);
207207

208+
public static final Provider Nsx = new Provider("Nsx", false);
209+
208210
private final String name;
209211
private final boolean isExternal;
210212

@@ -427,6 +429,8 @@ public void setIp6Address(String ip6Address) {
427429

428430
long getDataCenterId();
429431

432+
long getAccountId();
433+
430434
long getNetworkOfferingId();
431435

432436
@Override

api/src/main/java/com/cloud/network/NetworkService.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.util.List;
2020
import java.util.Map;
2121

22+
import com.cloud.dc.DataCenter;
2223
import org.apache.cloudstack.api.command.admin.address.ReleasePodIpCmdByAdmin;
2324
import org.apache.cloudstack.api.command.admin.network.DedicateGuestVlanRangeCmd;
2425
import org.apache.cloudstack.api.command.admin.network.ListDedicatedGuestVlanRangesCmd;
@@ -55,6 +56,7 @@
5556
import com.cloud.utils.exception.CloudRuntimeException;
5657
import com.cloud.vm.Nic;
5758
import com.cloud.vm.NicSecondaryIp;
59+
import org.apache.cloudstack.network.element.InternalLoadBalancerElementService;
5860

5961
/**
6062
* The NetworkService interface is the "public" api to entities that make requests to the orchestration engine
@@ -87,6 +89,8 @@ IpAddress allocateIP(Account ipOwner, long zoneId, Long networkId, Boolean displ
8789

8890
IpAddress reserveIpAddress(Account account, Boolean displayIp, Long ipAddressId) throws ResourceAllocationException;
8991

92+
IpAddress reserveIpAddressWithVlanDetail(Account account, DataCenter zone, Boolean displayIp, String vlanDetailKey) throws ResourceAllocationException;
93+
9094
boolean releaseReservedIpAddress(long ipAddressId) throws InsufficientAddressCapacityException;
9195

9296
boolean releaseIpAddress(long ipAddressId) throws InsufficientAddressCapacityException;
@@ -254,4 +258,9 @@ Network createPrivateNetwork(String networkName, String displayText, long physic
254258
PublicIpQuarantine updatePublicIpAddressInQuarantine(UpdateQuarantinedIpCmd cmd);
255259

256260
void removePublicIpAddressFromQuarantine(RemoveQuarantinedIpCmd cmd);
261+
262+
InternalLoadBalancerElementService getInternalLoadBalancerElementByType(VirtualRouterProvider.Type type);
263+
InternalLoadBalancerElementService getInternalLoadBalancerElementByNetworkServiceProviderId(long networkProviderId);
264+
InternalLoadBalancerElementService getInternalLoadBalancerElementById(long providerId);
265+
List<InternalLoadBalancerElementService> getInternalLoadBalancerElements();
257266
}

api/src/main/java/com/cloud/network/Networks.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ public <T> URI toUri(T value) {
128128
},
129129
UnDecided(null, null),
130130
OpenDaylight("opendaylight", String.class),
131-
TUNGSTEN("tf", String.class);
131+
TUNGSTEN("tf", String.class),
132+
NSX("nsx", String.class);
132133

133134
private final String scheme;
134135
private final Class<?> type;

api/src/main/java/com/cloud/network/VirtualRouterProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
public interface VirtualRouterProvider extends InternalIdentity, Identity {
2323
public enum Type {
24-
VirtualRouter, ElasticLoadBalancerVm, VPCVirtualRouter, InternalLbVm, NetScalerVm
24+
VirtualRouter, ElasticLoadBalancerVm, VPCVirtualRouter, InternalLbVm, NetScalerVm, Nsx
2525
}
2626

2727
public Type getType();

api/src/main/java/com/cloud/network/element/NetworkACLServiceProvider.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.cloud.exception.ResourceUnavailableException;
2222
import com.cloud.network.Network;
2323
import com.cloud.network.vpc.NetworkACLItem;
24+
import com.cloud.network.vpc.Vpc;
2425

2526
public interface NetworkACLServiceProvider extends NetworkElement {
2627

@@ -32,4 +33,6 @@ public interface NetworkACLServiceProvider extends NetworkElement {
3233
*/
3334
boolean applyNetworkACLs(Network config, List<? extends NetworkACLItem> rules) throws ResourceUnavailableException;
3435

36+
boolean reorderAclRules(Vpc vpc, List<? extends Network> networks, List<? extends NetworkACLItem> networkACLItems);
37+
3538
}

api/src/main/java/com/cloud/network/guru/NetworkGuru.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,24 @@ public interface NetworkGuru extends Adapter {
7979
* be used to make determination can be isolation methods, services
8080
* provided on the guest network and the service provider that's on the
8181
* guest network.
82-
*
82+
* <p>
8383
* If a network is already fully substantiated with the necessary resources
8484
* during this design phase, then the state should be set to Setup. If
8585
* the resources are not allocated at this point, the state should be set
8686
* to Allocated.
8787
*
88-
* @param offering network offering that contains the package of services
89-
* the end user intends to use on that network.
90-
* @param plan where is this network being deployed.
88+
* @param offering network offering that contains the package of services
89+
* the end user intends to use on that network.
90+
* @param plan where is this network being deployed.
9191
* @param userSpecified user specified parameters for this network.
92-
* @param owner owner of this network.
92+
* @param name
93+
* @param vpcId
94+
* @param owner owner of this network.
9395
* @return Network
9496
*/
95-
Network design(NetworkOffering offering, DeploymentPlan plan, Network userSpecified, Account owner);
97+
Network design(NetworkOffering offering, DeploymentPlan plan, Network userSpecified, String name, Long vpcId, Account owner);
98+
99+
void setup(Network network, long networkId);
96100

97101
/**
98102
* For guest networks that are in Allocated state after the design stage,

0 commit comments

Comments
 (0)