Skip to content

Commit bb04c3b

Browse files
author
toni.zamparetti
committed
remove external id when creating network
1 parent 7308dad commit bb04c3b

21 files changed

Lines changed: 61 additions & 101 deletions

File tree

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,6 @@ public void setIp6Address(String ip6Address) {
487487

488488
boolean isStrechedL2Network();
489489

490-
String getExternalId();
491-
492490
PVlanType getPvlanType();
493491

494492
String getRouterIp();

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ public class NetworkProfile implements Network {
6262
private Long networkAclId;
6363
private final String guruName;
6464
private boolean strechedL2Subnet;
65-
private String externalId;
6665
private Integer networkCidrSize;
6766

6867
public NetworkProfile(Network network) {
@@ -99,7 +98,6 @@ public NetworkProfile(Network network) {
9998
strechedL2Subnet = network.isStrechedL2Network();
10099
isRedundant = network.isRedundant();
101100
isRollingRestart = network.isRollingRestart();
102-
externalId = network.getExternalId();
103101
networkCidrSize = network.getNetworkCidrSize();
104102
}
105103

@@ -345,11 +343,6 @@ public boolean isStrechedL2Network() {
345343
return false;
346344
}
347345

348-
@Override
349-
public String getExternalId() {
350-
return externalId;
351-
}
352-
353346
@Override
354347
public PVlanType getPvlanType() {
355348
return null;

api/src/main/java/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,6 @@ public class CreateNetworkCmd extends BaseCmd implements UserCmd {
145145
@Parameter(name = ApiConstants.IP6_CIDR, type = CommandType.STRING, description = "The CIDR of IPv6 network, must be at least /64")
146146
private String ip6Cidr;
147147

148-
@Parameter(name = ApiConstants.EXTERNAL_ID, type = CommandType.STRING, description = "ID of the network in an external system.")
149-
private String externalId;
150-
151148
@Parameter(name = ApiConstants.DISPLAY_NETWORK,
152149
type = CommandType.BOOLEAN,
153150
description = "An optional field, whether to the display the network to the end User or not.", authorized = {RoleType.Admin})
@@ -271,10 +268,6 @@ public Boolean getDisplayNetwork() {
271268
return displayNetwork;
272269
}
273270

274-
public String getExternalId() {
275-
return externalId;
276-
}
277-
278271
public String getIsolatedPvlanType() {
279272
return isolatedPvlanType;
280273
}

api/src/test/java/org/apache/cloudstack/api/command/user/network/CreateNetworkCmdTest.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,6 @@ public void testGetDisplayNetwork() {
168168
Assert.assertEquals(cmd.getDisplayNetwork(), displayNet);
169169
}
170170

171-
@Test
172-
public void testGetExternalId() {
173-
String externalId = "1";
174-
ReflectionTestUtils.setField(cmd, "externalId", externalId);
175-
Assert.assertEquals(cmd.getExternalId(), externalId);
176-
}
177-
178171
@Test
179172
public void testGetAssociatedNetworkId() {
180173
Long associatedNetId = 1L;

engine/api/src/main/java/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,12 @@ void prepare(VirtualMachineProfile profile, DeployDestination dest, ReservationC
217217

218218
Network createGuestNetwork(long networkOfferingId, String name, String displayText, String gateway, String cidr, String vlanId, boolean bypassVlanOverlapCheck, String networkDomain, Account owner,
219219
Long domainId, PhysicalNetwork physicalNetwork, long zoneId, ACLType aclType, Boolean subdomainAccess, Long vpcId, String ip6Gateway, String ip6Cidr,
220-
Boolean displayNetworkEnabled, String isolatedPvlan, Network.PVlanType isolatedPvlanType, String externalId, String routerIp, String routerIpv6,
220+
Boolean displayNetworkEnabled, String isolatedPvlan, Network.PVlanType isolatedPvlanType, String routerIp, String routerIpv6,
221221
String ip4Dns1, String ip4Dns2, String ip6Dns1, String ip6Dns2, Pair<Integer, Integer> vrIfaceMTUs, Integer networkCidrSize) throws ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException;
222222

223223
Network createGuestNetwork(long networkOfferingId, String name, String displayText, String gateway, String cidr, String vlanId, boolean bypassVlanOverlapCheck, String networkDomain, Account owner,
224224
Long domainId, PhysicalNetwork physicalNetwork, long zoneId, ACLType aclType, Boolean subdomainAccess, Long vpcId, String ip6Gateway, String ip6Cidr,
225-
Boolean displayNetworkEnabled, String isolatedPvlan, Network.PVlanType isolatedPvlanType, String externalId, String routerIp, String routerIpv6,
225+
Boolean displayNetworkEnabled, String isolatedPvlan, Network.PVlanType isolatedPvlanType, String routerIp, String routerIpv6,
226226
String ip4Dns1, String ip4Dns2, String ip6Dns1, String ip6Dns2, Pair<Integer, Integer> vrIfaceMTUs, Integer networkCidrSize, boolean keepMacAddressOnPublicNic) throws ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException;
227227

228228
UserDataServiceProvider getPasswordResetProvider(Network network);

engine/components-api/src/main/java/com/cloud/network/vpc/VpcManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public interface VpcManager {
131131
Network
132132
createVpcGuestNetwork(long ntwkOffId, String name, String displayText, String gateway, String cidr, String vlanId, String networkDomain, Account owner,
133133
Long domainId, PhysicalNetwork pNtwk, long zoneId, ACLType aclType, Boolean subdomainAccess, long vpcId, Long aclId, Account caller,
134-
Boolean displayNetworkEnabled, String externalId, String ip6Gateway, String ip6Cidr, String ip4Dns1, String ip4Dns2, String ip6Dns1, String ip6Dns2,
134+
Boolean displayNetworkEnabled, String ip6Gateway, String ip6Cidr, String ip4Dns1, String ip4Dns2, String ip6Dns1, String ip6Dns2,
135135
Pair<Integer, Integer> vrIfaceMTUs, Integer networkCidrSize)
136136
throws ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException;
137137

engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ private static NetworkVO getNetworkVO(long id, final NetworkOffering offering, f
860860
final NetworkVO vo = new NetworkVO(id, network, offering.getId(), guru.getName(), owner.getDomainId(), owner.getId(),
861861
relatedFile, name, displayText, predefined.getNetworkDomain(), offering.getGuestType(),
862862
plan.getDataCenterId(), plan.getPhysicalNetworkId(), aclType, offering.isSpecifyIpRanges(),
863-
vpcId, offering.isRedundantRouter(), predefined.getExternalId());
863+
vpcId, offering.isRedundantRouter());
864864
vo.setDisplayNetwork(isDisplayNetworkEnabled == null || isDisplayNetworkEnabled);
865865
vo.setStrechedL2Network(offering.isSupportingStrechedL2());
866866
vo.setKeepMacAddressOnPublicNic(predefined.getKeepMacAddressOnPublicNic());
@@ -2723,22 +2723,22 @@ public void removeNics(final VirtualMachineProfile vm) {
27232723
public Network createPrivateNetwork(final long networkOfferingId, final String name, final String displayText, final String gateway, final String cidr, final String vlanId, final boolean bypassVlanOverlapCheck, final Account owner, final PhysicalNetwork pNtwk, final Long vpcId) throws ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException {
27242724
// create network for private gateway
27252725
return createGuestNetwork(networkOfferingId, name, displayText, gateway, cidr, vlanId,
2726-
bypassVlanOverlapCheck, null, owner, null, pNtwk, pNtwk.getDataCenterId(), ACLType.Account, null,
2727-
vpcId, null, null, true, null, null, null, true, null, null,
2728-
null, null, null, null, null, null, true);
2726+
bypassVlanOverlapCheck, null, owner, null, pNtwk, pNtwk.getDataCenterId(),
2727+
ACLType.Account, null, vpcId, null, null, true, null, null,
2728+
null, null, null, null, null, null, null, null);
27292729
}
27302730

27312731
@Override
27322732
@DB
27332733
public Network createGuestNetwork(final long networkOfferingId, final String name, final String displayText, final String gateway, final String cidr, String vlanId,
27342734
boolean bypassVlanOverlapCheck, String networkDomain, final Account owner, final Long domainId, final PhysicalNetwork pNtwk,
27352735
final long zoneId, final ACLType aclType, Boolean subdomainAccess, final Long vpcId, final String ip6Gateway, final String ip6Cidr,
2736-
final Boolean isDisplayNetworkEnabled, final String isolatedPvlan, Network.PVlanType isolatedPvlanType, String externalId,
2736+
final Boolean isDisplayNetworkEnabled, final String isolatedPvlan, Network.PVlanType isolatedPvlanType,
27372737
String routerIp, String routerIpv6, String ip4Dns1, String ip4Dns2, String ip6Dns1, String ip6Dns2,
27382738
Pair<Integer, Integer> vrIfaceMTUs, Integer networkCidrSize) throws ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException {
27392739
return createGuestNetwork(networkOfferingId, name, displayText, gateway, cidr, vlanId, bypassVlanOverlapCheck,
27402740
networkDomain, owner, domainId, pNtwk, zoneId, aclType, subdomainAccess, vpcId, ip6Gateway, ip6Cidr,
2741-
isDisplayNetworkEnabled, isolatedPvlan, isolatedPvlanType, externalId, false, routerIp, routerIpv6,
2741+
isDisplayNetworkEnabled, isolatedPvlan, isolatedPvlanType, false, routerIp, routerIpv6,
27422742
ip4Dns1, ip4Dns2, ip6Dns1, ip6Dns2, vrIfaceMTUs, networkCidrSize, true);
27432743
}
27442744

@@ -2747,21 +2747,21 @@ public Network createGuestNetwork(final long networkOfferingId, final String nam
27472747
public Network createGuestNetwork(final long networkOfferingId, final String name, final String displayText, final String gateway, final String cidr, String vlanId,
27482748
boolean bypassVlanOverlapCheck, String networkDomain, final Account owner, final Long domainId, final PhysicalNetwork pNtwk,
27492749
final long zoneId, final ACLType aclType, Boolean subdomainAccess, final Long vpcId, final String ip6Gateway, final String ip6Cidr,
2750-
final Boolean isDisplayNetworkEnabled, final String isolatedPvlan, Network.PVlanType isolatedPvlanType, String externalId,
2750+
final Boolean isDisplayNetworkEnabled, final String isolatedPvlan, Network.PVlanType isolatedPvlanType,
27512751
String routerIp, String routerIpv6, String ip4Dns1, String ip4Dns2, String ip6Dns1, String ip6Dns2,
27522752
Pair<Integer, Integer> vrIfaceMTUs, Integer networkCidrSize, boolean keepMacAddressOnPublicNic) throws ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException {
27532753
// create Isolated/Shared/L2 network
27542754
return createGuestNetwork(networkOfferingId, name, displayText, gateway, cidr, vlanId, bypassVlanOverlapCheck,
27552755
networkDomain, owner, domainId, pNtwk, zoneId, aclType, subdomainAccess, vpcId, ip6Gateway, ip6Cidr,
2756-
isDisplayNetworkEnabled, isolatedPvlan, isolatedPvlanType, externalId, false, routerIp, routerIpv6,
2756+
isDisplayNetworkEnabled, isolatedPvlan, isolatedPvlanType, false, routerIp, routerIpv6,
27572757
ip4Dns1, ip4Dns2, ip6Dns1, ip6Dns2, vrIfaceMTUs, networkCidrSize, keepMacAddressOnPublicNic);
27582758
}
27592759

27602760
@DB
27612761
private Network createGuestNetwork(final long networkOfferingId, final String name, final String displayText, final String gateway, final String cidr, String vlanId,
27622762
boolean bypassVlanOverlapCheck, String networkDomain, final Account owner, final Long domainId, final PhysicalNetwork pNtwk,
27632763
final long zoneId, final ACLType aclType, Boolean subdomainAccess, final Long vpcId, final String ip6Gateway, final String ip6Cidr,
2764-
final Boolean isDisplayNetworkEnabled, final String isolatedPvlan, Network.PVlanType isolatedPvlanType, String externalId,
2764+
final Boolean isDisplayNetworkEnabled, final String isolatedPvlan, Network.PVlanType isolatedPvlanType,
27652765
final Boolean isPrivateNetwork, String routerIp, String routerIpv6, final String ip4Dns1, final String ip4Dns2,
27662766
final String ip6Dns1, final String ip6Dns2, Pair<Integer, Integer> vrIfaceMTUs, Integer networkCidrSize,
27672767
boolean keepMacAddressOnPublicNic) throws ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException {
@@ -3030,10 +3030,6 @@ public Network doInTransaction(final TransactionStatus status) {
30303030
userNetwork.setIp6Gateway(ip6Gateway);
30313031
}
30323032

3033-
if (externalId != null) {
3034-
userNetwork.setExternalId(externalId);
3035-
}
3036-
30373033
if (StringUtils.isNotBlank(routerIp)) {
30383034
userNetwork.setRouterIp(routerIp);
30393035
}

engine/schema/src/main/java/com/cloud/network/dao/NetworkVO.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,6 @@ public class NetworkVO implements Network {
179179
@Column(name = "streched_l2")
180180
boolean strechedL2Network = false;
181181

182-
@Column(name = "external_id")
183-
String externalId;
184-
185182
@Transient
186183
String routerIp;
187184

@@ -243,7 +240,7 @@ public NetworkVO(TrafficType trafficType, Mode mode, BroadcastDomainType broadca
243240
}
244241

245242
public NetworkVO(long id, Network that, long offeringId, String guruName, long domainId, long accountId, long related, String name, String displayText,
246-
String networkDomain, GuestType guestType, long dcId, Long physicalNetworkId, ACLType aclType, boolean specifyIpRanges, Long vpcId, final boolean isRedundant, String externalId) {
243+
String networkDomain, GuestType guestType, long dcId, Long physicalNetworkId, ACLType aclType, boolean specifyIpRanges, Long vpcId, final boolean isRedundant) {
247244
this(id,
248245
that.getTrafficType(),
249246
that.getMode(),
@@ -287,7 +284,6 @@ public NetworkVO(long id, Network that, long offeringId, String guruName, long d
287284
if (StringUtils.isNotBlank(that.getIp6Dns2())) {
288285
this.ip6Dns2 = that.getIp6Dns2();
289286
}
290-
this.externalId = externalId;
291287
this.publicMtu = that.getPublicMtu();
292288
this.privateMtu = that.getPrivateMtu();
293289
}
@@ -705,14 +701,6 @@ public void setVpcId(Long vpcId) {
705701
this.vpcId = vpcId;
706702
}
707703

708-
public String getExternalId() {
709-
return externalId;
710-
}
711-
712-
public void setExternalId(String externalId) {
713-
this.externalId = externalId;
714-
}
715-
716704
public String getVlanIdAsUUID() {
717705
return vlanIdAsUUID;
718706
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2836,7 +2836,6 @@ public NetworkResponse createNetworkResponse(ResponseView view, Network network)
28362836
}
28372837
response.setNetworkSpannedZones(networkSpannedZones);
28382838
}
2839-
response.setExternalId(network.getExternalId());
28402839
response.setRedundantRouter(network.isRedundant());
28412840
response.setCreated(network.getCreated());
28422841
response.setSupportsVmAutoScaling(networkOfferingDao.findByIdIncludingRemoved(network.getNetworkOfferingId()).isSupportsVmAutoScaling());

server/src/main/java/com/cloud/network/IpAddressManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2013,7 +2013,7 @@ public Ternary<Boolean, List<NetworkOfferingVO>, Network> doInTransaction(Transa
20132013

20142014
guestNetwork = _networkMgr.createGuestNetwork(requiredOfferings.get(0).getId(), owner.getAccountName() + "-network", owner.getAccountName()
20152015
+ "-network", null, null, null, false, null, owner, null, physicalNetwork, zoneId, ACLType.Account, null, null, null, null, true, null, null, null, null, null,
2016-
null, null, null, null, null, null);
2016+
null, null, null, null, null);
20172017
if (guestNetwork == null) {
20182018
logger.warn("Failed to create default Virtual network for the account {} in zone {}", owner, zone);
20192019
throw new CloudRuntimeException(String.format("Failed to create a" +

0 commit comments

Comments
 (0)