Skip to content

Commit b330f9e

Browse files
author
toni.zamparetti
committed
remove external id when creating network
1 parent 21b2025 commit b330f9e

21 files changed

Lines changed: 60 additions & 100 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})
@@ -266,10 +263,6 @@ public Boolean getDisplayNetwork() {
266263
return displayNetwork;
267264
}
268265

269-
public String getExternalId() {
270-
return externalId;
271-
}
272-
273266
public String getIsolatedPvlanType() {
274267
return isolatedPvlanType;
275268
}

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ 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
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: 10 additions & 14 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
return vo;
@@ -2722,30 +2722,30 @@ public void removeNics(final VirtualMachineProfile vm) {
27222722
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 {
27232723
// create network for private gateway
27242724
return createGuestNetwork(networkOfferingId, name, displayText, gateway, cidr, vlanId,
2725-
bypassVlanOverlapCheck, null, owner, null, pNtwk, pNtwk.getDataCenterId(), ACLType.Account, null,
2726-
vpcId, null, null, true, null, null, null, true, null, null,
2727-
null, null, null, null, null, null);
2725+
bypassVlanOverlapCheck, null, owner, null, pNtwk, pNtwk.getDataCenterId(),
2726+
ACLType.Account, null, vpcId, null, null, true, null, null,
2727+
null, null, null, null, null, null, null, null);
27282728
}
27292729

27302730
@Override
27312731
@DB
27322732
public Network createGuestNetwork(final long networkOfferingId, final String name, final String displayText, final String gateway, final String cidr, String vlanId,
27332733
boolean bypassVlanOverlapCheck, String networkDomain, final Account owner, final Long domainId, final PhysicalNetwork pNtwk,
27342734
final long zoneId, final ACLType aclType, Boolean subdomainAccess, final Long vpcId, final String ip6Gateway, final String ip6Cidr,
2735-
final Boolean isDisplayNetworkEnabled, final String isolatedPvlan, Network.PVlanType isolatedPvlanType, String externalId,
2735+
final Boolean isDisplayNetworkEnabled, final String isolatedPvlan, Network.PVlanType isolatedPvlanType,
27362736
String routerIp, String routerIpv6, String ip4Dns1, String ip4Dns2, String ip6Dns1, String ip6Dns2,
27372737
Pair<Integer, Integer> vrIfaceMTUs, Integer networkCidrSize) throws ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException {
27382738
// create Isolated/Shared/L2 network
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, ip4Dns1, ip4Dns2, ip6Dns1, ip6Dns2, vrIfaceMTUs, networkCidrSize);
2741+
isDisplayNetworkEnabled, isolatedPvlan, isolatedPvlanType, false, routerIp, routerIpv6, ip4Dns1, ip4Dns2, ip6Dns1, ip6Dns2, vrIfaceMTUs, networkCidrSize);
27422742
}
27432743

27442744
@DB
27452745
private Network createGuestNetwork(final long networkOfferingId, final String name, final String displayText, final String gateway, final String cidr, String vlanId,
27462746
boolean bypassVlanOverlapCheck, String networkDomain, final Account owner, final Long domainId, final PhysicalNetwork pNtwk,
27472747
final long zoneId, final ACLType aclType, Boolean subdomainAccess, final Long vpcId, final String ip6Gateway, final String ip6Cidr,
2748-
final Boolean isDisplayNetworkEnabled, final String isolatedPvlan, Network.PVlanType isolatedPvlanType, String externalId,
2748+
final Boolean isDisplayNetworkEnabled, final String isolatedPvlan, Network.PVlanType isolatedPvlanType,
27492749
final Boolean isPrivateNetwork, String routerIp, String routerIpv6, final String ip4Dns1, final String ip4Dns2,
27502750
final String ip6Dns1, final String ip6Dns2, Pair<Integer, Integer> vrIfaceMTUs, Integer networkCidrSize) throws ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException {
27512751

@@ -3013,13 +3013,9 @@ public Network doInTransaction(final TransactionStatus status) {
30133013
userNetwork.setIp6Gateway(ip6Gateway);
30143014
}
30153015

3016-
if (externalId != null) {
3017-
userNetwork.setExternalId(externalId);
3018-
}
3019-
3020-
if (StringUtils.isNotBlank(routerIp)) {
3021-
userNetwork.setRouterIp(routerIp);
3022-
}
3016+
if (StringUtils.isNotBlank(routerIp)) {
3017+
userNetwork.setRouterIp(routerIp);
3018+
}
30233019

30243020
if (StringUtils.isNotBlank(routerIpv6)) {
30253021
userNetwork.setRouterIpv6(routerIpv6);

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

@@ -239,7 +236,7 @@ public NetworkVO(TrafficType trafficType, Mode mode, BroadcastDomainType broadca
239236
}
240237

241238
public NetworkVO(long id, Network that, long offeringId, String guruName, long domainId, long accountId, long related, String name, String displayText,
242-
String networkDomain, GuestType guestType, long dcId, Long physicalNetworkId, ACLType aclType, boolean specifyIpRanges, Long vpcId, final boolean isRedundant, String externalId) {
239+
String networkDomain, GuestType guestType, long dcId, Long physicalNetworkId, ACLType aclType, boolean specifyIpRanges, Long vpcId, final boolean isRedundant) {
243240
this(id,
244241
that.getTrafficType(),
245242
that.getMode(),
@@ -283,7 +280,6 @@ public NetworkVO(long id, Network that, long offeringId, String guruName, long d
283280
if (StringUtils.isNotBlank(that.getIp6Dns2())) {
284281
this.ip6Dns2 = that.getIp6Dns2();
285282
}
286-
this.externalId = externalId;
287283
this.publicMtu = that.getPublicMtu();
288284
this.privateMtu = that.getPrivateMtu();
289285
}
@@ -701,14 +697,6 @@ public void setVpcId(Long vpcId) {
701697
this.vpcId = vpcId;
702698
}
703699

704-
public String getExternalId() {
705-
return externalId;
706-
}
707-
708-
public void setExternalId(String externalId) {
709-
this.externalId = externalId;
710-
}
711-
712700
public String getVlanIdAsUUID() {
713701
return vlanIdAsUUID;
714702
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2805,7 +2805,6 @@ public NetworkResponse createNetworkResponse(ResponseView view, Network network)
28052805
}
28062806
response.setNetworkSpannedZones(networkSpannedZones);
28072807
}
2808-
response.setExternalId(network.getExternalId());
28092808
response.setRedundantRouter(network.isRedundant());
28102809
response.setCreated(network.getCreated());
28112810
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
@@ -2001,7 +2001,7 @@ public Ternary<Boolean, List<NetworkOfferingVO>, Network> doInTransaction(Transa
20012001

20022002
guestNetwork = _networkMgr.createGuestNetwork(requiredOfferings.get(0).getId(), owner.getAccountName() + "-network", owner.getAccountName()
20032003
+ "-network", null, null, null, false, null, owner, null, physicalNetwork, zoneId, ACLType.Account, null, null, null, null, true, null, null, null, null, null,
2004-
null, null, null, null, null, null);
2004+
null, null, null, null, null);
20052005
if (guestNetwork == null) {
20062006
logger.warn("Failed to create default Virtual network for the account {} in zone {}", owner, zone);
20072007
throw new CloudRuntimeException(String.format("Failed to create a" +

0 commit comments

Comments
 (0)